Java Code Examples for org.apache.ws.commons.schema.XmlSchemaForm#QUALIFIED

The following examples show how to use org.apache.ws.commons.schema.XmlSchemaForm#QUALIFIED . 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: WSDLToCorbaHelper.java    From cxf with Apache License 2.0 6 votes vote down vote up
private boolean getElementQualification(XmlSchemaElement element, String uri) {
    QName schemaName = element.getQName();
    if (element.isRef()) {
        schemaName = element.getRef().getTargetQName();
    }

    if (schemaName.getNamespaceURI().isEmpty()) {
        schemaName = new QName(uri, schemaName.getLocalPart());
    }
    boolean qualified = false;
    if (element.getForm() == XmlSchemaForm.QUALIFIED) {
        qualified = true;
    } else {
        qualified = WSDLUtils.isElementFormQualified(xmlSchemaList, schemaName);
    }
    return qualified;
}
 
Example 2
Source File: WSDLASTVisitor.java    From cxf with Apache License 2.0 5 votes vote down vote up
public void setQualified(boolean qualified) throws Exception  {
    if (qualified) {
        XmlSchemaForm form = XmlSchemaForm.QUALIFIED;
        schema.setAttributeFormDefault(form);
        schema.setElementFormDefault(form);
    }
}
 
Example 3
Source File: WSDLToCorbaHelper.java    From cxf with Apache License 2.0 5 votes vote down vote up
private boolean getAttributeQualification(XmlSchemaAttribute attr, String uri) {
    QName schemaName = attr.getQName();

    boolean qualified = false;
    if (attr.getForm() == XmlSchemaForm.QUALIFIED) {
        qualified = true;
    } else {
        qualified = WSDLUtils.isElementFormQualified(xmlSchemaList, schemaName);
    }
    return qualified;
}
 
Example 4
Source File: WSDLUtils.java    From cxf with Apache License 2.0 5 votes vote down vote up
public static boolean isElementFormQualified(SchemaCollection schemas, QName type) {
    if (type != null) {
        XmlSchema sch = schemas.getSchemaByTargetNamespace(type.getNamespaceURI());
        if (sch != null) {
            return sch.getElementFormDefault()  == XmlSchemaForm.QUALIFIED;
        }
    }
    return false;
}
 
Example 5
Source File: WSDLUtils.java    From cxf with Apache License 2.0 5 votes vote down vote up
public static boolean isElementFormQualified(XmlSchema schema, QName type) {
    if (type != null) {
        String uri = type.getNamespaceURI();
        if (uri.equals(schema.getTargetNamespace())) {
            return schema.getElementFormDefault() == XmlSchemaForm.QUALIFIED;
        }
        for (XmlSchemaExternal extSchema : schema.getExternals()) {
            return isElementFormQualified(extSchema.getSchema(), type);
        }
    }
    return false;
}
 
Example 6
Source File: ProcessorUtil.java    From cxf with Apache License 2.0 5 votes vote down vote up
public static boolean isSchemaFormQualified(ToolContext context, QName partElement) {
    ServiceInfo serviceInfo = context.get(ServiceInfo.class);
    SchemaCollection schemaCol = serviceInfo.getXmlSchemaCollection();
    XmlSchema schema = schemaCol.getSchemaForElement(partElement);
    if (schema != null) {
        return schema.getElementFormDefault() == XmlSchemaForm.QUALIFIED;
    }
    return false;

}
 
Example 7
Source File: CorbaUtils.java    From cxf with Apache License 2.0 5 votes vote down vote up
private static boolean isElementFormQualified(XmlSchema schema, String uri) {
    if (uri.equals(schema.getTargetNamespace())) {
        return schema.getElementFormDefault() == XmlSchemaForm.QUALIFIED;
    }
    for (XmlSchemaExternal extSchema : schema.getExternals()) {
        return isElementFormQualified(extSchema.getSchema(), uri);
    }
    return false;
}
 
Example 8
Source File: CorbaUtils.java    From cxf with Apache License 2.0 5 votes vote down vote up
private static boolean isAttributeFormQualified(XmlSchema schema, String uri) {
    if (uri.equals(schema.getTargetNamespace())) {
        return schema.getAttributeFormDefault() == XmlSchemaForm.QUALIFIED;
    }
    for (XmlSchemaExternal extSchema : schema.getExternals()) {
        return isAttributeFormQualified(extSchema.getSchema(), uri);
    }
    return false;
}