Java Code Examples for javax.xml.bind.annotation.XmlSchema#attributeFormDefault()

The following examples show how to use javax.xml.bind.annotation.XmlSchema#attributeFormDefault() . 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: TypeInfoSetImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public final XmlNsForm getAttributeFormDefault(String nsUri) {
    for (ClassInfoImpl<T,C,F,M> ci : beans().values()) {
        XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
        if(xs==null)
            continue;

        if(!xs.namespace().equals(nsUri))
            continue;

        XmlNsForm xnf = xs.attributeFormDefault();
        if(xnf!=XmlNsForm.UNSET)
            return xnf;
    }
    return XmlNsForm.UNSET;
}
 
Example 2
Source File: TypeInfoSetImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public final XmlNsForm getAttributeFormDefault(String nsUri) {
    for (ClassInfoImpl<T,C,F,M> ci : beans().values()) {
        XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
        if(xs==null)
            continue;

        if(!xs.namespace().equals(nsUri))
            continue;

        XmlNsForm xnf = xs.attributeFormDefault();
        if(xnf!=XmlNsForm.UNSET)
            return xnf;
    }
    return XmlNsForm.UNSET;
}
 
Example 3
Source File: ReferencePropertyInfoImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private String getEffectiveNamespaceFor(XmlElementRef r) {
    String nsUri = r.namespace();

    XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
    if(xs!=null && xs.attributeFormDefault()== XmlNsForm.QUALIFIED) {
        // JAX-RPC doesn't want the default namespace URI swapping to take effect to
        // local "unqualified" elements. UGLY.
        if(nsUri.length()==0)
            nsUri = parent.builder.defaultNsUri;
    }

    return nsUri;
}
 
Example 4
Source File: AttributePropertyInfoImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private QName calcXmlName(XmlAttribute att) {
    String uri;
    String local;

    uri = att.namespace();
    local = att.name();

    // compute the default
    if(local.equals("##default"))
        local = NameConverter.standard.toVariableName(getName());
    if(uri.equals("##default")) {
        XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
        // JAX-RPC doesn't want the default namespace URI swapping to take effect to
        // local "unqualified" elements. UGLY.
        if(xs!=null) {
            switch(xs.attributeFormDefault()) {
            case QUALIFIED:
                uri = parent.getTypeName().getNamespaceURI();
                if(uri.length()==0)
                    uri = parent.builder.defaultNsUri;
                break;
            case UNQUALIFIED:
            case UNSET:
                uri = "";
            }
        } else
            uri = "";
    }

    return new QName(uri.intern(),local.intern());
}
 
Example 5
Source File: TypeInfoSetImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public final XmlNsForm getAttributeFormDefault(String nsUri) {
    for (ClassInfoImpl<T,C,F,M> ci : beans().values()) {
        XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
        if(xs==null)
            continue;

        if(!xs.namespace().equals(nsUri))
            continue;

        XmlNsForm xnf = xs.attributeFormDefault();
        if(xnf!=XmlNsForm.UNSET)
            return xnf;
    }
    return XmlNsForm.UNSET;
}
 
Example 6
Source File: ReferencePropertyInfoImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private String getEffectiveNamespaceFor(XmlElementRef r) {
    String nsUri = r.namespace();

    XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
    if(xs!=null && xs.attributeFormDefault()== XmlNsForm.QUALIFIED) {
        // JAX-RPC doesn't want the default namespace URI swapping to take effect to
        // local "unqualified" elements. UGLY.
        if(nsUri.length()==0)
            nsUri = parent.builder.defaultNsUri;
    }

    return nsUri;
}
 
Example 7
Source File: AttributePropertyInfoImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private QName calcXmlName(XmlAttribute att) {
    String uri;
    String local;

    uri = att.namespace();
    local = att.name();

    // compute the default
    if(local.equals("##default"))
        local = NameConverter.standard.toVariableName(getName());
    if(uri.equals("##default")) {
        XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
        // JAX-RPC doesn't want the default namespace URI swapping to take effect to
        // local "unqualified" elements. UGLY.
        if(xs!=null) {
            switch(xs.attributeFormDefault()) {
            case QUALIFIED:
                uri = parent.getTypeName().getNamespaceURI();
                if(uri.length()==0)
                    uri = parent.builder.defaultNsUri;
                break;
            case UNQUALIFIED:
            case UNSET:
                uri = "";
            }
        } else
            uri = "";
    }

    return new QName(uri.intern(),local.intern());
}
 
