public void complexType(XSComplexType ct) { CClass ctBean = selector.bindToType(ct,null,false); if(getCurrentBean()!=ctBean) // in some case complex type and element binds to the same class // don't make it has-a. Just make it is-a. getCurrentBean().setBaseClass(ctBean); }
public void complexType(XSComplexType ct) { CClass ctBean = selector.bindToType(ct,null,false); if(getCurrentBean()!=ctBean) // in some case complex type and element binds to the same class // don't make it has-a. Just make it is-a. getCurrentBean().setBaseClass(ctBean); }
public void complexType(XSComplexType ct) { CClass ctBean = selector.bindToType(ct,null,false); if(getCurrentBean()!=ctBean) // in some case complex type and element binds to the same class // don't make it has-a. Just make it is-a. getCurrentBean().setBaseClass(ctBean); }
public void complexType(XSComplexType ct) { CClass ctBean = selector.bindToType(ct,null,false); if(getCurrentBean()!=ctBean) // in some case complex type and element binds to the same class // don't make it has-a. Just make it is-a. getCurrentBean().setBaseClass(ctBean); }
public void complexType(XSComplexType ct) { CClass ctBean = selector.bindToType(ct,null,false); if(getCurrentBean()!=ctBean) // in some case complex type and element binds to the same class // don't make it has-a. Just make it is-a. getCurrentBean().setBaseClass(ctBean); }
@Override public void postProcessModel(Model model, ErrorHandler errorHandler){ super.postProcessModel(model, errorHandler); Map<String, CClassRef> classRefCache = new HashMap<>(); CClassRef defaultBaseClazz = getClassRef(classRefCache, model, "org.dmg.pmml.PMMLObject"); Collection<CClassInfo> classInfos = (model.beans()).values(); for(CClassInfo classInfo : classInfos){ CClassRef baseClazz = defaultBaseClazz; CPluginCustomization extendsCustomization = CustomizationUtils.findCustomization(classInfo, Customizations.EXTENDS_ELEMENT_NAME); if(extendsCustomization != null){ ExtendsClass extendsClass = (ExtendsClass)CustomizationUtils.unmarshall(Customizations.getContext(), extendsCustomization); String name = getClassName(extendsClass); int lt = name.indexOf('<'); if(lt > -1){ name = name.substring(0, lt); } baseClazz = getClassRef(classRefCache, model, name); } classInfo.setBaseClass(baseClazz); } }
@Override public void postProcessModel(Model model, ErrorHandler errorHandler){ super.postProcessModel(model, errorHandler); CClassRef defaultSuperClass = null; String defaultName = getDefaultName(); if(defaultName != null){ defaultSuperClass = new CClassRef(model, null, createBIClass(defaultName), null); } Collection<CClassInfo> classInfos = (model.beans()).values(); for(CClassInfo classInfo : classInfos){ CPluginCustomization customization = PluginUtil.getCustomization(classInfo, this); if(customization != null){ String name = customization.element.getAttribute("name"); if(name != null){ CClassRef superClass = new CClassRef(model, null, createBIClass(name), null); classInfo.setBaseClass(superClass); } customization.markAsAcknowledged(); } else { if(defaultSuperClass != null){ classInfo.setBaseClass(defaultSuperClass); } } } }
/** * The whole type set can be later bound to a reference property, * in which case we need to generate additional code to wrap this * type reference into an element class. * * This method generates such an element class and returns it. */ protected void toElementRef(CReferencePropertyInfo prop) { CClassInfo scope = Ring.get(ClassSelector.class).getCurrentBean(); Model model = Ring.get(Model.class); CCustomizations custs = Ring.get(BGMBuilder.class).getBindInfo(decl).toCustomizationList(); if(target instanceof CClassInfo && Ring.get(BIGlobalBinding.class).isSimpleMode()) { CClassInfo bean = new CClassInfo(model,scope, model.getNameConverter().toClassName(decl.getName()), decl.getLocator(), null, BGMBuilder.getName(decl), decl, custs); bean.setBaseClass((CClassInfo)target); prop.getElements().add(bean); } else { CElementInfo e = new CElementInfo(model,BGMBuilder.getName(decl),scope,target, decl.getDefaultValue(), decl, custs, decl.getLocator()); prop.getElements().add(e); } }
/** * The whole type set can be later bound to a reference property, * in which case we need to generate additional code to wrap this * type reference into an element class. * * This method generates such an element class and returns it. */ protected void toElementRef(CReferencePropertyInfo prop) { CClassInfo scope = Ring.get(ClassSelector.class).getCurrentBean(); Model model = Ring.get(Model.class); CCustomizations custs = Ring.get(BGMBuilder.class).getBindInfo(decl).toCustomizationList(); if(target instanceof CClassInfo && Ring.get(BIGlobalBinding.class).isSimpleMode()) { CClassInfo bean = new CClassInfo(model,scope, model.getNameConverter().toClassName(decl.getName()), decl.getLocator(), null, BGMBuilder.getName(decl), decl, custs); bean.setBaseClass((CClassInfo)target); prop.getElements().add(bean); } else { CElementInfo e = new CElementInfo(model,BGMBuilder.getName(decl),scope,target, decl.getDefaultValue(), decl, custs, decl.getLocator()); prop.getElements().add(e); } }
/** * The whole type set can be later bound to a reference property, * in which case we need to generate additional code to wrap this * type reference into an element class. * * This method generates such an element class and returns it. */ protected void toElementRef(CReferencePropertyInfo prop) { CClassInfo scope = Ring.get(ClassSelector.class).getCurrentBean(); Model model = Ring.get(Model.class); CCustomizations custs = Ring.get(BGMBuilder.class).getBindInfo(decl).toCustomizationList(); if(target instanceof CClassInfo && Ring.get(BIGlobalBinding.class).isSimpleMode()) { CClassInfo bean = new CClassInfo(model,scope, model.getNameConverter().toClassName(decl.getName()), decl.getLocator(), null, BGMBuilder.getName(decl), decl, custs); bean.setBaseClass((CClassInfo)target); prop.getElements().add(bean); } else { CElementInfo e = new CElementInfo(model,BGMBuilder.getName(decl),scope,target, decl.getDefaultValue(), decl, custs, decl.getLocator()); prop.getElements().add(e); } }
/** * The whole type set can be later bound to a reference property, * in which case we need to generate additional code to wrap this * type reference into an element class. * * This method generates such an element class and returns it. */ protected void toElementRef(CReferencePropertyInfo prop) { CClassInfo scope = Ring.get(ClassSelector.class).getCurrentBean(); Model model = Ring.get(Model.class); CCustomizations custs = Ring.get(BGMBuilder.class).getBindInfo(decl).toCustomizationList(); if(target instanceof CClassInfo && Ring.get(BIGlobalBinding.class).isSimpleMode()) { CClassInfo bean = new CClassInfo(model,scope, model.getNameConverter().toClassName(decl.getName()), decl.getLocator(), null, BGMBuilder.getName(decl), decl, custs); bean.setBaseClass((CClassInfo)target); prop.getElements().add(bean); } else { CElementInfo e = new CElementInfo(model,BGMBuilder.getName(decl),scope,target, decl.getDefaultValue(), decl, custs, decl.getLocator()); prop.getElements().add(e); } }
/** * The whole type set can be later bound to a reference property, * in which case we need to generate additional code to wrap this * type reference into an element class. * * This method generates such an element class and returns it. */ protected void toElementRef(CReferencePropertyInfo prop) { CClassInfo scope = Ring.get(ClassSelector.class).getCurrentBean(); Model model = Ring.get(Model.class); CCustomizations custs = Ring.get(BGMBuilder.class).getBindInfo(decl).toCustomizationList(); if(target instanceof CClassInfo && Ring.get(BIGlobalBinding.class).isSimpleMode()) { CClassInfo bean = new CClassInfo(model,scope, model.getNameConverter().toClassName(decl.getName()), decl.getLocator(), null, BGMBuilder.getName(decl), decl, custs); bean.setBaseClass((CClassInfo)target); prop.getElements().add(bean); } else { CElementInfo e = new CElementInfo(model,BGMBuilder.getName(decl),scope,target, decl.getDefaultValue(), decl, custs, decl.getLocator()); prop.getElements().add(e); } }
((CClassInfo)r).setBaseClass((CClassInfo)topci); if (r instanceof CElementInfo && topci instanceof CElementInfo) ((CElementInfo)r).setSubstitutionHead((CElementInfo)topci);
public void build(XSComplexType ct) { XSComplexType baseType = ct.getBaseType().asComplexType(); // build the base class CClass baseClass = selector.bindToType(baseType, ct, true); assert baseClass != null; // global complex type must map to a class if (!checkIfExtensionSafe(baseType, ct)) { // error. We can't handle any further extension errorReceiver.error(ct.getLocator(), Messages.ERR_NO_FURTHER_EXTENSION.format( baseType.getName(), ct.getName() ) ); return; } selector.getCurrentBean().setBaseClass(baseClass); builder.recordBindingMode(ct, ComplexTypeBindingMode.FALLBACK_EXTENSION); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; RawTypeSet ts = RawTypeSetBuilder.build(ct.getContentType().asParticle(), false); p = prop.createDummyExtendedMixedReferenceProperty("contentOverrideFor" + ct.getName(), ct, ts); selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
public void build(XSComplexType ct) { XSComplexType baseType = ct.getBaseType().asComplexType(); // build the base class CClass baseClass = selector.bindToType(baseType, ct, true); assert baseClass != null; // global complex type must map to a class if (!checkIfExtensionSafe(baseType, ct)) { // error. We can't handle any further extension errorReceiver.error(ct.getLocator(), Messages.ERR_NO_FURTHER_EXTENSION.format( baseType.getName(), ct.getName() ) ); return; } selector.getCurrentBean().setBaseClass(baseClass); builder.recordBindingMode(ct, ComplexTypeBindingMode.FALLBACK_EXTENSION); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; RawTypeSet ts = RawTypeSetBuilder.build(ct.getContentType().asParticle(), false); p = prop.createDummyExtendedMixedReferenceProperty("contentOverrideFor" + ct.getName(), ct, ts); selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
public void build(XSComplexType ct) { XSComplexType baseType = ct.getBaseType().asComplexType(); // build the base class CClass baseClass = selector.bindToType(baseType, ct, true); assert baseClass != null; // global complex type must map to a class if (!checkIfExtensionSafe(baseType, ct)) { // error. We can't handle any further extension errorReceiver.error(ct.getLocator(), Messages.ERR_NO_FURTHER_EXTENSION.format( baseType.getName(), ct.getName() ) ); return; } selector.getCurrentBean().setBaseClass(baseClass); builder.recordBindingMode(ct, ComplexTypeBindingMode.FALLBACK_EXTENSION); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; RawTypeSet ts = RawTypeSetBuilder.build(ct.getContentType().asParticle(), false); p = prop.createDummyExtendedMixedReferenceProperty("contentOverrideFor" + ct.getName(), ct, ts); selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
public void build(XSComplexType ct) { XSComplexType baseType = ct.getBaseType().asComplexType(); // build the base class CClass baseClass = selector.bindToType(baseType, ct, true); assert baseClass != null; // global complex type must map to a class if (!checkIfExtensionSafe(baseType, ct)) { // error. We can't handle any further extension errorReceiver.error(ct.getLocator(), Messages.ERR_NO_FURTHER_EXTENSION.format( baseType.getName(), ct.getName() ) ); return; } selector.getCurrentBean().setBaseClass(baseClass); builder.recordBindingMode(ct, ComplexTypeBindingMode.FALLBACK_EXTENSION); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; RawTypeSet ts = RawTypeSetBuilder.build(ct.getContentType().asParticle(), false); p = prop.createDummyExtendedMixedReferenceProperty("contentOverrideFor" + ct.getName(), ct, ts); selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
public void build(XSComplexType ct) { XSComplexType baseType = ct.getBaseType().asComplexType(); // build the base class CClass baseClass = selector.bindToType(baseType, ct, true); assert baseClass != null; // global complex type must map to a class if (!checkIfExtensionSafe(baseType, ct)) { // error. We can't handle any further extension errorReceiver.error(ct.getLocator(), Messages.ERR_NO_FURTHER_EXTENSION.format( baseType.getName(), ct.getName() ) ); return; } selector.getCurrentBean().setBaseClass(baseClass); builder.recordBindingMode(ct, ComplexTypeBindingMode.FALLBACK_EXTENSION); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; RawTypeSet ts = RawTypeSetBuilder.build(ct.getContentType().asParticle(), false); p = prop.createDummyExtendedMixedReferenceProperty("contentOverrideFor" + ct.getName(), ct, ts); selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
assert baseClass!=null; // global complex type must map to a class selector.getCurrentBean().setBaseClass(baseClass);
assert baseClass!=null; // global complex type must map to a class selector.getCurrentBean().setBaseClass(baseClass);