Search in sources :

Example 1 with BIXPluginCustomization

use of com.sun.tools.xjc.reader.xmlschema.bindinfo.BIXPluginCustomization in project midpoint by Evolveum.

the class SchemaProcessor method getFieldReferenceUseAnnotationQName.

// e.g. c:link (as opposed to c:linkRef)
private QName getFieldReferenceUseAnnotationQName(JFieldVar field, ClassOutline classOutline) {
    BIDeclaration declaration = hasAnnotation(classOutline, field, A_OBJECT_REFERENCE);
    if (!(declaration instanceof BIXPluginCustomization)) {
        return null;
    }
    BIXPluginCustomization customization = (BIXPluginCustomization) declaration;
    if (customization.element == null) {
        return null;
    }
    Element element = customization.element;
    String strQName = element.getTextContent();
    String[] array = strQName.split(":");
    if (array.length == 2) {
        return new QName(PrefixMapper.C.getNamespace(), array[1]);
    } else if (array.length == 1) {
        return new QName(PrefixMapper.C.getNamespace(), array[0]);
    }
    return null;
}
Also used : BIDeclaration(com.sun.tools.xjc.reader.xmlschema.bindinfo.BIDeclaration) QName(javax.xml.namespace.QName) Element(org.w3c.dom.Element) BIXPluginCustomization(com.sun.tools.xjc.reader.xmlschema.bindinfo.BIXPluginCustomization)

Aggregations

BIDeclaration (com.sun.tools.xjc.reader.xmlschema.bindinfo.BIDeclaration)1 BIXPluginCustomization (com.sun.tools.xjc.reader.xmlschema.bindinfo.BIXPluginCustomization)1 QName (javax.xml.namespace.QName)1 Element (org.w3c.dom.Element)1