com.sun.tools.internal.xjc.model.CElement Java Examples

The following examples show how to use com.sun.tools.internal.xjc.model.CElement. 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: RawTypeSetBuilder.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
public void elementDecl(XSElementDecl decl) {

        QName n = BGMBuilder.getName(decl);
        if(elementNames.add(n)) {
            CElement elementBean = Ring.get(ClassSelector.class).bindToType(decl,null);
            if(elementBean==null)
                refs.add(new XmlTypeRef(decl));
            else {
                // yikes!
                if(elementBean instanceof CClass)
                    refs.add(new CClassRef(decl,(CClass)elementBean));
                else
                    refs.add(new CElementInfoRef(decl,(CElementInfo)elementBean));
            }
        }
    }
 
Example #2
Source File: RawTypeSetBuilder.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
public void elementDecl(XSElementDecl decl) {

        QName n = BGMBuilder.getName(decl);
        if(elementNames.add(n)) {
            CElement elementBean = Ring.get(ClassSelector.class).bindToType(decl,null);
            if(elementBean==null)
                refs.add(new XmlTypeRef(decl));
            else {
                // yikes!
                if(elementBean instanceof CClass)
                    refs.add(new CClassRef(decl,(CClass)elementBean));
                else
                    refs.add(new CElementInfoRef(decl,(CElementInfo)elementBean));
            }
        }
    }
 
Example #3
Source File: RawTypeSetBuilder.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
public void elementDecl(XSElementDecl decl) {

        QName n = BGMBuilder.getName(decl);
        if(elementNames.add(n)) {
            CElement elementBean = Ring.get(ClassSelector.class).bindToType(decl,null);
            if(elementBean==null)
                refs.add(new XmlTypeRef(decl));
            else {
                // yikes!
                if(elementBean instanceof CClass)
                    refs.add(new CClassRef(decl,(CClass)elementBean));
                else
                    refs.add(new CElementInfoRef(decl,(CElementInfo)elementBean));
            }
        }
    }
 
Example #4
Source File: RawTypeSetBuilder.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public void elementDecl(XSElementDecl decl) {

        QName n = BGMBuilder.getName(decl);
        if(elementNames.add(n)) {
            CElement elementBean = Ring.get(ClassSelector.class).bindToType(decl,null);
            if(elementBean==null)
                refs.add(new XmlTypeRef(decl));
            else {
                // yikes!
                if(elementBean instanceof CClass)
                    refs.add(new CClassRef(decl,(CClass)elementBean));
                else
                    refs.add(new CElementInfoRef(decl,(CElementInfo)elementBean));
            }
        }
    }
 
Example #5
Source File: NoExtendedContentField.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected JType getType(final Aspect aspect) {
    if (Aspect.IMPLEMENTATION.equals(aspect)) {
        return super.getType(aspect);
    }

    if (prop instanceof CReferencePropertyInfo) {
        Set<CElement> elements = ((CReferencePropertyInfo)prop).getElements();
        if ((elements != null) && (elements.size() > 0)) {
            return codeModel.ref(Serializable.class);
        }
    }

    return codeModel.ref(String.class);
}
 
Example #6
Source File: DefaultClassBinder.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public CElement simpleType(XSSimpleType type) {
    CElement c = allow(type,type.getName());
    if(c!=null) return c;

    if(getGlobalBinding().isSimpleTypeSubstitution() && type.isGlobal()) {
        return new CClassInfo(model,selector.getClassScope(),
                deriveName(type), type.getLocator(), getName(type), null, type, null );
    }

    return never();
}
 
Example #7
Source File: NoExtendedContentField.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected JType getType(final Aspect aspect) {
    if (Aspect.IMPLEMENTATION.equals(aspect)) {
        return super.getType(aspect);
    }

    if (prop instanceof CReferencePropertyInfo) {
        Set<CElement> elements = ((CReferencePropertyInfo)prop).getElements();
        if ((elements != null) && (elements.size() > 0)) {
            return codeModel.ref(Serializable.class);
        }
    }

    return codeModel.ref(String.class);
}
 
Example #8
Source File: ClassSelector.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Checks if the given component is bound to a class.
 */
public final CElement isBound( XSElementDecl x, XSComponent referer ) {
    CElementInfo r = boundElements.get(x);
    if(r!=null)
        return r;
    return bindToType(x,referer);
}
 
Example #9
Source File: ClassSelector.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Checks if the given component is bound to a class.
 */
public final CElement isBound( XSElementDecl x, XSComponent referer ) {
    CElementInfo r = boundElements.get(x);
    if(r!=null)
        return r;
    return bindToType(x,referer);
}
 
Example #10
Source File: NoExtendedContentField.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected JType getType(final Aspect aspect) {
    if (Aspect.IMPLEMENTATION.equals(aspect)) {
        return super.getType(aspect);
    }

    if (prop instanceof CReferencePropertyInfo) {
        Set<CElement> elements = ((CReferencePropertyInfo)prop).getElements();
        if ((elements != null) && (elements.size() > 0)) {
            return codeModel.ref(Serializable.class);
        }
    }

    return codeModel.ref(String.class);
}
 
