Search in sources :

Example 6 with RawTypeSet

use of com.sun.tools.xjc.reader.RawTypeSet in project jaxb-ri by eclipse-ee4j.

the class MultiWildcardComplexTypeBuilder method build.

@Override
public void build(XSComplexType ct) {
    XSContentType contentType = ct.getContentType();
    builder.recordBindingMode(ct, FALLBACK_CONTENT);
    BIProperty prop = BIProperty.getCustomization(ct);
    CPropertyInfo p;
    if (contentType.asEmpty() != null) {
        p = prop.createValueProperty("Content", false, ct, CBuiltinLeafInfo.STRING, null);
    } else {
        RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(), false);
        p = prop.createReferenceProperty("Content", false, ct, ts, true, false, true, false);
    }
    selector.getCurrentBean().addProperty(p);
    // adds attributes and we are through.
    green.attContainer(ct);
}
Also used : XSContentType(com.sun.xml.xsom.XSContentType) BIProperty(com.sun.tools.xjc.reader.xmlschema.bindinfo.BIProperty) CPropertyInfo(com.sun.tools.xjc.model.CPropertyInfo) RawTypeSet(com.sun.tools.xjc.reader.RawTypeSet)

Example 7 with RawTypeSet

use of com.sun.tools.xjc.reader.RawTypeSet in project jaxb-ri by eclipse-ee4j.

the class RestrictedComplexTypeBuilder method build.

@Override
public void build(XSComplexType ct) {
    if (bgmBuilder.getGlobalBinding().isRestrictionFreshType()) {
        // handle derivation-by-restriction like a whole new type
        new FreshComplexTypeBuilder().build(ct);
        return;
    }
    XSComplexType baseType = ct.getBaseType().asComplexType();
    // build the base class
    CClass baseClass = selector.bindToType(baseType, ct, true);
    // global complex type must map to a class
    assert baseClass != null;
    selector.getCurrentBean().setBaseClass(baseClass);
    if (bgmBuilder.isGenerateMixedExtensions()) {
        boolean forceFallbackInExtension = baseType.isMixed() && ct.isMixed() && (ct.getExplicitContent() != null) && bgmBuilder.inExtensionMode;
        if (forceFallbackInExtension) {
            builder.recordBindingMode(ct, ComplexTypeBindingMode.NORMAL);
            BIProperty prop = BIProperty.getCustomization(ct);
            CPropertyInfo p;
            XSParticle particle = ct.getContentType().asParticle();
            if (particle != null) {
                RawTypeSet ts = RawTypeSetBuilder.build(particle, false);
                p = prop.createDummyExtendedMixedReferenceProperty("Content", ct, ts);
                selector.getCurrentBean().addProperty(p);
            }
        } else {
            // determine the binding of this complex type.
            builder.recordBindingMode(ct, builder.getBindingMode(baseType));
        }
    } else {
        builder.recordBindingMode(ct, builder.getBindingMode(baseType));
    }
}
Also used : CClass(com.sun.tools.xjc.model.CClass) XSParticle(com.sun.xml.xsom.XSParticle) XSComplexType(com.sun.xml.xsom.XSComplexType) BIProperty(com.sun.tools.xjc.reader.xmlschema.bindinfo.BIProperty) CPropertyInfo(com.sun.tools.xjc.model.CPropertyInfo) RawTypeSet(com.sun.tools.xjc.reader.RawTypeSet)

Aggregations

RawTypeSet (com.sun.tools.xjc.reader.RawTypeSet)7 CPropertyInfo (com.sun.tools.xjc.model.CPropertyInfo)5 BIProperty (com.sun.tools.xjc.reader.xmlschema.bindinfo.BIProperty)5 CClass (com.sun.tools.xjc.model.CClass)3 XSComplexType (com.sun.xml.xsom.XSComplexType)3 Multiplicity (com.sun.tools.xjc.model.Multiplicity)2 XSContentType (com.sun.xml.xsom.XSContentType)2 XSParticle (com.sun.xml.xsom.XSParticle)2 CElementPropertyInfo (com.sun.tools.xjc.model.CElementPropertyInfo)1 CReferencePropertyInfo (com.sun.tools.xjc.model.CReferencePropertyInfo)1 Element (com.sun.tools.xjc.reader.gbind.Element)1