gpt4 book ai didi

org.apache.ws.commons.schema.XmlSchemaAppInfo类的使用及代码示例

转载 作者:知者 更新时间:2024-03-19 01:40:40 28 4
gpt4 key购买 nike

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

XmlSchemaAppInfo介绍

[英]Defines application specific information within an annotation. Represents the World Wide Web Consortium (W3C) appinfo element.
[中]在注释中定义特定于应用程序的信息。代表万维网联盟(W3C)appinfo元素。

代码示例

代码示例来源:origin: org.apache.ws.commons.schema/XmlSchema

/**
 * create new XmlSchemaAppinfo and add value goten from element
 * to this obj
 * @param content
 */
XmlSchemaAppInfo handleAppInfo(Element content) {
  XmlSchemaAppInfo appInfo = new XmlSchemaAppInfo();
  NodeList markup = new DocumentFragmentNodeList(content);
  if (!content.hasAttribute("source") && markup.getLength() == 0) {
    return null;
  }
  appInfo.setSource(getAttribute(content, "source"));
  appInfo.setMarkup(markup);
  return appInfo;
}

代码示例来源:origin: com.legsem.legstar/legstar-jaxbgen

/**
 * The content of appinfo is a raw W3C nodelist. It is convenient to put
 * this nodelist inside a DOM fragment called parent markup that we create
 * or recover here.
 * 
 * @param appInfo the application info element
 * @return a parent DOM fragment for the annotation nodes list
 */
protected DocumentFragment getMarkupParent(final XmlSchemaAppInfo appInfo) {
  NodeList markup = appInfo.getMarkup();
  DocumentFragment markupParent = null;
  if (markup == null || markup.getLength() == 0) {
    markupParent = _db.newDocument().createDocumentFragment();
  } else {
    markupParent = (DocumentFragment) markup.item(0).getParentNode();
  }
  return markupParent;
}

代码示例来源:origin: com.legsem.legstar/legstar-xsd2cob

appInfo = new XmlSchemaAppInfo();
  annotation.getItems().add(appInfo);
