Java源码示例:com.sun.xml.internal.bind.v2.schemagen.xmlschema.LocalElement

示例1
/**
 * 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());
        }
    };
}
 
示例2
/**
 * 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());
        }
    };
}
 
示例3
/**
 * 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());
        }
    };
}
 
示例4
/**
 * 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());
        }
    };
}
 
示例5
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;
}
 
示例6
/**
 * 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());
        }
    };
}
 
示例7
/**
 * 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());
        }
    };
}
 
示例8
/**
 * 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());
        }
    };
}
 
示例9
/**
 * 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());
        }
    };
}
 
示例10
/**
 * 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();
}
 
示例11
/**
 * 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();
}
 
示例12
/**
 * 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();
}
 
示例13
/**
 * 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();
}
 
示例14
/**
 * 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();
}
 
示例15
/**
 * 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();
}
 
示例16
/**
 * 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();
}
 
示例17
/**
 * 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();
}
 
示例18
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}
 
示例19
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}
 
示例20
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}
 
示例21
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}
 
示例22
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}
 
示例23
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}
 
示例24
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}
 
示例25
private void writeKeyOrValue(ExplicitGroup seq, String tagName, NonElement<T, C> typeRef) {
    LocalElement key = seq.element().name(tagName);
    key.minOccurs(0);
    writeTypeRef(key, typeRef, "type");
}