Java Code Examples for com.sun.tools.internal.xjc.model.CElementInfo#initContentType()

The following examples show how to use com.sun.tools.internal.xjc.model.CElementInfo#initContentType() . 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: DefaultClassBinder.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
public CElement elementDecl(XSElementDecl decl) {
    CElement r = allow(decl,decl.getName());

    if(r==null) {
        QName tagName = getName(decl);
        CCustomizations custs = builder.getBindInfo(decl).toCustomizationList();

        if(decl.isGlobal()) {
            if(isCollapsable(decl)) {
                // we want the returned type to be built as a complex type,
                // so the binding cannot be delayed.
                return selector.bindToType(decl.getType().asComplexType(),decl,true);
            } else {
                String className = null;
                if(getGlobalBinding().isGenerateElementClass())
                    className = deriveName(decl);

                // otherwise map global elements to JAXBElement
                CElementInfo cei = new CElementInfo(
                    model, tagName, selector.getClassScope(), className, custs, decl.getLocator());
                selector.boundElements.put(decl,cei);

                stb.refererStack.push(decl);    // referer is element
                cei.initContentType( selector.bindToType(decl.getType(),decl), decl, decl.getDefaultValue() );
                stb.refererStack.pop();
                r = cei;
            }
        }
    }

    // have the substitution member derive from the substitution head
    XSElementDecl top = decl.getSubstAffiliation();
    if(top!=null) {
        CElement topci = selector.bindToType(top,decl);

        if(r instanceof CClassInfo && topci instanceof CClassInfo)
            ((CClassInfo)r).setBaseClass((CClassInfo)topci);
        if (r instanceof CElementInfo && topci instanceof CElementInfo)
            ((CElementInfo)r).setSubstitutionHead((CElementInfo)topci);
    }

    return r;
}
 
Example 2
Source File: DefaultClassBinder.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public CElement elementDecl(XSElementDecl decl) {
    CElement r = allow(decl,decl.getName());

    if(r==null) {
        QName tagName = getName(decl);
        CCustomizations custs = builder.getBindInfo(decl).toCustomizationList();

        if(decl.isGlobal()) {
            if(isCollapsable(decl)) {
                // we want the returned type to be built as a complex type,
                // so the binding cannot be delayed.
                return selector.bindToType(decl.getType().asComplexType(),decl,true);
            } else {
                String className = null;
                if(getGlobalBinding().isGenerateElementClass())
                    className = deriveName(decl);

                // otherwise map global elements to JAXBElement
                CElementInfo cei = new CElementInfo(
                    model, tagName, selector.getClassScope(), className, custs, decl.getLocator());
                selector.boundElements.put(decl,cei);

                stb.refererStack.push(decl);    // referer is element
                cei.initContentType( selector.bindToType(decl.getType(),decl), decl, decl.getDefaultValue() );
                stb.refererStack.pop();
                r = cei;
            }
        }
    }

    // have the substitution member derive from the substitution head
    XSElementDecl top = decl.getSubstAffiliation();
    if(top!=null) {
        CElement topci = selector.bindToType(top,decl);

        if(r instanceof CClassInfo && topci instanceof CClassInfo)
            ((CClassInfo)r).setBaseClass((CClassInfo)topci);
        if (r instanceof CElementInfo && topci instanceof CElementInfo)
            ((CElementInfo)r).setSubstitutionHead((CElementInfo)topci);
    }

    return r;
}
 
Example 3
Source File: DefaultClassBinder.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public CElement elementDecl(XSElementDecl decl) {
    CElement r = allow(decl,decl.getName());

    if(r==null) {
        QName tagName = getName(decl);
        CCustomizations custs = builder.getBindInfo(decl).toCustomizationList();

        if(decl.isGlobal()) {
            if(isCollapsable(decl)) {
                // we want the returned type to be built as a complex type,
                // so the binding cannot be delayed.
                return selector.bindToType(decl.getType().asComplexType(),decl,true);
            } else {
                String className = null;
                if(getGlobalBinding().isGenerateElementClass())
                    className = deriveName(decl);

                // otherwise map global elements to JAXBElement
                CElementInfo cei = new CElementInfo(
                    model, tagName, selector.getClassScope(), className, custs, decl.getLocator());
                selector.boundElements.put(decl,cei);

                stb.refererStack.push(decl);    // referer is element
                cei.initContentType( selector.bindToType(decl.getType(),decl), decl, decl.getDefaultValue() );
                stb.refererStack.pop();
                r = cei;
            }
        }
    }

    // have the substitution member derive from the substitution head
    XSElementDecl top = decl.getSubstAffiliation();
    if(top!=null) {
        CElement topci = selector.bindToType(top,decl);

        if(r instanceof CClassInfo && topci instanceof CClassInfo)
            ((CClassInfo)r).setBaseClass((CClassInfo)topci);
        if (r instanceof CElementInfo && topci instanceof CElementInfo)
            ((CElementInfo)r).setSubstitutionHead((CElementInfo)topci);
    }

    return r;
}
 