NodeList markup = appInfo.getMarkup();
if (markup == null || markup.getLength() == 0) {
appInfo.setMarkup(markup);
schemaObject.setAnnotation(annotation);

代码示例来源:origin: apache/cxf

XmlSchemaAppInfo appInfo = new XmlSchemaAppInfo();
try {
  DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
  appInfo.setMarkup(el.getChildNodes());
} catch (ParserConfigurationException ex) {
  throw new RuntimeException("[ObjectReferenceVisitor: error creating endpoint schema]");

代码示例来源:origin: com.legsem.legstar/legstar-jaxbgen

/**
 * Create a typesafeEnumMember markup. This provides a legal java identifier
 * for an enumeration value. Since these are constant values, we follow the
 * naming convention for static fields (all uppercase).
 * 
 * @param jaxbNamespace the JAXB namespace
 * @param jaxbNamespacePrefix the JAXB namespace prefix
 * @param enumerationFacet the enumeration facet to annotate
 * @param value the enumeration value.
 */
protected void injectJaxbTypeSafeEnumMemberAnnotation(
    final String jaxbNamespace, final String jaxbNamespacePrefix,
    final XmlSchemaEnumerationFacet enumerationFacet, final String value) {
  XmlSchemaAppInfo appInfo = getXmlSchemaAppInfo(enumerationFacet);
  DocumentFragment markupParent = getMarkupParent(appInfo);
  Element typesafeEnumMemberEl = getElement(markupParent, jaxbNamespace,
      jaxbNamespacePrefix, JAXB_TYPESAFEENUMMEMBER);
  typesafeEnumMemberEl.setAttribute(
      JAXB_TYPESAFEENUMMEMBER_NAME,
      DEFAULT_ENUMERATION_MEMBER_PREFIX
          + NameUtil.toVariableName(value).toUpperCase());
  appInfo.setMarkup(markupParent.getChildNodes());
}

代码示例来源:origin: com.legsem.legstar/legstar-jaxbgen

appInfo = new XmlSchemaAppInfo();
annotation.getItems().add(appInfo);

代码示例来源:origin: com.legsem.legstar/legstar-jaxbgen

/**
 * Create a typesafeEnumClass markup. This marks the simple Type as eligible
 * to become a separate Enum class.
 * 
 * @param jaxbNamespace the JAXB namespace
 * @param jaxbNamespacePrefix the JAXB namespace prefix
 * @param xsdSimpleType the simple type to annotate
 * @param elementName the name of the element whose simple type we are
 *            dealing with.
 */
protected void injectJaxbTypeSafeEnumClassAnnotation(
    final String jaxbNamespace, final String jaxbNamespacePrefix,
    final XmlSchemaSimpleType xsdSimpleType, final String elementName) {
  XmlSchemaAppInfo appInfo = getXmlSchemaAppInfo(xsdSimpleType);
  DocumentFragment markupParent = getMarkupParent(appInfo);
  Element typesafeEnumClassEl = getElement(markupParent, jaxbNamespace,
      jaxbNamespacePrefix, JAXB_TYPESAFEENUMCLASS);
  typesafeEnumClassEl.setAttribute(JAXB_TYPESAFEENUMCLASS_NAME,
      NameUtil.toClassName(elementName));
  appInfo.setMarkup(markupParent.getChildNodes());
}

代码示例来源:origin: org.apache.ws/com.springsource.org.apache.ws.commons.schema

/**
 * create new XmlSchemaAppinfo and add value goten from element
 * to this obj
 * @param content
 */
XmlSchemaAppInfo handleAppInfo(Element content) {
  XmlSchemaAppInfo appInfo = new XmlSchemaAppInfo();
  NodeList markup = getChildren(content);
  if (!content.hasAttribute("source") &&
      (markup == null || markup.getLength() <= 0)) {
    return null;
  }
  appInfo.setSource(getAttribute(content, "source"));
  appInfo.setMarkup(markup);
  return appInfo;
}

代码示例来源:origin: com.legsem.legstar/legstar-jaxbgen

jaxbNamespacePrefix);
appInfo.setMarkup(markupParent.getChildNodes());

代码示例来源:origin: com.legsem.legstar/legstar-xsd2cob

/**
 * Extracts the cobol annotation from an XML schema element.
 * 
 * @param xsdElement the XML schema element
 * @return the COBOL annotation or bull if none found
 */
protected Element getCobolAnnotation(XmlSchemaElement xsdElement) {
  XmlSchemaAnnotation annotation = xsdElement.getAnnotation();
  if (annotation != null && annotation.getItems().getCount() > 0) {
    XmlSchemaAppInfo appinfo = (XmlSchemaAppInfo) annotation.getItems()
        .getItem(0);
    if (appinfo.getMarkup() != null) {
      for (int i = 0; i < appinfo.getMarkup().getLength(); i++) {
        Node node = appinfo.getMarkup().item(i);
        if (node instanceof Element
            && node.getLocalName().equals(CobolMarkup.ELEMENT)
            && node.getNamespaceURI().equals(CobolMarkup.NS)) {
          return (Element) node;
        }
      }
    }
  }
  return null;
}

代码示例来源:origin: org.apache.ws.schema/XmlSchema

/**
 * create new XmlSchemaAppinfo and add value goten from element
 * to this obj
 * @param content
 */
XmlSchemaAppInfo handleAppInfo(Element content) {
  XmlSchemaAppInfo appInfo = new XmlSchemaAppInfo();
  NodeList markup = new DocumentFragmentNodeList(content);
  if (!content.hasAttribute("source") && markup.getLength() == 0) {
    return null;
  }
  appInfo.setSource(getAttribute(content, "source"));
  appInfo.setMarkup(markup);
  return appInfo;
}

代码示例来源:origin: com.legsem.legstar/legstar-xsd2cob

/** {@inheritDoc} */
public void processElement(final XmlSchema schema,
    final XmlSchemaElement xsdElement, final int level)
    throws XsdMappingException {
  XmlSchemaAnnotation annotation = xsdElement.getAnnotation();
  if (annotation != null && annotation.getItems().getCount() > 0) {
    XmlSchemaAppInfo appinfo = (XmlSchemaAppInfo) annotation.getItems()
        .getItem(0);
    if (appinfo.getMarkup() != null) {
      for (int i = 0; i < appinfo.getMarkup().getLength(); i++) {
        Node node = appinfo.getMarkup().item(i);
        if (node instanceof Element
            && node.getLocalName().equals(CobolMarkup.ELEMENT)
            && node.getNamespaceURI().equals(CobolMarkup.NS)) {
          writeElement(schema, xsdElement, _writer,
              (Element) node, level);
        }
      }
    }
  }
}

代码示例来源:origin: apache/cxf

XmlSchemaAppInfo appInfo = (XmlSchemaAppInfo)item;
if (appInfo != null) {
  NodeList nlist = appInfo.getMarkup();
  Node node = nlist.item(0);
  String info = node.getNodeValue();

代码示例来源:origin: apache/cxf

NodeList nlist = appInfo.getMarkup();
Node node = nlist.item(0);
String info = node.getNodeValue();

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com