use of com.sun.tools.xjc.model.CCustomizations in project jaxb-ri by eclipse-ee4j.
the class DefaultClassBinder method elementDecl.
@Override
public CElement elementDecl(XSElementDecl decl) {
CElement r = allow(decl, decl.getName());
if (r == null) {
QName tagName = getName(decl);
CCustomizations custs = builder.getBindInfo(decl).toCustomizationList();
if (decl.isGlobal()) {
if (isCollapsable(decl)) {
// so the binding cannot be delayed.
return selector.bindToType(decl.getType().asComplexType(), decl, true);
} else {
String className = null;
if (getGlobalBinding().isGenerateElementClass())
className = deriveName(decl);
// otherwise map global elements to JAXBElement
CElementInfo cei = new CElementInfo(model, tagName, selector.getClassScope(), className, custs, decl.getLocator());
selector.boundElements.put(decl, cei);
// referer is element
stb.refererStack.push(decl);
cei.initContentType(selector.bindToType(decl.getType(), decl), decl, decl.getDefaultValue());
stb.refererStack.pop();
r = cei;
}
}
}
// have the substitution member derive from the substitution head
XSElementDecl top = decl.getSubstAffiliation();
if (top != null) {
CElement topci = selector.bindToType(top, decl);
if (r instanceof CClassInfo && topci instanceof CClassInfo)
((CClassInfo) r).setBaseClass((CClassInfo) topci);
if (r instanceof CElementInfo && topci instanceof CElementInfo)
((CElementInfo) r).setSubstitutionHead((CElementInfo) topci);
}
return r;
}
use of com.sun.tools.xjc.model.CCustomizations in project vcd-api-tools by vmware.
the class RestApiVersionsPlugin method processClassOutline.
/**
* Annotates {@link ClassOutline}.
*
* @param classOutline
* @param errorHandler
*/
private void processClassOutline(ClassOutline classOutline, ErrorHandler errorHandler) {
CCustomizations customizations = CustomizationUtils.getCustomizations(classOutline);
JDefinedClass implClass = classOutline.implClass;
addSupportedAnnotation(implClass, customizations);
addContentTypeAnnotation(classOutline, customizations);
addSourceLocationComment(implClass, classOutline.target.getLocator());
for (FieldOutline fieldOutline : classOutline.getDeclaredFields()) {
processFieldOutline(fieldOutline, errorHandler);
}
}
Aggregations