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);
}
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));
}
}
Aggregations