Example 4
Source File: DefaultClassBinder.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public CElement elementDecl(XSElementDecl decl) {
    CElement r = allow(decl,decl.getName());

    if(r==null) {
        QName tagName = getName(decl);
        CCustomizations custs = builder.getBindInfo(decl).toCustomizationList();

        if(decl.isGlobal()) {
            if(isCollapsable(decl)) {
                // we want the returned type to be built as a complex type,
                // so the binding cannot be delayed.
                return selector.bindToType(decl.getType().asComplexType(),decl,true);
            } else {
                String className = null;
                if(getGlobalBinding().isGenerateElementClass())
                    className = deriveName(decl);

                // otherwise map global elements to JAXBElement
                CElementInfo cei = new CElementInfo(
                    model, tagName, selector.getClassScope(), className, custs, decl.getLocator());
                selector.boundElements.put(decl,cei);

                stb.refererStack.push(decl);    // referer is element
                cei.initContentType( selector.bindToType(decl.getType(),decl), decl, decl.getDefaultValue() );
                stb.refererStack.pop();
                r = cei;
            }
        }
    }

    // have the substitution member derive from the substitution head
    XSElementDecl top = decl.getSubstAffiliation();
    if(top!=null) {
        CElement topci = selector.bindToType(top,decl);

        if(r instanceof CClassInfo && topci instanceof CClassInfo)
            ((CClassInfo)r).setBaseClass((CClassInfo)topci);
        if (r instanceof CElementInfo && topci instanceof CElementInfo)
            ((CElementInfo)r).setSubstitutionHead((CElementInfo)topci);
    }

    return r;
}
 
Example 5
Source File: DefaultClassBinder.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public CElement elementDecl(XSElementDecl decl) {
    CElement r = allow(decl,decl.getName());

    if(r==null) {
        QName tagName = getName(decl);
        CCustomizations custs = builder.getBindInfo(decl).toCustomizationList();

        if(decl.isGlobal()) {
            if(isCollapsable(decl)) {
                // we want the returned type to be built as a complex type,
                // so the binding cannot be delayed.
                return selector.bindToType(decl.getType().asComplexType(),decl,true);
            } else {
                String className = null;
                if(getGlobalBinding().isGenerateElementClass())
                    className = deriveName(decl);

                // otherwise map global elements to JAXBElement
                CElementInfo cei = new CElementInfo(
                    model, tagName, selector.getClassScope(), className, custs, decl.getLocator());
                selector.boundElements.put(decl,cei);

                stb.refererStack.push(decl);    // referer is element
                cei.initContentType( selector.bindToType(decl.getType(),decl), decl, decl.getDefaultValue() );
                stb.refererStack.pop();
                r = cei;
            }
        }
    }

    // have the substitution member derive from the substitution head
    XSElementDecl top = decl.getSubstAffiliation();
    if(top!=null) {
        CElement topci = selector.bindToType(top,decl);

        if(r instanceof CClassInfo && topci instanceof CClassInfo)
            ((CClassInfo)r).setBaseClass((CClassInfo)topci);
        if (r instanceof CElementInfo && topci instanceof CElementInfo)
            ((CElementInfo)r).setSubstitutionHead((CElementInfo)topci);
    }

    return r;
}
 
