Java Code Examples for com.sun.xml.internal.xsom.XSModelGroup#getCompositor()

The following examples show how to use com.sun.xml.internal.xsom.XSModelGroup#getCompositor() . 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: ChoiceContentComplexTypeBuilder.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean isApplicable(XSComplexType ct) {
    if( !bgmBuilder.getGlobalBinding().isChoiceContentPropertyEnabled() )
        return false;

    if( ct.getBaseType()!=schemas.getAnyType() )
        // My reading of the spec is that if a complex type is
        // derived from another complex type by extension,
        // its top level model group is always a sequence
        // that combines the base type content model and
        // the extension defined in the new complex type.
        return false;

    XSParticle p = ct.getContentType().asParticle();
    if(p==null)
        return false;

    XSModelGroup mg = getTopLevelModelGroup(p);

    if( mg.getCompositor()!=XSModelGroup.CHOICE )
        return false;

    if( p.isRepeated() )
        return false;

    return true;
}
 
Example 2
Source File: ChoiceContentComplexTypeBuilder.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
public boolean isApplicable(XSComplexType ct) {
    if( !bgmBuilder.getGlobalBinding().isChoiceContentPropertyEnabled() )
        return false;

    if( ct.getBaseType()!=schemas.getAnyType() )
        // My reading of the spec is that if a complex type is
        // derived from another complex type by extension,
        // its top level model group is always a sequence
        // that combines the base type content model and
        // the extension defined in the new complex type.
        return false;

    XSParticle p = ct.getContentType().asParticle();
    if(p==null)
        return false;

    XSModelGroup mg = getTopLevelModelGroup(p);

    if( mg.getCompositor()!=XSModelGroup.CHOICE )
        return false;

    if( p.isRepeated() )
        return false;

    return true;
}
 
Example 3
Source File: AbstractMappingImpl.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private boolean containingChoice(CClassInfo typeBean) {
    XSComponent component = typeBean.getSchemaComponent();
    if (component instanceof XSComplexType) {
        XSContentType contentType = ((XSComplexType) component).getContentType();
        XSParticle particle = contentType.asParticle();
        if (particle != null) {
            XSTerm term = particle.getTerm();
            XSModelGroup modelGroup = term.asModelGroup();
            if (modelGroup != null) {
                return (modelGroup.getCompositor() == XSModelGroup.Compositor.CHOICE);
            }
        }
    }

    return false;
}
 
Example 4
Source File: AbstractMappingImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private boolean containingChoice(CClassInfo typeBean) {
    XSComponent component = typeBean.getSchemaComponent();
    if (component instanceof XSComplexType) {
        XSContentType contentType = ((XSComplexType) component).getContentType();
        XSParticle particle = contentType.asParticle();
        if (particle != null) {
            XSTerm term = particle.getTerm();
            XSModelGroup modelGroup = term.asModelGroup();
            if (modelGroup != null) {
                return (modelGroup.getCompositor() == XSModelGroup.Compositor.CHOICE);
            }
        }
    }

    return false;
}
 
Example 5
Source File: ChoiceContentComplexTypeBuilder.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public boolean isApplicable(XSComplexType ct) {
    if( !bgmBuilder.getGlobalBinding().isChoiceContentPropertyEnabled() )
        return false;

    if( ct.getBaseType()!=schemas.getAnyType() )
        // My reading of the spec is that if a complex type is
        // derived from another complex type by extension,
        // its top level model group is always a sequence
        // that combines the base type content model and
        // the extension defined in the new complex type.
        return false;

    XSParticle p = ct.getContentType().asParticle();
    if(p==null)
        return false;

    XSModelGroup mg = getTopLevelModelGroup(p);

    if( mg.getCompositor()!=XSModelGroup.CHOICE )
        return false;

    if( p.isRepeated() )
        return false;

    return true;
}
 
Example 6
Source File: AbstractMappingImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private boolean containingChoice(CClassInfo typeBean) {
    XSComponent component = typeBean.getSchemaComponent();
    if (component instanceof XSComplexType) {
        XSContentType contentType = ((XSComplexType) component).getContentType();
        XSParticle particle = contentType.asParticle();
        if (particle != null) {
            XSTerm term = particle.getTerm();
            XSModelGroup modelGroup = term.asModelGroup();
            if (modelGroup != null) {
                return (modelGroup.getCompositor() == XSModelGroup.Compositor.CHOICE);
            }
        }
    }

    return false;
}
 
Example 7
Source File: Axis.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private Iterator<XSModelGroup> filter(XSModelGroup mg) {
    if(mg==null)
        return empty();
    if(mg.getCompositor() == compositor || compositor == null)
        return singleton(mg);
    else
        return empty();
}
 
