Note that calling this method marks all those plug-in customizations as 'used'. So call it only when it's really necessary.
362363364365366367368369370371372
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,
130131132133134135136137138139140
// 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)
147148149150151152153154155156157
// 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);
174175176177178179180181182183184
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)
424425426427428429430431432433434
// 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) {
468469470471472473474475476477478
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),
480481482483484485486487488489490
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
179180181182183184185186187188189
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;
133134135136137138139140141142143