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

The following examples show how to use com.sun.xml.internal.bind.v2.schemagen.xmlschema.LocalElement. 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 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 #3
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 #4
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 #5
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 #6
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 #7
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 #8
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 #9
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 #10
Source File: XmlSchemaGenerator.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * writes the schema definition for the given array class
 */
private void writeArray(ArrayInfo<T, C> a, Schema schema) {
    ComplexType ct = schema.complexType().name(a.getTypeName().getLocalPart());
    ct._final("#all");
    LocalElement le = ct.sequence().element().name("item");
    le.type(a.getItemType().getTypeName());
    le.minOccurs(0).maxOccurs("unbounded");
    le.nillable(true);
    ct.commit();
}
 
Example #11
Source File: XmlSchemaGenerator.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * writes the schema definition for the given array class
 */
private void writeArray(ArrayInfo<T, C> a, Schema schema) {
    ComplexType ct = schema.complexType().name(a.getTypeName().getLocalPart());
    ct._final("#all");
    LocalElement le = ct.sequence().element().name("item");
    le.type(a.getItemType().getTypeName());
    le.minOccurs(0).maxOccurs("unbounded");
    le.nillable(true);
    ct.commit();
}
 
Example #12
Source File: XmlSchemaGenerator.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * writes the schema definition for the given array class
 */
private void writeArray(ArrayInfo<T, C> a, Schema schema) {
    ComplexType ct = schema.complexType().name(a.getTypeName().getLocalPart());
    ct._final("#all");
    LocalElement le = ct.sequence().element().name("item");
    le.type(a.getItemType().getTypeName());
    le.minOccurs(0).maxOccurs("unbounded");
    le.nillable(true);
    ct.commit();
}
 
Example #13
Source File: XmlSchemaGenerator.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * writes the schema definition for the given array class
 */
private void writeArray(ArrayInfo<T, C> a, Schema schema) {
    ComplexType ct = schema.complexType().name(a.getTypeName().getLocalPart());
    ct._final("#all");
    LocalElement le = ct.sequence().element().name("item");
    le.type(a.getItemType().getTypeName());
    le.minOccurs(0).maxOccurs("unbounded");
    le.nillable(true);
    ct.commit();
}
 
Example #14
Source File: XmlSchemaGenerator.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * writes the schema definition for the given array class
 */
private void writeArray(ArrayInfo<T, C> a, Schema schema) {
    ComplexType ct = schema.complexType().name(a.getTypeName().getLocalPart());
    ct._final("#all");
    LocalElement le = ct.sequence().element().name("item");
    le.type(a.getItemType().getTypeName());
    le.minOccurs(0).maxOccurs("unbounded");
    le.nillable(true);
    ct.commit();
}
 
Example #15
Source File: XmlSchemaGenerator.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * writes the schema definition for the given array class
 */
private void writeArray(ArrayInfo<T, C> a, Schema schema) {
    ComplexType ct = schema.complexType().name(a.getTypeName().getLocalPart());
    ct._final("#all");
    LocalElement le = ct.sequence().element().name("item");
    le.type(a.getItemType().getTypeName());
    le.minOccurs(0).maxOccurs("unbounded");
    le.nillable(true);
    ct.commit();
}
 
Example #16
Source File: XmlSchemaGenerator.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * writes the schema definition for the given array class
 */
private void writeArray(ArrayInfo<T, C> a, Schema schema) {
    ComplexType ct = schema.complexType().name(a.getTypeName().getLocalPart());
    ct._final("#all");
    LocalElement le = ct.sequence().element().name("item");
    le.type(a.getItemType().getTypeName());
    le.minOccurs(0).maxOccurs("unbounded");
    le.nillable(true);
    ct.commit();
}
 
Example #17
Source File: XmlSchemaGenerator.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * writes the schema definition for the given array class
 */
private void writeArray(ArrayInfo<T, C> a, Schema schema) {
    ComplexType ct = schema.complexType().name(a.getTypeName().getLocalPart());
    ct._final("#all");
    LocalElement le = ct.sequence().element().name("item");
    le.type(a.getItemType().getTypeName());
    le.minOccurs(0).maxOccurs("unbounded");
    le.nillable(true);
    ct.commit();
}
 
Example #18
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 #19
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 #20
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");
}
 
Example #21
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 #22
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 #23
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 #24
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 #25
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");
}