com.sun.xml.internal.bind.v2.schemagen.xmlschema.ExplicitGroup Java Examples

The following examples show how to use com.sun.xml.internal.bind.v2.schemagen.xmlschema.ExplicitGroup. 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: XmlSchemaGenerator.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the proper schema fragment for the given map property into the
 * specified schema compositor.
 *
 * @param mp the map property
 */
private Tree handleMapProp(final MapPropertyInfo<T,C> mp) {
    return new Tree.Term() {
        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
            QName ename = mp.getXmlName();

            LocalElement e = parent.element();
            elementFormDefault.writeForm(e,ename);
            if(mp.isCollectionNillable())
                e.nillable(true);

            e = e.name(ename.getLocalPart());
            writeOccurs(e,isOptional,repeated);
            ComplexType p = e.complexType();

            // TODO: entry, key, and value are always unqualified. that needs to be fixed, too.
            // TODO: we need to generate the corresponding element declaration, if they are qualified
            e = p.sequence().element();
            e.name("entry").minOccurs(0).maxOccurs("unbounded");

            ExplicitGroup seq = e.complexType().sequence();
            writeKeyOrValue(seq, "key", mp.getKeyType());
            writeKeyOrValue(seq, "value", mp.getValueType());
        }
    };
}
 
Example #2
Source File: XmlSchemaGenerator.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the proper schema fragment for the given map property into the
 * specified schema compositor.
 *
 * @param mp the map property
 */
private Tree handleMapProp(final MapPropertyInfo<T,C> mp) {
    return new Tree.Term() {
        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
            QName ename = mp.getXmlName();

            LocalElement e = parent.element();
            elementFormDefault.writeForm(e,ename);
            if(mp.isCollectionNillable())
                e.nillable(true);

            e = e.name(ename.getLocalPart());
            writeOccurs(e,isOptional,repeated);
            ComplexType p = e.complexType();

            // TODO: entry, key, and value are always unqualified. that needs to be fixed, too.
            // TODO: we need to generate the corresponding element declaration, if they are qualified
            e = p.sequence().element();
            e.name("entry").minOccurs(0).maxOccurs("unbounded");

            ExplicitGroup seq = e.complexType().sequence();
            writeKeyOrValue(seq, "key", mp.getKeyType());
            writeKeyOrValue(seq, "value", mp.getValueType());
        }
    };
}
 
Example #3
Source File: XmlSchemaGenerator.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the proper schema fragment for the given map property into the
 * specified schema compositor.
 *
 * @param mp the map property
 */
private Tree handleMapProp(final MapPropertyInfo<T,C> mp) {
    return new Tree.Term() {
        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
            QName ename = mp.getXmlName();

            LocalElement e = parent.element();
            elementFormDefault.writeForm(e,ename);
            if(mp.isCollectionNillable())
                e.nillable(true);

            e = e.name(ename.getLocalPart());
            writeOccurs(e,isOptional,repeated);
            ComplexType p = e.complexType();

            // TODO: entry, key, and value are always unqualified. that needs to be fixed, too.
            // TODO: we need to generate the corresponding element declaration, if they are qualified
            e = p.sequence().element();
            e.name("entry").minOccurs(0).maxOccurs("unbounded");

            ExplicitGroup seq = e.complexType().sequence();
            writeKeyOrValue(seq, "key", mp.getKeyType());
            writeKeyOrValue(seq, "value", mp.getValueType());
        }
    };
}
 
Example #4
Source File: XmlSchemaGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the proper schema fragment for the given map property into the
 * specified schema compositor.
 *
 * @param mp the map property
 */
private Tree handleMapProp(final MapPropertyInfo<T,C> mp) {
    return new Tree.Term() {
        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
            QName ename = mp.getXmlName();

            LocalElement e = parent.element();
            elementFormDefault.writeForm(e,ename);
            if(mp.isCollectionNillable())
                e.nillable(true);

            e = e.name(ename.getLocalPart());
            writeOccurs(e,isOptional,repeated);
            ComplexType p = e.complexType();

            // TODO: entry, key, and value are always unqualified. that needs to be fixed, too.
            // TODO: we need to generate the corresponding element declaration, if they are qualified
            e = p.sequence().element();
            e.name("entry").minOccurs(0).maxOccurs("unbounded");

            ExplicitGroup seq = e.complexType().sequence();
            writeKeyOrValue(seq, "key", mp.getKeyType());
            writeKeyOrValue(seq, "value", mp.getValueType());
        }
    };
}
 
Example #5
Source File: XmlSchemaGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the proper schema fragment for the given map property into the
 * specified schema compositor.
 *
 * @param mp the map property
 */
private Tree handleMapProp(final MapPropertyInfo<T,C> mp) {
    return new Tree.Term() {
        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
            QName ename = mp.getXmlName();

            LocalElement e = parent.element();
            elementFormDefault.writeForm(e,ename);
            if(mp.isCollectionNillable())
                e.nillable(true);

            e = e.name(ename.getLocalPart());
            writeOccurs(e,isOptional,repeated);
            ComplexType p = e.complexType();

            // TODO: entry, key, and value are always unqualified. that needs to be fixed, too.
            // TODO: we need to generate the corresponding element declaration, if they are qualified
            e = p.sequence().element();
            e.name("entry").minOccurs(0).maxOccurs("unbounded");

            ExplicitGroup seq = e.complexType().sequence();
            writeKeyOrValue(seq, "key", mp.getKeyType());
            writeKeyOrValue(seq, "value", mp.getValueType());
        }
    };
}
 
