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

The following examples show how to use com.sun.xml.internal.bind.v2.schemagen.xmlschema.ContentModelContainer. 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-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 #3
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 #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 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 #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: 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 #8
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 #9
Source File: Tree.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes inside the given complex type.
 */
protected void write(TypeDefParticle ct) {
    if(canBeTopLevel())
        write(ct._cast(ContentModelContainer.class), false, false);
    else
        // need a dummy wrapper
        new Group(GroupKind.SEQUENCE,this).write(ct);
}
 
Example #10
Source File: Tree.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
    Particle c = kind.write(parent);
    writeOccurs(c,isOptional,repeated);

    for (Tree child : children) {
        child.write(c,false,false);
    }
}
 
Example #11
Source File: Tree.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes inside the given complex type.
 */
protected void write(TypeDefParticle ct) {
    if(canBeTopLevel())
        write(ct._cast(ContentModelContainer.class), false, false);
    else
        // need a dummy wrapper
        new Group(GroupKind.SEQUENCE,this).write(ct);
}
 
Example #12
Source File: Tree.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
    Particle c = kind.write(parent);
    writeOccurs(c,isOptional,repeated);

    for (Tree child : children) {
        child.write(c,false,false);
    }
}
 
Example #13
Source File: Tree.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
    Particle c = kind.write(parent);
    writeOccurs(c,isOptional,repeated);

    for (Tree child : children) {
        child.write(c,false,false);
    }
}
 
Example #14
Source File: Tree.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes inside the given complex type.
 */
protected void write(TypeDefParticle ct) {
    if(canBeTopLevel())
        write(ct._cast(ContentModelContainer.class), false, false);
    else
        // need a dummy wrapper
        new Group(GroupKind.SEQUENCE,this).write(ct);
}
 
Example #15
Source File: Tree.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes inside the given complex type.
 */
protected void write(TypeDefParticle ct) {
    if(canBeTopLevel())
        write(ct._cast(ContentModelContainer.class), false, false);
    else
        // need a dummy wrapper
        new Group(GroupKind.SEQUENCE,this).write(ct);
}
 
Example #16
Source File: Tree.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
    Particle c = kind.write(parent);
    writeOccurs(c,isOptional,repeated);

    for (Tree child : children) {
        child.write(c,false,false);
    }
}
 
Example #17
Source File: Tree.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes inside the given complex type.
 */
protected void write(TypeDefParticle ct) {
    if(canBeTopLevel())
        write(ct._cast(ContentModelContainer.class), false, false);
    else
        // need a dummy wrapper
        new Group(GroupKind.SEQUENCE,this).write(ct);
}
 
Example #18
Source File: Tree.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
    Particle c = kind.write(parent);
    writeOccurs(c,isOptional,repeated);

    for (Tree child : children) {
        child.write(c,false,false);
    }
}
 
Example #19
Source File: Tree.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
    Particle c = kind.write(parent);
    writeOccurs(c,isOptional,repeated);

    for (Tree child : children) {
        child.write(c,false,false);
    }
}
 
Example #20
Source File: Tree.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
    Particle c = kind.write(parent);
    writeOccurs(c,isOptional,repeated);

    for (Tree child : children) {
        child.write(c,false,false);
    }
}
 
Example #21
Source File: Tree.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes inside the given complex type.
 */
protected void write(TypeDefParticle ct) {
    if(canBeTopLevel())
        write(ct._cast(ContentModelContainer.class), false, false);
    else
        // need a dummy wrapper
        new Group(GroupKind.SEQUENCE,this).write(ct);
}
 
Example #22
Source File: Tree.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes inside the given complex type.
 */
protected void write(TypeDefParticle ct) {
    if(canBeTopLevel())
        write(ct._cast(ContentModelContainer.class), false, false);
    else
        // need a dummy wrapper
        new Group(GroupKind.SEQUENCE,this).write(ct);
}
 
Example #23
Source File: Tree.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
    Particle c = kind.write(parent);
    writeOccurs(c,isOptional,repeated);

    for (Tree child : children) {
        child.write(c,false,false);
    }
}
 
Example #24
Source File: Tree.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Writes inside the given complex type.
 */
protected void write(TypeDefParticle ct) {
    if(canBeTopLevel())
        write(ct._cast(ContentModelContainer.class), false, false);
    else
        // need a dummy wrapper
        new Group(GroupKind.SEQUENCE,this).write(ct);
}
 
Example #25
Source File: Tree.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
    body.write(parent,isOptional,true);
}
 
Example #26
Source File: Tree.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
    body.write(parent,isOptional,true);
}
 
Example #27
Source File: Tree.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
    body.write(parent,true,repeated);
}
 
Example #28
Source File: Tree.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
    body.write(parent,true,repeated);
}
 
Example #29
Source File: Tree.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
    body.write(parent,isOptional,true);
}
 
Example #30
Source File: Tree.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected void write(ContentModelContainer parent, boolean isOptional, boolean repeated) {
    body.write(parent,true,repeated);
}