org.jgroups.util.Util.getAnnotation()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.7k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中org.jgroups.util.Util.getAnnotation()方法的一些代码示例,展示了Util.getAnnotation()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getAnnotation()方法的具体详情如下:
包路径:org.jgroups.util.Util
类名称:Util
方法名:getAnnotation

Util.getAnnotation介绍

暂无

代码示例

代码示例来源:origin: wildfly/wildfly

private static void classToXML(Document xmldoc, Element parent, Class<?> clazz,
                String preAppendToSimpleClassName) throws Exception {
  XmlInclude incl=Util.getAnnotation(clazz, XmlInclude.class);
  if(incl != null) {
    String[] schemas=incl.schema();
    for (String schema : schemas) {
      Element incl_el = xmldoc.createElement(incl.type() == XmlInclude.Type.IMPORT ? "xs:import" : "xs:include");
      if (!incl.namespace().isEmpty())
        incl_el.setAttribute("namespace", incl.namespace());
      incl_el.setAttribute("schemaLocation", schema);
      Node first_child = xmldoc.getDocumentElement().getFirstChild();
      if (first_child == null)
        xmldoc.getDocumentElement().appendChild(incl_el);
      else
        xmldoc.getDocumentElement().insertBefore(incl_el, first_child);
    }
    if(!incl.alias().isEmpty())
      xmldoc.getDocumentElement().setAttribute("xmlns:" + incl.alias(), incl.namespace());
  }
  parent.appendChild(createXMLTree(xmldoc, clazz, preAppendToSimpleClassName));
}

代码示例来源:origin: wildfly/wildfly

XmlElement el=Util.getAnnotation(clazz, XmlElement.class);
if(el != null) {
  Element choice=xmldoc.createElement("xs:choice");
XmlAttribute xml_attr=Util.getAnnotation(clazz, XmlAttribute.class);
if(xml_attr != null) {
  String[] attrs=xml_attr.attrs();

代码示例来源:origin: org.jboss.eap/wildfly-client-all

private static void classToXML(Document xmldoc, Element parent, Class<?> clazz,
                String preAppendToSimpleClassName) throws Exception {
  XmlInclude incl=Util.getAnnotation(clazz, XmlInclude.class);
  if(incl != null) {
    String[] schemas=incl.schema();
    for (String schema : schemas) {
      Element incl_el = xmldoc.createElement(incl.type() == XmlInclude.Type.IMPORT ? "xs:import" : "xs:include");
      if (!incl.namespace().isEmpty())
        incl_el.setAttribute("namespace", incl.namespace());
      incl_el.setAttribute("schemaLocation", schema);
      Node first_child = xmldoc.getDocumentElement().getFirstChild();
      if (first_child == null)
        xmldoc.getDocumentElement().appendChild(incl_el);
      else
        xmldoc.getDocumentElement().insertBefore(incl_el, first_child);
    }
    if(!incl.alias().isEmpty())
      xmldoc.getDocumentElement().setAttribute("xmlns:" + incl.alias(), incl.namespace());
  }
  parent.appendChild(createXMLTree(xmldoc, clazz, preAppendToSimpleClassName));
}

代码示例来源:origin: org.jboss.eap/wildfly-client-all

XmlElement el=Util.getAnnotation(clazz, XmlElement.class);
if(el != null) {
  Element choice=xmldoc.createElement("xs:choice");
XmlAttribute xml_attr=Util.getAnnotation(clazz, XmlAttribute.class);
if(xml_attr != null) {
  String[] attrs=xml_attr.attrs();

相关文章

Util类方法