Example 8
Source File: TypeInfoSetImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public final XmlNsForm getAttributeFormDefault(String nsUri) {
    for (ClassInfoImpl<T,C,F,M> ci : beans().values()) {
        XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
        if(xs==null)
            continue;

        if(!xs.namespace().equals(nsUri))
            continue;

        XmlNsForm xnf = xs.attributeFormDefault();
        if(xnf!=XmlNsForm.UNSET)
            return xnf;
    }
    return XmlNsForm.UNSET;
}
 
Example 9
Source File: ReferencePropertyInfoImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private String getEffectiveNamespaceFor(XmlElementRef r) {
    String nsUri = r.namespace();

    XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
    if(xs!=null && xs.attributeFormDefault()== XmlNsForm.QUALIFIED) {
        // JAX-RPC doesn't want the default namespace URI swapping to take effect to
        // local "unqualified" elements. UGLY.
        if(nsUri.length()==0)
            nsUri = parent.builder.defaultNsUri;
    }

    return nsUri;
}
 
Example 10
Source File: AttributePropertyInfoImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private QName calcXmlName(XmlAttribute att) {
    String uri;
    String local;

    uri = att.namespace();
    local = att.name();

    // compute the default
    if(local.equals("##default"))
        local = NameConverter.standard.toVariableName(getName());
    if(uri.equals("##default")) {
        XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
        // JAX-RPC doesn't want the default namespace URI swapping to take effect to
        // local "unqualified" elements. UGLY.
        if(xs!=null) {
            switch(xs.attributeFormDefault()) {
            case QUALIFIED:
                uri = parent.getTypeName().getNamespaceURI();
                if(uri.length()==0)
                    uri = parent.builder.defaultNsUri;
                break;
            case UNQUALIFIED:
            case UNSET:
                uri = "";
            }
        } else
            uri = "";
    }

    return new QName(uri.intern(),local.intern());
}
 
Example 11
Source File: ReferencePropertyInfoImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private String getEffectiveNamespaceFor(XmlElementRef r) {
    String nsUri = r.namespace();

    XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
    if(xs!=null && xs.attributeFormDefault()== XmlNsForm.QUALIFIED) {
        // JAX-RPC doesn't want the default namespace URI swapping to take effect to
        // local "unqualified" elements. UGLY.
        if(nsUri.length()==0)
            nsUri = parent.builder.defaultNsUri;
    }

    return nsUri;
}
 
Example 12
Source File: ReferencePropertyInfoImpl.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private String getEffectiveNamespaceFor(XmlElementRef r) {
    String nsUri = r.namespace();

    XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
    if(xs!=null && xs.attributeFormDefault()== XmlNsForm.QUALIFIED) {
        // JAX-RPC doesn't want the default namespace URI swapping to take effect to
        // local "unqualified" elements. UGLY.
        if(nsUri.length()==0)
            nsUri = parent.builder.defaultNsUri;
    }

    return nsUri;
}
 
Example 13
Source File: AttributePropertyInfoImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private QName calcXmlName(XmlAttribute att) {
    String uri;
    String local;

    uri = att.namespace();
    local = att.name();

    // compute the default
    if(local.equals("##default"))
        local = NameConverter.standard.toVariableName(getName());
    if(uri.equals("##default")) {
        XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
        // JAX-RPC doesn't want the default namespace URI swapping to take effect to
        // local "unqualified" elements. UGLY.
        if(xs!=null) {
            switch(xs.attributeFormDefault()) {
            case QUALIFIED:
                uri = parent.getTypeName().getNamespaceURI();
                if(uri.length()==0)
                    uri = parent.builder.defaultNsUri;
                break;
            case UNQUALIFIED:
            case UNSET:
                uri = "";
            }
        } else
            uri = "";
    }

    return new QName(uri.intern(),local.intern());
}
 