Example 8
Source File: DefaultParticleBinder.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public void modelGroup( XSModelGroup mg ) {
    boolean oldIOP = insideOptionalParticle;
    insideOptionalParticle |= mg.getCompositor()==XSModelGroup.CHOICE;

    for( XSParticle p : mg.getChildren())
        particle(p);

    insideOptionalParticle = oldIOP;
}
 
Example 9
Source File: Axis.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private Iterator<XSModelGroup> filter(XSModelGroup mg) {
    if(mg==null)
        return empty();
    if(mg.getCompositor() == compositor || compositor == null)
        return singleton(mg);
    else
        return empty();
}
 
Example 10
Source File: DefaultParticleBinder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void modelGroup(XSModelGroup mg) {
    // choice gets mapped to a property
    if(mg.getCompositor()== XSModelGroup.Compositor.CHOICE && builder.getGlobalBinding().isChoiceContentPropertyEnabled()) {
        mark(outerParticle);
        return;
    }

    for( XSParticle child : mg.getChildren() )
        particle(child);
}
 
Example 11
Source File: DefaultParticleBinder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void modelGroup( XSModelGroup mg ) {
    boolean oldIOP = insideOptionalParticle;
    insideOptionalParticle |= mg.getCompositor()==XSModelGroup.CHOICE;

    for( XSParticle p : mg.getChildren())
        particle(p);

    insideOptionalParticle = oldIOP;
}
 
Example 12
Source File: DefaultParticleBinder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public void modelGroup( XSModelGroup mg ) {
    boolean oldIOP = insideOptionalParticle;
    insideOptionalParticle |= mg.getCompositor()==XSModelGroup.CHOICE;

    for( XSParticle p : mg.getChildren())
        particle(p);

    insideOptionalParticle = oldIOP;
}
 
Example 13
Source File: DefaultParticleBinder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public void modelGroup(XSModelGroup mg) {
    // choice gets mapped to a property
    if(mg.getCompositor()== XSModelGroup.Compositor.CHOICE && builder.getGlobalBinding().isChoiceContentPropertyEnabled()) {
        mark(outerParticle);
        return;
    }

    for( XSParticle child : mg.getChildren() )
        particle(child);
}
 
Example 14
Source File: Axis.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
private Iterator<XSModelGroup> filter(XSModelGroup mg) {
    if(mg==null)
        return empty();
    if(mg.getCompositor() == compositor || compositor == null)
        return singleton(mg);
    else
        return empty();
}
 
Example 15
Source File: DefaultParticleBinder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public void modelGroup( XSModelGroup mg ) {
    boolean oldIOP = insideOptionalParticle;
    insideOptionalParticle |= mg.getCompositor()==XSModelGroup.CHOICE;

    for( XSParticle p : mg.getChildren())
        particle(p);

    insideOptionalParticle = oldIOP;
}
 
Example 16
Source File: Axis.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
private Iterator<XSModelGroup> filter(XSModelGroup mg) {
    if(mg==null)
        return empty();
    if(mg.getCompositor() == compositor || compositor == null)
        return singleton(mg);
    else
        return empty();
}
 
Example 17
Source File: Axis.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
private Iterator<XSModelGroup> filter(XSModelGroup mg) {
    if(mg==null)
        return empty();
    if(mg.getCompositor() == compositor || compositor == null)
        return singleton(mg);
    else
        return empty();
}
 
Example 18
Source File: DefaultParticleBinder.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public void modelGroup( XSModelGroup mg ) {
    boolean oldIOP = insideOptionalParticle;
    insideOptionalParticle |= mg.getCompositor()==XSModelGroup.CHOICE;

    for( XSParticle p : mg.getChildren())
        particle(p);

    insideOptionalParticle = oldIOP;
}
 
Example 19
Source File: DefaultParticleBinder.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public void modelGroup( XSModelGroup mg ) {
    boolean oldIOP = insideOptionalParticle;
    insideOptionalParticle |= mg.getCompositor()==XSModelGroup.CHOICE;

    for( XSParticle p : mg.getChildren())
        particle(p);

    insideOptionalParticle = oldIOP;
}
 
Example 20
Source File: DefaultParticleBinder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public void modelGroup( XSModelGroup mg ) {
    boolean oldIOP = insideOptionalParticle;
    insideOptionalParticle |= mg.getCompositor()==XSModelGroup.CHOICE;

    for( XSParticle p : mg.getChildren())
        particle(p);

    insideOptionalParticle = oldIOP;
}