org.apache.ws.commons.schema.XmlSchemaContentModel Java Examples

The following examples show how to use org.apache.ws.commons.schema.XmlSchemaContentModel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: XmlSchemaUtils.java    From cxf with Apache License 2.0 6 votes vote down vote up
public static QName getBaseType(XmlSchemaComplexType type) {
    XmlSchemaContentModel model = type.getContentModel();
    if (model == null) {
        return null;
    }
    XmlSchemaContent content = model.getContent();
    if (content == null) {
        return null;
    }

    if (!(content instanceof XmlSchemaComplexContentExtension)) {
        return null;
    }

    XmlSchemaComplexContentExtension ext = (XmlSchemaComplexContentExtension)content;
    return ext.getBaseTypeName();
}
 
Example #2
Source File: XmlSchemaUtils.java    From cxf with Apache License 2.0 6 votes vote down vote up
public static List<XmlSchemaAttributeOrGroupRef> getContentAttributes(XmlSchemaComplexType type) {
    XmlSchemaContentModel model = type.getContentModel();
    if (model == null) {
        return null;
    }
    XmlSchemaContent content = model.getContent();
    if (content == null) {
        return null;
    }
    if (!(content instanceof XmlSchemaComplexContentExtension)) {
        return null;
    }

    XmlSchemaComplexContentExtension ext = (XmlSchemaComplexContentExtension)content;
    return ext.getAttributes();
}
 
Example #3
Source File: XmlSchemaExtractor.java    From syndesis with Apache License 2.0 5 votes vote down vote up
private void handleComplexType(XmlSchemaComplexType target, XmlSchemaComplexType source) throws ParserException {

        // copy attributes
        handleAttributesOrGroupRefs(target.getAttributes(), source.getAttributes());

        // handle contentModel
        final XmlSchemaContentModel sourceContentModel = source.getContentModel();
        if (sourceContentModel != null) {
            target.setContentModel(createXmlSchemaObjectBase(sourceContentModel));
        }

        handleParticle(source.getParticle(), target::setParticle);
    }
 
Example #4
Source File: CommonsSchemaInfoBuilder.java    From tomee with Apache License 2.0 5 votes vote down vote up
private static boolean isSoapArray(XmlSchemaComplexType complexType) {
    // Soap arrays are based on complex content restriction
    XmlSchemaContentModel contentModel = complexType.getContentModel();
    if (contentModel == null) {
        return false;
    }
    XmlSchemaContent content = contentModel.getContent();
    if (!(content instanceof XmlSchemaComplexContentRestriction)) {
        return false;
    }

    XmlSchemaComplexContentRestriction restriction = (XmlSchemaComplexContentRestriction) content;
    return SOAP_ARRAY.equals(restriction.getBaseTypeName());
}
 
Example #5
Source File: XmlSchemaExtractor.java    From syndesis with Apache License 2.0 4 votes vote down vote up
private void handleContentModel(XmlSchemaContentModel target, XmlSchemaContentModel source) throws ParserException {
    target.setContent(createXmlSchemaObjectBase(source.getContent()));
}