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

x33g5p2x  于2022-02-03 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(95)

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

XmlSchemaSimpleContentExtension介绍

[英]Class for simple types that are derived by extension. Extends the simple type content of the element by adding attributes. Represents the World Wide Web Consortium (W3C) extension element for simple content.
[中]为通过扩展派生的简单类型初始化。通过添加属性扩展元素的简单类型内容。表示用于简单内容的万维网联盟(W3C)扩展元素。

代码示例

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

/**
 * Return true for xsd:base64Binary or simple restrictions of it, as in the xmime stock type.
 * @param type
 * @return
 */
public static boolean mtomCandidateType(XmlSchemaType type) {
  if (type == null) {
    return false;
  }
  if (Constants.XSD_BASE64.equals(type.getQName())) {
    return true;
  }
  // there could be some disagreement whether the following is a good enough test.
  // what if 'base64binary' was extended in some crazy way? At runtime, either it has
  // an xop:Include or it doesn't.
  if (type instanceof XmlSchemaComplexType) {
    XmlSchemaComplexType complexType = (XmlSchemaComplexType)type;
    if (complexType.getContentModel() instanceof XmlSchemaSimpleContent) {
      XmlSchemaSimpleContent content = (XmlSchemaSimpleContent)complexType.getContentModel();
      if (content.getContent() instanceof XmlSchemaSimpleContentExtension) {
        XmlSchemaSimpleContentExtension extension =
          (XmlSchemaSimpleContentExtension)content.getContent();
        if (Constants.XSD_BASE64.equals(extension.getBaseTypeName())) {
          return true;
        }
      }
    }
  }
  return false;
}

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

private XmlSchemaSimpleContentExtension handleSimpleContentExtension(
    XmlSchema schema, Element extEl, Element schemaEl) {
  XmlSchemaSimpleContentExtension ext = new XmlSchemaSimpleContentExtension();
  if (extEl.hasAttribute("base")) {
    String name = extEl.getAttribute("base");
    ext.baseTypeName = getRefQName(name, extEl);
  }
  for (Element el = XDOMUtil.getFirstChildElementNS(extEl,
      XmlSchema.SCHEMA_NS); el != null; el = XDOMUtil
      .getNextSiblingElementNS(el, XmlSchema.SCHEMA_NS)) {
    if (el.getLocalName().equals("attribute")) {
      XmlSchemaAttribute attr = handleAttribute(schema, el, schemaEl);
      ext.attributes.add(attr);
    } else if (el.getLocalName().equals("attributeGroup")) {
      XmlSchemaAttributeGroupRef attrGroup = handleAttributeGroupRef(el);
      ext.attributes.add(attrGroup);
    } else if (el.getLocalName().equals("anyAttribute")) {
      ext.anyAttribute = handleAnyAttribute(schema, el, schemaEl);
    } else if (el.getLocalName().equals("annotation")) {
      XmlSchemaAnnotation ann = handleAnnotation(el);
      ext.setAnnotation(ann);
    }
  }
  return ext;
}

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