Example #11
Source File: DefaultClassBinder.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public CElement simpleType(XSSimpleType type) {
    CElement c = allow(type,type.getName());
    if(c!=null) return c;

    if(getGlobalBinding().isSimpleTypeSubstitution() && type.isGlobal()) {
        return new CClassInfo(model,selector.getClassScope(),
                deriveName(type), type.getLocator(), getName(type), null, type, null );
    }

    return never();
}
 
Example #12
Source File: DefaultClassBinder.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public CElement simpleType(XSSimpleType type) {
    CElement c = allow(type,type.getName());
    if(c!=null) return c;

    if(getGlobalBinding().isSimpleTypeSubstitution() && type.isGlobal()) {
        return new CClassInfo(model,selector.getClassScope(),
                deriveName(type), type.getLocator(), getName(type), null, type, null );
    }

    return never();
}
 
Example #13
Source File: NoExtendedContentField.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected JType getType(final Aspect aspect) {
    if (Aspect.IMPLEMENTATION.equals(aspect)) {
        return super.getType(aspect);
    }

    if (prop instanceof CReferencePropertyInfo) {
        Set<CElement> elements = ((CReferencePropertyInfo)prop).getElements();
        if ((elements != null) && (elements.size() > 0)) {
            return codeModel.ref(Serializable.class);
        }
    }

    return codeModel.ref(String.class);
}
 
Example #14
Source File: ClassSelector.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public void queueBuild( XSComponent sc, CElement bean ) {
    // it is an error if the same component is built twice,
    // or the association is modified.
    Binding b = new Binding(sc,bean);
    bindQueue.push(b);
    Binding old = bindMap.put(sc, b);
    assert old==null || old.bean==bean;
}
 
Example #15
Source File: DefaultClassBinder.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public CElement simpleType(XSSimpleType type) {
    CElement c = allow(type,type.getName());
    if(c!=null) return c;

    if(getGlobalBinding().isSimpleTypeSubstitution() && type.isGlobal()) {
        return new CClassInfo(model,selector.getClassScope(),
                deriveName(type), type.getLocator(), getName(type), null, type, null );
    }

    return never();
}
 
Example #16
Source File: ClassBinderFilter.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public CElement wildcard(XSWildcard xsWildcard) {
    return core.wildcard(xsWildcard);
}
 
Example #17
Source File: ClassBinderFilter.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public CElement elementDecl(XSElementDecl xsElementDecl) {
    return core.elementDecl(xsElementDecl);
}
 
Example #18
Source File: ClassBinderFilter.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public CElement modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
    return core.modelGroupDecl(xsModelGroupDecl);
}
 
Example #19
Source File: DefaultClassBinder.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public CElement attributeDecl(XSAttributeDecl decl) {
    return allow(decl,decl.getName());
}
 
Example #20
Source File: ClassBinderFilter.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public CElement modelGroupDecl(XSModelGroupDecl xsModelGroupDecl) {
    return core.modelGroupDecl(xsModelGroupDecl);
}
 
Example #21
Source File: ClassBinderFilter.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public CElement wildcard(XSWildcard xsWildcard) {
    return core.wildcard(xsWildcard);
}
 
Example #22
Source File: ClassBinderFilter.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public CElement wildcard(XSWildcard xsWildcard) {
    return core.wildcard(xsWildcard);
}
 
Example #23
Source File: ClassBinderFilter.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public CElement identityConstraint(XSIdentityConstraint xsIdentityConstraint) {
    return core.identityConstraint(xsIdentityConstraint);
}
 
Example #24
Source File: ClassBinderFilter.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public CElement particle(XSParticle xsParticle) {
    return core.particle(xsParticle);
}
 
Example #25
Source File: Abstractifier.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public CElement complexType(XSComplexType xs) {
    CElement ci = super.complexType(xs);
    if(ci!=null && xs.isAbstract())
        ci.setAbstract();
    return ci;
}
 
Example #26
Source File: Abstractifier.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public CElement elementDecl(XSElementDecl xs) {
    CElement ci = super.elementDecl(xs);
    if(ci!=null && xs.isAbstract())
        ci.setAbstract();
    return ci;
}
 
Example #27
Source File: Abstractifier.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public CElement complexType(XSComplexType xs) {
    CElement ci = super.complexType(xs);
    if(ci!=null && xs.isAbstract())
        ci.setAbstract();
    return ci;
}
 
Example #28
Source File: DefaultClassBinder.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public CElement attGroupDecl(XSAttGroupDecl decl) {
    return allow(decl,decl.getName());
}
 
Example #29
Source File: ClassBinderFilter.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public CElement attributeUse(XSAttributeUse xsAttributeUse) {
    return core.attributeUse(xsAttributeUse);
}
 
Example #30
Source File: ClassBinderFilter.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public CElement attGroupDecl(XSAttGroupDecl xsAttGroupDecl) {
    return core.attGroupDecl(xsAttGroupDecl);
}