use of com.sun.xml.xsom.visitor.XSContentTypeVisitor in project jaxb-ri by eclipse-ee4j.
the class FreshComplexTypeBuilder method build.
@Override
public void build(final XSComplexType ct) {
XSContentType contentType = ct.getContentType();
contentType.visit(new XSContentTypeVisitor() {
@Override
public void simpleType(XSSimpleType st) {
builder.recordBindingMode(ct, ComplexTypeBindingMode.NORMAL);
simpleTypeBuilder.refererStack.push(ct);
TypeUse use = simpleTypeBuilder.build(st);
simpleTypeBuilder.refererStack.pop();
BIProperty prop = BIProperty.getCustomization(ct);
CPropertyInfo p = prop.createValueProperty("Value", false, ct, use, BGMBuilder.getName(st));
selector.getCurrentBean().addProperty(p);
}
@Override
public void particle(XSParticle p) {
// determine the binding of this complex type.
builder.recordBindingMode(ct, bgmBuilder.getParticleBinder().checkFallback(p) ? FALLBACK_CONTENT : NORMAL);
bgmBuilder.getParticleBinder().build(p);
XSTerm term = p.getTerm();
if (term.isModelGroup() && term.asModelGroup().getCompositor() == XSModelGroup.ALL)
selector.getCurrentBean().setOrdered(false);
}
@Override
public void empty(XSContentType e) {
builder.recordBindingMode(ct, NORMAL);
}
});
// adds attributes and we are through.
green.attContainer(ct);
}
Aggregations