(XmlSchemaSimpleContentExtension)simpleContent.getContent();
  if (ext.getBaseTypeName() != null) {
    basetype = processPrimitiveType(ext.getBaseTypeName());
    base = getSchemaType(ext.getBaseTypeName());
    basetype = convertSchemaToCorbaType(base, base.getQName(), base, null, false);
    typeMappingType.getStructOrExceptionOrUnion().add(basetype);
  attrMembers = processAttributesAsMembers(ext.getAttributes(), uri);
} else if (simpleContent.getContent() instanceof XmlSchemaSimpleContentRestriction) {
  XmlSchemaSimpleContentRestriction restrict

代码示例来源:origin: org.apache.axis2/axis2-adb-codegen

if (!isAlreadyProcessed(extension.getBaseTypeName())) {
  XmlSchema resolvedSchema = getParentSchema(parentSchema, extension.getBaseTypeName(),
                        COMPONENT_TYPE);
  if (resolvedSchema == null) {
    throw new SchemaCompilationException("can not find type " +
                       extension.getBaseTypeName()
                       + " from the parent schema " +
                       parentSchema.getTargetNamespace());
  } else {
    XmlSchemaType type = resolvedSchema.getTypeByName(extension.getBaseTypeName());
    if (type instanceof XmlSchemaComplexType) {
      XmlSchemaComplexType complexType = (XmlSchemaComplexType) type;
processSimpleExtensionBaseType(extension.getBaseTypeName(), metaInfHolder, parentSchema);
for (XmlSchemaAttributeOrGroupRef attr : extension.getAttributes()) {
  if (attr instanceof XmlSchemaAttribute) {
    processAttribute((XmlSchemaAttribute) attr, metaInfHolder, parentSchema);
XmlSchemaAnyAttribute anyAtt = extension.getAnyAttribute();
if (anyAtt != null) {
  processAnyAttribute(metaInfHolder, anyAtt);

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

} else if (content instanceof XmlSchemaSimpleContentExtension) {
  XmlSchemaSimpleContentExtension extension = (XmlSchemaSimpleContentExtension)content;
  XmlSchemaUtils.addImportIfNeeded(schema, extension.getBaseTypeName());
  addCrossImportsAttributeList(schema, extension.getAttributes());
} else if (content instanceof XmlSchemaSimpleContentRestriction) {
  XmlSchemaSimpleContentRestriction restriction = (XmlSchemaSimpleContentRestriction)content;

代码示例来源:origin: apache/axis2-java

if (!isAlreadyProcessed(extension.getBaseTypeName())) {
  XmlSchema resolvedSchema = getParentSchema(parentSchema, extension.getBaseTypeName(),
                        COMPONENT_TYPE);
  if (resolvedSchema == null) {
    throw new SchemaCompilationException("can not find type " +
                       extension.getBaseTypeName()
                       + " from the parent schema " +
                       parentSchema.getTargetNamespace());
  } else {
    XmlSchemaType type = resolvedSchema.getTypeByName(extension.getBaseTypeName());
    if (type instanceof XmlSchemaComplexType) {
      XmlSchemaComplexType complexType = (XmlSchemaComplexType) type;
processSimpleExtensionBaseType(extension.getBaseTypeName(), metaInfHolder, parentSchema);
for (XmlSchemaAttributeOrGroupRef attr : extension.getAttributes()) {
  if (attr instanceof XmlSchemaAttribute) {
    processAttribute((XmlSchemaAttribute) attr, metaInfHolder, parentSchema);
XmlSchemaAnyAttribute anyAtt = extension.getAnyAttribute();
if (anyAtt != null) {
  processAnyAttribute(metaInfHolder, anyAtt);

代码示例来源:origin: org.apache.cxf/cxf-api

} else if (content instanceof XmlSchemaSimpleContentExtension) {
  XmlSchemaSimpleContentExtension extension = (XmlSchemaSimpleContentExtension)content;
  XmlSchemaUtils.addImportIfNeeded(schema, extension.getBaseTypeName());
  addCrossImportsAttributeList(schema, extension.getAttributes());
} else if (content instanceof XmlSchemaSimpleContentRestriction) {
  XmlSchemaSimpleContentRestriction restriction = (XmlSchemaSimpleContentRestriction)content;

代码示例来源:origin: org.apache.axis2/axis2-adb-codegen

extension.getBaseTypeName(), resolvedSchema);

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

private XmlSchemaSimpleContentExtension handleSimpleContentExtension(
    XmlSchema schema, Element extEl, Element schemaEl) {
  XmlSchemaSimpleContentExtension ext = new XmlSchemaSimpleContentExtension();
  if (extEl.hasAttribute("base")) {
    String name = extEl.getAttribute("base");
    ext.baseTypeName = getRefQName(name, extEl);
  }
  for (Element el = XDOMUtil.getFirstChildElementNS(extEl,
      XmlSchema.SCHEMA_NS); el != null; el = XDOMUtil
      .getNextSiblingElementNS(el, XmlSchema.SCHEMA_NS)) {
    if (el.getLocalName().equals("attribute")) {
      XmlSchemaAttribute attr = handleAttribute(schema, el, schemaEl);
      ext.attributes.add(attr);
    } else if (el.getLocalName().equals("attributeGroup")) {
      XmlSchemaAttributeGroupRef attrGroup = handleAttributeGroupRef(el);
      ext.attributes.add(attrGroup);
    } else if (el.getLocalName().equals("anyAttribute")) {
      ext.anyAttribute = handleAnyAttribute(schema, el, schemaEl);
    } else if (el.getLocalName().equals("annotation")) {
      XmlSchemaAnnotation ann = handleAnnotation(el);
      ext.setAnnotation(ann);
    }
  }
  return ext;
}

代码示例来源:origin: org.apache.cxf/cxf-core

} else if (content instanceof XmlSchemaSimpleContentExtension) {
  XmlSchemaSimpleContentExtension extension = (XmlSchemaSimpleContentExtension)content;
  XmlSchemaUtils.addImportIfNeeded(schema, extension.getBaseTypeName());
  addCrossImportsAttributeList(schema, extension.getAttributes());
} else if (content instanceof XmlSchemaSimpleContentRestriction) {
  XmlSchemaSimpleContentRestriction restriction = (XmlSchemaSimpleContentRestriction)content;

代码示例来源:origin: apache/axis2-java

extension.getBaseTypeName(), resolvedSchema);

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

new XmlSchemaSimpleContentExtension();
} else if (el.getLocalName().equals("annotation")) {
  XmlSchemaAnnotation ann = handleAnnotation(el);
  ext.setAnnotation(ann);

代码示例来源:origin: org.apache.cxf/cxf-common-utilities

} else if (content instanceof XmlSchemaSimpleContentExtension) {
  XmlSchemaSimpleContentExtension extension = (XmlSchemaSimpleContentExtension)content;
  XmlSchemaUtils.addImportIfNeeded(schema, extension.getBaseTypeName());
  addCrossImportsAttributeList(schema, extension.getAttributes());
} else if (content instanceof XmlSchemaSimpleContentRestriction) {
  XmlSchemaSimpleContentRestriction restriction = (XmlSchemaSimpleContentRestriction)content;

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

} else if (content instanceof XmlSchemaSimpleContentExtension) {
  XmlSchemaSimpleContentExtension extension = (XmlSchemaSimpleContentExtension)content;
  XmlSchemaUtils.addImportIfNeeded(schema, extension.getBaseTypeName());
  addCrossImportsAttributeList(schema, extension.getAttributes());
} else if (content instanceof XmlSchemaSimpleContentRestriction) {
  XmlSchemaSimpleContentRestriction restriction = (XmlSchemaSimpleContentRestriction)content;

相关文章