Example #6
Source File: XmlSchemaGenerator.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the proper schema fragment for the given map property into the
 * specified schema compositor.
 *
 * @param mp the map property
 */
private Tree handleMapProp(final MapPropertyInfo<T,C> mp) {
    return new Tree.Term() {
        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
            QName ename = mp.getXmlName();

            LocalElement e = parent.element();
            elementFormDefault.writeForm(e,ename);
            if(mp.isCollectionNillable())
                e.nillable(true);

            e = e.name(ename.getLocalPart());
            writeOccurs(e,isOptional,repeated);
            ComplexType p = e.complexType();

            // TODO: entry, key, and value are always unqualified. that needs to be fixed, too.
            // TODO: we need to generate the corresponding element declaration, if they are qualified
            e = p.sequence().element();
            e.name("entry").minOccurs(0).maxOccurs("unbounded");

            ExplicitGroup seq = e.complexType().sequence();
            writeKeyOrValue(seq, "key", mp.getKeyType());
            writeKeyOrValue(seq, "value", mp.getValueType());
        }
    };
}
 
Example #7
Source File: ServiceArtifactSchemaGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
protected Occurs addChild(ExplicitGroup sq, QName name, TypeInfo typeInfo) {
    LocalElement le = null;;
    QName type = model.getBindingContext().getTypeName(typeInfo);
    if (type != null) {
        le = sq.element();
        le._attribute("name", name.getLocalPart());
        le.type(type);
    } else {
        if (typeInfo.type instanceof Class) {
            try {
                QName elemName = model.getBindingContext().getElementName((Class)typeInfo.type);
                if (elemName.getLocalPart().equals("any") && elemName.getNamespaceURI().equals(XsdNs)) {
                    return sq.any();
                } else {
                    le = sq.element();
                    le.ref(elemName);
                }
            } catch (JAXBException je) {
                throw new WebServiceException(je.getMessage(), je);
            }
        }
    }
    return le;
}
 
Example #8
Source File: XmlSchemaGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the proper schema fragment for the given map property into the
 * specified schema compositor.
 *
 * @param mp the map property
 */
private Tree handleMapProp(final MapPropertyInfo<T,C> mp) {
    return new Tree.Term() {
        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
            QName ename = mp.getXmlName();

            LocalElement e = parent.element();
            elementFormDefault.writeForm(e,ename);
            if(mp.isCollectionNillable())
                e.nillable(true);

            e = e.name(ename.getLocalPart());
            writeOccurs(e,isOptional,repeated);
            ComplexType p = e.complexType();

            // TODO: entry, key, and value are always unqualified. that needs to be fixed, too.
            // TODO: we need to generate the corresponding element declaration, if they are qualified
            e = p.sequence().element();
            e.name("entry").minOccurs(0).maxOccurs("unbounded");

            ExplicitGroup seq = e.complexType().sequence();
            writeKeyOrValue(seq, "key", mp.getKeyType());
            writeKeyOrValue(seq, "value", mp.getValueType());
        }
    };
}
 
Example #9
Source File: XmlSchemaGenerator.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Generate the proper schema fragment for the given map property into the
 * specified schema compositor.
 *
 * @param mp the map property
 */
private Tree handleMapProp(final MapPropertyInfo<T,C> mp) {
    return new Tree.Term() {
        protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
            QName ename = mp.getXmlName();

            LocalElement e = parent.element();
            elementFormDefault.writeForm(e,ename);
            if(mp.isCollectionNillable())
                e.nillable(true);

            e = e.name(ename.getLocalPart());
            writeOccurs(e,isOptional,repeated);
            ComplexType p = e.complexType();

            // TODO: entry, key, and value are always unqualified. that needs to be fixed, too.
            // TODO: we need to generate the corresponding element declaration, if they are qualified
            e = p.sequence().element();
            e.name("entry").minOccurs(0).maxOccurs("unbounded");

            ExplicitGroup seq = e.complexType().sequence();
            writeKeyOrValue(seq, "key", mp.getKeyType());
            writeKeyOrValue(seq, "value", mp.getValueType());
        }
    };
}
 
Example #10
Source File: ServiceArtifactSchemaGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
protected void addChild(ExplicitGroup sq, ParameterImpl param) {
    TypeInfo typeInfo = param.getItemType();
    boolean repeatedElement = false;
    if (typeInfo == null) {
        typeInfo = param.getTypeInfo();
    } else {
        if (typeInfo.getWrapperType() != null) typeInfo = param.getTypeInfo();
        else repeatedElement = true;
    }
    Occurs child = addChild(sq, param.getName(), typeInfo);
    if (repeatedElement && child != null) {
        child.maxOccurs("unbounded");
    }
}
 
Example #11
Source File: XmlSchemaGenerator.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}
 
Example #12
Source File: XmlSchemaGenerator.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}
 
Example #13
Source File: XmlSchemaGenerator.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}
 
Example #14
Source File: XmlSchemaGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}
 
Example #15
Source File: XmlSchemaGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}
 
Example #16
Source File: XmlSchemaGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}
 
Example #17
Source File: XmlSchemaGenerator.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}
 
Example #18
Source File: XmlSchemaGenerator.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}