Example 6
Source File: DefaultClassBinder.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public CElement elementDecl(XSElementDecl decl) {
    CElement r = allow(decl,decl.getName());

    if(r==null) {
        QName tagName = getName(decl);
        CCustomizations custs = builder.getBindInfo(decl).toCustomizationList();

        if(decl.isGlobal()) {
            if(isCollapsable(decl)) {
                // we want the returned type to be built as a complex type,
                // so the binding cannot be delayed.
                return selector.bindToType(decl.getType().asComplexType(),decl,true);
            } else {
                String className = null;
                if(getGlobalBinding().isGenerateElementClass())
                    className = deriveName(decl);

                // otherwise map global elements to JAXBElement
                CElementInfo cei = new CElementInfo(
                    model, tagName, selector.getClassScope(), className, custs, decl.getLocator());
                selector.boundElements.put(decl,cei);

                stb.refererStack.push(decl);    // referer is element
                cei.initContentType( selector.bindToType(decl.getType(),decl), decl, decl.getDefaultValue() );
                stb.refererStack.pop();
                r = cei;
            }
        }
    }

    // have the substitution member derive from the substitution head
    XSElementDecl top = decl.getSubstAffiliation();
    if(top!=null) {
        CElement topci = selector.bindToType(top,decl);

        if(r instanceof CClassInfo && topci instanceof CClassInfo)
            ((CClassInfo)r).setBaseClass((CClassInfo)topci);
        if (r instanceof CElementInfo && topci instanceof CElementInfo)
            ((CElementInfo)r).setSubstitutionHead((CElementInfo)topci);
    }

    return r;
}
 
Example 7
Source File: DefaultClassBinder.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public CElement elementDecl(XSElementDecl decl) {
    CElement r = allow(decl,decl.getName());

    if(r==null) {
        QName tagName = getName(decl);
        CCustomizations custs = builder.getBindInfo(decl).toCustomizationList();

        if(decl.isGlobal()) {
            if(isCollapsable(decl)) {
                // we want the returned type to be built as a complex type,
                // so the binding cannot be delayed.
                return selector.bindToType(decl.getType().asComplexType(),decl,true);
            } else {
                String className = null;
                if(getGlobalBinding().isGenerateElementClass())
                    className = deriveName(decl);

                // otherwise map global elements to JAXBElement
                CElementInfo cei = new CElementInfo(
                    model, tagName, selector.getClassScope(), className, custs, decl.getLocator());
                selector.boundElements.put(decl,cei);

                stb.refererStack.push(decl);    // referer is element
                cei.initContentType( selector.bindToType(decl.getType(),decl), decl, decl.getDefaultValue() );
                stb.refererStack.pop();
                r = cei;
            }
        }
    }

    // have the substitution member derive from the substitution head
    XSElementDecl top = decl.getSubstAffiliation();
    if(top!=null) {
        CElement topci = selector.bindToType(top,decl);

        if(r instanceof CClassInfo && topci instanceof CClassInfo)
            ((CClassInfo)r).setBaseClass((CClassInfo)topci);
        if (r instanceof CElementInfo && topci instanceof CElementInfo)
            ((CElementInfo)r).setSubstitutionHead((CElementInfo)topci);
    }

    return r;
}
 
Example 8
Source File: DefaultClassBinder.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public CElement elementDecl(XSElementDecl decl) {
    CElement r = allow(decl,decl.getName());

    if(r==null) {
        QName tagName = getName(decl);
        CCustomizations custs = builder.getBindInfo(decl).toCustomizationList();

        if(decl.isGlobal()) {
            if(isCollapsable(decl)) {
                // we want the returned type to be built as a complex type,
                // so the binding cannot be delayed.
                return selector.bindToType(decl.getType().asComplexType(),decl,true);
            } else {
                String className = null;
                if(getGlobalBinding().isGenerateElementClass())
                    className = deriveName(decl);

                // otherwise map global elements to JAXBElement
                CElementInfo cei = new CElementInfo(
                    model, tagName, selector.getClassScope(), className, custs, decl.getLocator());
                selector.boundElements.put(decl,cei);

                stb.refererStack.push(decl);    // referer is element
                cei.initContentType( selector.bindToType(decl.getType(),decl), decl, decl.getDefaultValue() );
                stb.refererStack.pop();
                r = cei;
            }
        }
    }

    // have the substitution member derive from the substitution head
    XSElementDecl top = decl.getSubstAffiliation();
    if(top!=null) {
        CElement topci = selector.bindToType(top,decl);

        if(r instanceof CClassInfo && topci instanceof CClassInfo)
            ((CClassInfo)r).setBaseClass((CClassInfo)topci);
        if (r instanceof CElementInfo && topci instanceof CElementInfo)
            ((CElementInfo)r).setSubstitutionHead((CElementInfo)topci);
    }

    return r;
}