Example 14
Source File: AttributePropertyInfoImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private QName calcXmlName(XmlAttribute att) {
    String uri;
    String local;

    uri = att.namespace();
    local = att.name();

    // compute the default
    if(local.equals("##default"))
        local = NameConverter.standard.toVariableName(getName());
    if(uri.equals("##default")) {
        XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
        // JAX-RPC doesn't want the default namespace URI swapping to take effect to
        // local "unqualified" elements. UGLY.
        if(xs!=null) {
            switch(xs.attributeFormDefault()) {
            case QUALIFIED:
                uri = parent.getTypeName().getNamespaceURI();
                if(uri.length()==0)
                    uri = parent.builder.defaultNsUri;
                break;
            case UNQUALIFIED:
            case UNSET:
                uri = "";
            }
        } else
            uri = "";
    }

    return new QName(uri.intern(),local.intern());
}
 
Example 15
Source File: ReferencePropertyInfoImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private String getEffectiveNamespaceFor(XmlElementRef r) {
    String nsUri = r.namespace();

    XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
    if(xs!=null && xs.attributeFormDefault()== XmlNsForm.QUALIFIED) {
        // JAX-RPC doesn't want the default namespace URI swapping to take effect to
        // local "unqualified" elements. UGLY.
        if(nsUri.length()==0)
            nsUri = parent.builder.defaultNsUri;
    }

    return nsUri;
}
 
Example 16
Source File: TypeInfoSetImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public final XmlNsForm getAttributeFormDefault(String nsUri) {
    for (ClassInfoImpl<T,C,F,M> ci : beans().values()) {
        XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
        if(xs==null)
            continue;

        if(!xs.namespace().equals(nsUri))
            continue;

        XmlNsForm xnf = xs.attributeFormDefault();
        if(xnf!=XmlNsForm.UNSET)
            return xnf;
    }
    return XmlNsForm.UNSET;
}
 
Example 17
Source File: TypeInfoSetImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public final XmlNsForm getAttributeFormDefault(String nsUri) {
    for (ClassInfoImpl<T,C,F,M> ci : beans().values()) {
        XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
        if(xs==null)
            continue;

        if(!xs.namespace().equals(nsUri))
            continue;

        XmlNsForm xnf = xs.attributeFormDefault();
        if(xnf!=XmlNsForm.UNSET)
            return xnf;
    }
    return XmlNsForm.UNSET;
}
 
Example 18
Source File: ReferencePropertyInfoImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private String getEffectiveNamespaceFor(XmlElementRef r) {
    String nsUri = r.namespace();

    XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
    if(xs!=null && xs.attributeFormDefault()== XmlNsForm.QUALIFIED) {
        // JAX-RPC doesn't want the default namespace URI swapping to take effect to
        // local "unqualified" elements. UGLY.
        if(nsUri.length()==0)
            nsUri = parent.builder.defaultNsUri;
    }

    return nsUri;
}
 
Example 19
Source File: AttributePropertyInfoImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private QName calcXmlName(XmlAttribute att) {
    String uri;
    String local;

    uri = att.namespace();
    local = att.name();

    // compute the default
    if(local.equals("##default"))
        local = NameConverter.standard.toVariableName(getName());
    if(uri.equals("##default")) {
        XmlSchema xs = reader().getPackageAnnotation( XmlSchema.class, parent.getClazz(), this );
        // JAX-RPC doesn't want the default namespace URI swapping to take effect to
        // local "unqualified" elements. UGLY.
        if(xs!=null) {
            switch(xs.attributeFormDefault()) {
            case QUALIFIED:
                uri = parent.getTypeName().getNamespaceURI();
                if(uri.length()==0)
                    uri = parent.builder.defaultNsUri;
                break;
            case UNQUALIFIED:
            case UNSET:
                uri = "";
            }
        } else
            uri = "";
    }

    return new QName(uri.intern(),local.intern());
}
 
Example 20
Source File: TypeInfoSetImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public final XmlNsForm getAttributeFormDefault(String nsUri) {
    for (ClassInfoImpl<T,C,F,M> ci : beans().values()) {
        XmlSchema xs = reader.getPackageAnnotation( XmlSchema.class, ci.getClazz(), null );
        if(xs==null)
            continue;

        if(!xs.namespace().equals(nsUri))
            continue;

        XmlNsForm xnf = xs.attributeFormDefault();
        if(xnf!=XmlNsForm.UNSET)
            return xnf;
    }
    return XmlNsForm.UNSET;
}