Note that calling this method marks all those plug-in customizations as 'used'. So call it only when it's really necessary.
160161162163164165166167168169170
// 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);
187188189190191192193194195196197
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)
464465466467468469470471472473474
// 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) {
508509510511512513514515516517518
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),
520521522523524525526527528529530
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
373374375376377378379380381382383
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,
190191192193194195196197198199200
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;
141142143144145146147148149150151
// 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)
158159160161162163164165166167168