Note that calling this method marks all those plug-in customizations as 'used'. So call it only when it's really necessary.
150151152153154155156157158159160
// but avoid doing so when the element is mapped to a class, // which creates unnecessary classes return new CClassInfo( model, selector.getClassScope(), deriveName(element), element.getLocator(), null, getName(element), element, bi.toCustomizationList() ); } CElement parentType = selector.isBound(element,type);
177178179180181182183184185186187
type.getOwnerSchema() ).get(BISchemaBinding.class); if(sb!=null) className = sb.mangleAnonymousTypeClassName(className); scope = selector.getClassScope(); } return new CClassInfo(model, scope, className, type.getLocator(), null, null, type, bi.toCustomizationList() ); } } private QName getTypeName(XSComplexType type) { if(type.getRedefinedBy()!=null)
454455456457458459460461462463464
// would have been bound, from the schema. Ring.get(ComplexTypeFieldBuilder.class).recordBindingMode( (XSComplexType)component, ComplexTypeBindingMode.NORMAL ); } return new CClassRef(model, component, decl, bindInfo.toCustomizationList() ); } } String clsName = decl.getClassName(); if(clsName==null) {
498499500501502503504505506507508
if (component instanceof XSElementDecl && !isCollapsable((XSElementDecl)component)) { XSElementDecl e = ((XSElementDecl)component); CElementInfo cei = new CElementInfo(model, elementName, selector.getClassScope(), clsName, bindInfo.toCustomizationList(), decl.getLocation() ); selector.boundElements.put(e,cei); stb.refererStack.push(component); // referer is element cei.initContentType( selector.bindToType(e.getType(),e),
510511512513514515516517518519520
stb.refererStack.pop(); return cei; // TODO: support javadoc and userSpecifiedImplClass } else { CClassInfo bt = new CClassInfo(model,selector.getClassScope(), clsName, decl.getLocation(), typeName, elementName, component, bindInfo.toCustomizationList() ); // set javadoc class comment. if(decl.getJavadoc()!=null ) bt.javadoc = decl.getJavadoc()+"\n\n"; // add extra blank lines so that the schema fragment
364365366367368369370371372373374
Messages.format(Messages.ERR_INCORRECT_CLASS_NAME, en.ref) ); // recover by ignoring @ref return null; } return new CClassRef(model, type, en, info.toCustomizationList() ); } // list and union cannot be mapped to a type-safe enum, // so in this stage we can safely cast it to XSRestrictionSimpleType return bindToTypeSafeEnum( (XSRestrictionSimpleType)type,
373374375376377378379380381382383
201202203204205206207208209210211
for( XSSchema s : schemas.getSchemas() ) { BindInfo bi = getBindInfo(s); // collect all global customizations model.getCustomizations().addAll(bi.toCustomizationList()); BIGlobalBinding gb = bi.get(BIGlobalBinding.class); if(gb==null) continue;
143144145146147148149150151152153
// by default, global ones get their own classes. JPackage pkg = selector.getPackage(type.getTargetNamespace()); return new CClassInfo(model,pkg,className, loc,getTypeName(type),tagName,type,bi.toCustomizationList()); } else { XSElementDecl element = type.getScope(); if( element.isGlobal() && isCollapsable(element)) { if(builder.getBindInfo(element).get(BIClass.class)!=null)