com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty Java Examples
The following examples show how to use
com.sun.tools.internal.xjc.reader.xmlschema.bindinfo.BIProperty.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MultiWildcardComplexTypeBuilder.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public void build(XSComplexType ct) { XSContentType contentType = ct.getContentType(); builder.recordBindingMode(ct, FALLBACK_CONTENT); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; if(contentType.asEmpty()!=null) { p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null); } else { RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(),false); p = prop.createReferenceProperty("Content", false, ct, ts, true, false, true, false); } selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
Example #2
Source File: MultiWildcardComplexTypeBuilder.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public void build(XSComplexType ct) { XSContentType contentType = ct.getContentType(); builder.recordBindingMode(ct, FALLBACK_CONTENT); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; if(contentType.asEmpty()!=null) { p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null); } else { RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(),false); p = prop.createReferenceProperty("Content", false, ct, ts, true, false, true, false); } selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
Example #3
Source File: MultiWildcardComplexTypeBuilder.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public void build(XSComplexType ct) { XSContentType contentType = ct.getContentType(); builder.recordBindingMode(ct, FALLBACK_CONTENT); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; if(contentType.asEmpty()!=null) { p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null); } else { RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(),false); p = prop.createReferenceProperty("Content", false, ct, ts, true, false, true, false); } selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
Example #4
Source File: MultiWildcardComplexTypeBuilder.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public void build(XSComplexType ct) { XSContentType contentType = ct.getContentType(); builder.recordBindingMode(ct, FALLBACK_CONTENT); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; if(contentType.asEmpty()!=null) { p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null); } else { RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(),false); p = prop.createReferenceProperty("Content", false, ct, ts, true, false, true, false); } selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
Example #5
Source File: MultiWildcardComplexTypeBuilder.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public void build(XSComplexType ct) { XSContentType contentType = ct.getContentType(); builder.recordBindingMode(ct, FALLBACK_CONTENT); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; if(contentType.asEmpty()!=null) { p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null); } else { RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(),false); p = prop.createReferenceProperty("Content", false, ct, ts, true, false, true, false); } selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
Example #6
Source File: MultiWildcardComplexTypeBuilder.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public void build(XSComplexType ct) { XSContentType contentType = ct.getContentType(); builder.recordBindingMode(ct, FALLBACK_CONTENT); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; if(contentType.asEmpty()!=null) { p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null); } else { RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(),false); p = prop.createReferenceProperty("Content", false, ct, ts, true, false, true, false); } selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
Example #7
Source File: MultiWildcardComplexTypeBuilder.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public void build(XSComplexType ct) { XSContentType contentType = ct.getContentType(); builder.recordBindingMode(ct, FALLBACK_CONTENT); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; if(contentType.asEmpty()!=null) { p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null); } else { RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(),false); p = prop.createReferenceProperty("Content", false, ct, ts, true, false, true, false); } selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
Example #8
Source File: MultiWildcardComplexTypeBuilder.java From hottub with GNU General Public License v2.0 | 6 votes |
public void build(XSComplexType ct) { XSContentType contentType = ct.getContentType(); builder.recordBindingMode(ct, FALLBACK_CONTENT); BIProperty prop = BIProperty.getCustomization(ct); CPropertyInfo p; if(contentType.asEmpty()!=null) { p = prop.createValueProperty("Content",false,ct,CBuiltinLeafInfo.STRING,null); } else { RawTypeSet ts = RawTypeSetBuilder.build(contentType.asParticle(),false); p = prop.createReferenceProperty("Content", false, ct, ts, true, false, true, false); } selector.getCurrentBean().addProperty(p); // adds attributes and we are through. green.attContainer(ct); }
Example #9
Source File: ColorBinder.java From hottub with GNU General Public License v2.0 | 5 votes |
protected final void createSimpleTypeProperty(XSSimpleType type,String propName) { BIProperty prop = BIProperty.getCustomization(type); SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class); // since we are building the simple type here, use buildDef CPropertyInfo p = prop.createValueProperty(propName,false,type,stb.buildDef(type),BGMBuilder.getName(type)); getCurrentBean().addProperty(p); }
Example #10
Source File: ColorBinder.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
protected final void createSimpleTypeProperty(XSSimpleType type,String propName) { BIProperty prop = BIProperty.getCustomization(type); SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class); // since we are building the simple type here, use buildDef CPropertyInfo p = prop.createValueProperty(propName,false,type,stb.buildDef(type),BGMBuilder.getName(type)); getCurrentBean().addProperty(p); }
Example #11
Source File: BindPurple.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Attribute use always becomes a property. */ public void attributeUse(XSAttributeUse use) { boolean hasFixedValue = use.getFixedValue()!=null; BIProperty pc = BIProperty.getCustomization(use); // map to a constant property ? boolean toConstant = pc.isConstantProperty() && hasFixedValue; TypeUse attType = bindAttDecl(use.getDecl()); CPropertyInfo prop = pc.createAttributeProperty( use, attType ); if(toConstant) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); prop.realization = builder.fieldRendererFactory.getConst(prop.realization); } else if(!attType.isCollection() && (prop.baseType == null ? true : !prop.baseType.isPrimitive())) { // don't support a collection default value. That's difficult to do. // primitive types default value is problematic too - we can't check whether it has been set or no ( ==null) isn't possible TODO: emit a waring in these cases if(use.getDefaultValue()!=null) { // this attribute use has a default value. // the item type is guaranteed to be a leaf type... or TODO: is it really so? // don't support default values if it's a list prop.defaultValue = CDefaultValue.create(attType,use.getDefaultValue()); } else if(use.getFixedValue()!=null) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); } } else if(prop.baseType != null && prop.baseType.isPrimitive()) { ErrorReporter errorReporter = Ring.get(ErrorReporter.class); errorReporter.warning(prop.getLocator(), Messages.WARN_DEFAULT_VALUE_PRIMITIVE_TYPE, prop.baseType.name()); } getCurrentBean().addProperty(prop); }
Example #12
Source File: SimpleTypeBuilder.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Returns a javaType customization specified to the referer, if present. * @return can be null. */ private BIConversion getRefererCustomization() { BindInfo info = builder.getBindInfo(getReferer()); BIProperty prop = info.get(BIProperty.class); if(prop==null) return null; return prop.getConv(); }
Example #13
Source File: ColorBinder.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
protected final void createSimpleTypeProperty(XSSimpleType type,String propName) { BIProperty prop = BIProperty.getCustomization(type); SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class); // since we are building the simple type here, use buildDef CPropertyInfo p = prop.createValueProperty(propName,false,type,stb.buildDef(type),BGMBuilder.getName(type)); getCurrentBean().addProperty(p); }
Example #14
Source File: BindPurple.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Attribute use always becomes a property. */ public void attributeUse(XSAttributeUse use) { boolean hasFixedValue = use.getFixedValue()!=null; BIProperty pc = BIProperty.getCustomization(use); // map to a constant property ? boolean toConstant = pc.isConstantProperty() && hasFixedValue; TypeUse attType = bindAttDecl(use.getDecl()); CPropertyInfo prop = pc.createAttributeProperty( use, attType ); if(toConstant) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); prop.realization = builder.fieldRendererFactory.getConst(prop.realization); } else if(!attType.isCollection() && (prop.baseType == null ? true : !prop.baseType.isPrimitive())) { // don't support a collection default value. That's difficult to do. // primitive types default value is problematic too - we can't check whether it has been set or no ( ==null) isn't possible TODO: emit a waring in these cases if(use.getDefaultValue()!=null) { // this attribute use has a default value. // the item type is guaranteed to be a leaf type... or TODO: is it really so? // don't support default values if it's a list prop.defaultValue = CDefaultValue.create(attType,use.getDefaultValue()); } else if(use.getFixedValue()!=null) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); } } else if(prop.baseType != null && prop.baseType.isPrimitive()) { ErrorReporter errorReporter = Ring.get(ErrorReporter.class); errorReporter.warning(prop.getLocator(), Messages.WARN_DEFAULT_VALUE_PRIMITIVE_TYPE, prop.baseType.name()); } getCurrentBean().addProperty(prop); }
Example #15
Source File: SimpleTypeBuilder.java From hottub with GNU General Public License v2.0 | 5 votes |
/** * Returns a javaType customization specified to the referer, if present. * @return can be null. */ private BIConversion getRefererCustomization() { BindInfo info = builder.getBindInfo(getReferer()); BIProperty prop = info.get(BIProperty.class); if(prop==null) return null; return prop.getConv(); }
Example #16
Source File: BindPurple.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
/** * Attribute use always becomes a property. */ public void attributeUse(XSAttributeUse use) { boolean hasFixedValue = use.getFixedValue()!=null; BIProperty pc = BIProperty.getCustomization(use); // map to a constant property ? boolean toConstant = pc.isConstantProperty() && hasFixedValue; TypeUse attType = bindAttDecl(use.getDecl()); CPropertyInfo prop = pc.createAttributeProperty( use, attType ); if(toConstant) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); prop.realization = builder.fieldRendererFactory.getConst(prop.realization); } else if(!attType.isCollection() && (prop.baseType == null ? true : !prop.baseType.isPrimitive())) { // don't support a collection default value. That's difficult to do. // primitive types default value is problematic too - we can't check whether it has been set or no ( ==null) isn't possible TODO: emit a waring in these cases if(use.getDefaultValue()!=null) { // this attribute use has a default value. // the item type is guaranteed to be a leaf type... or TODO: is it really so? // don't support default values if it's a list prop.defaultValue = CDefaultValue.create(attType,use.getDefaultValue()); } else if(use.getFixedValue()!=null) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); } } else if(prop.baseType != null && prop.baseType.isPrimitive()) { ErrorReporter errorReporter = Ring.get(ErrorReporter.class); errorReporter.warning(prop.getLocator(), Messages.WARN_DEFAULT_VALUE_PRIMITIVE_TYPE, prop.baseType.name()); } getCurrentBean().addProperty(prop); }
Example #17
Source File: BindPurple.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Attribute use always becomes a property. */ public void attributeUse(XSAttributeUse use) { boolean hasFixedValue = use.getFixedValue()!=null; BIProperty pc = BIProperty.getCustomization(use); // map to a constant property ? boolean toConstant = pc.isConstantProperty() && hasFixedValue; TypeUse attType = bindAttDecl(use.getDecl()); CPropertyInfo prop = pc.createAttributeProperty( use, attType ); if(toConstant) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); prop.realization = builder.fieldRendererFactory.getConst(prop.realization); } else if(!attType.isCollection() && (prop.baseType == null ? true : !prop.baseType.isPrimitive())) { // don't support a collection default value. That's difficult to do. // primitive types default value is problematic too - we can't check whether it has been set or no ( ==null) isn't possible TODO: emit a waring in these cases if(use.getDefaultValue()!=null) { // this attribute use has a default value. // the item type is guaranteed to be a leaf type... or TODO: is it really so? // don't support default values if it's a list prop.defaultValue = CDefaultValue.create(attType,use.getDefaultValue()); } else if(use.getFixedValue()!=null) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); } } else if(prop.baseType != null && prop.baseType.isPrimitive()) { ErrorReporter errorReporter = Ring.get(ErrorReporter.class); errorReporter.warning(prop.getLocator(), Messages.WARN_DEFAULT_VALUE_PRIMITIVE_TYPE, prop.baseType.name()); } getCurrentBean().addProperty(prop); }
Example #18
Source File: SimpleTypeBuilder.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
/** * Returns a javaType customization specified to the referer, if present. * @return can be null. */ private BIConversion getRefererCustomization() { BindInfo info = builder.getBindInfo(getReferer()); BIProperty prop = info.get(BIProperty.class); if(prop==null) return null; return prop.getConv(); }
Example #19
Source File: ColorBinder.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
protected final void createSimpleTypeProperty(XSSimpleType type,String propName) { BIProperty prop = BIProperty.getCustomization(type); SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class); // since we are building the simple type here, use buildDef CPropertyInfo p = prop.createValueProperty(propName,false,type,stb.buildDef(type),BGMBuilder.getName(type)); getCurrentBean().addProperty(p); }
Example #20
Source File: BindPurple.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Attribute use always becomes a property. */ public void attributeUse(XSAttributeUse use) { boolean hasFixedValue = use.getFixedValue()!=null; BIProperty pc = BIProperty.getCustomization(use); // map to a constant property ? boolean toConstant = pc.isConstantProperty() && hasFixedValue; TypeUse attType = bindAttDecl(use.getDecl()); CPropertyInfo prop = pc.createAttributeProperty( use, attType ); if(toConstant) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); prop.realization = builder.fieldRendererFactory.getConst(prop.realization); } else if(!attType.isCollection() && (prop.baseType == null ? true : !prop.baseType.isPrimitive())) { // don't support a collection default value. That's difficult to do. // primitive types default value is problematic too - we can't check whether it has been set or no ( ==null) isn't possible TODO: emit a waring in these cases if(use.getDefaultValue()!=null) { // this attribute use has a default value. // the item type is guaranteed to be a leaf type... or TODO: is it really so? // don't support default values if it's a list prop.defaultValue = CDefaultValue.create(attType,use.getDefaultValue()); } else if(use.getFixedValue()!=null) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); } } else if(prop.baseType != null && prop.baseType.isPrimitive()) { ErrorReporter errorReporter = Ring.get(ErrorReporter.class); errorReporter.warning(prop.getLocator(), Messages.WARN_DEFAULT_VALUE_PRIMITIVE_TYPE, prop.baseType.name()); } getCurrentBean().addProperty(prop); }
Example #21
Source File: SimpleTypeBuilder.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
/** * Returns a javaType customization specified to the referer, if present. * @return can be null. */ private BIConversion getRefererCustomization() { BindInfo info = builder.getBindInfo(getReferer()); BIProperty prop = info.get(BIProperty.class); if(prop==null) return null; return prop.getConv(); }
Example #22
Source File: ColorBinder.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
protected final void createSimpleTypeProperty(XSSimpleType type,String propName) { BIProperty prop = BIProperty.getCustomization(type); SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class); // since we are building the simple type here, use buildDef CPropertyInfo p = prop.createValueProperty(propName,false,type,stb.buildDef(type),BGMBuilder.getName(type)); getCurrentBean().addProperty(p); }
Example #23
Source File: SimpleTypeBuilder.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Returns a javaType customization specified to the referer, if present. * @return can be null. */ private BIConversion getRefererCustomization() { BindInfo info = builder.getBindInfo(getReferer()); BIProperty prop = info.get(BIProperty.class); if(prop==null) return null; return prop.getConv(); }
Example #24
Source File: SimpleTypeBuilder.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
/** * Returns a javaType customization specified to the referer, if present. * @return can be null. */ private BIConversion getRefererCustomization() { BindInfo info = builder.getBindInfo(getReferer()); BIProperty prop = info.get(BIProperty.class); if(prop==null) return null; return prop.getConv(); }
Example #25
Source File: BindPurple.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
/** * Attribute use always becomes a property. */ public void attributeUse(XSAttributeUse use) { boolean hasFixedValue = use.getFixedValue()!=null; BIProperty pc = BIProperty.getCustomization(use); // map to a constant property ? boolean toConstant = pc.isConstantProperty() && hasFixedValue; TypeUse attType = bindAttDecl(use.getDecl()); CPropertyInfo prop = pc.createAttributeProperty( use, attType ); if(toConstant) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); prop.realization = builder.fieldRendererFactory.getConst(prop.realization); } else if(!attType.isCollection() && (prop.baseType == null ? true : !prop.baseType.isPrimitive())) { // don't support a collection default value. That's difficult to do. // primitive types default value is problematic too - we can't check whether it has been set or no ( ==null) isn't possible TODO: emit a waring in these cases if(use.getDefaultValue()!=null) { // this attribute use has a default value. // the item type is guaranteed to be a leaf type... or TODO: is it really so? // don't support default values if it's a list prop.defaultValue = CDefaultValue.create(attType,use.getDefaultValue()); } else if(use.getFixedValue()!=null) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); } } else if(prop.baseType != null && prop.baseType.isPrimitive()) { ErrorReporter errorReporter = Ring.get(ErrorReporter.class); errorReporter.warning(prop.getLocator(), Messages.WARN_DEFAULT_VALUE_PRIMITIVE_TYPE, prop.baseType.name()); } getCurrentBean().addProperty(prop); }
Example #26
Source File: ColorBinder.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
protected final void createSimpleTypeProperty(XSSimpleType type,String propName) { BIProperty prop = BIProperty.getCustomization(type); SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class); // since we are building the simple type here, use buildDef CPropertyInfo p = prop.createValueProperty(propName,false,type,stb.buildDef(type),BGMBuilder.getName(type)); getCurrentBean().addProperty(p); }
Example #27
Source File: SimpleTypeBuilder.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Returns a javaType customization specified to the referer, if present. * @return can be null. */ private BIConversion getRefererCustomization() { BindInfo info = builder.getBindInfo(getReferer()); BIProperty prop = info.get(BIProperty.class); if(prop==null) return null; return prop.getConv(); }
Example #28
Source File: ColorBinder.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
protected final void createSimpleTypeProperty(XSSimpleType type,String propName) { BIProperty prop = BIProperty.getCustomization(type); SimpleTypeBuilder stb = Ring.get(SimpleTypeBuilder.class); // since we are building the simple type here, use buildDef CPropertyInfo p = prop.createValueProperty(propName,false,type,stb.buildDef(type),BGMBuilder.getName(type)); getCurrentBean().addProperty(p); }
Example #29
Source File: BindPurple.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
/** * Attribute use always becomes a property. */ public void attributeUse(XSAttributeUse use) { boolean hasFixedValue = use.getFixedValue()!=null; BIProperty pc = BIProperty.getCustomization(use); // map to a constant property ? boolean toConstant = pc.isConstantProperty() && hasFixedValue; TypeUse attType = bindAttDecl(use.getDecl()); CPropertyInfo prop = pc.createAttributeProperty( use, attType ); if(toConstant) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); prop.realization = builder.fieldRendererFactory.getConst(prop.realization); } else if(!attType.isCollection() && (prop.baseType == null ? true : !prop.baseType.isPrimitive())) { // don't support a collection default value. That's difficult to do. // primitive types default value is problematic too - we can't check whether it has been set or no ( ==null) isn't possible TODO: emit a waring in these cases if(use.getDefaultValue()!=null) { // this attribute use has a default value. // the item type is guaranteed to be a leaf type... or TODO: is it really so? // don't support default values if it's a list prop.defaultValue = CDefaultValue.create(attType,use.getDefaultValue()); } else if(use.getFixedValue()!=null) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); } } else if(prop.baseType != null && prop.baseType.isPrimitive()) { ErrorReporter errorReporter = Ring.get(ErrorReporter.class); errorReporter.warning(prop.getLocator(), Messages.WARN_DEFAULT_VALUE_PRIMITIVE_TYPE, prop.baseType.name()); } getCurrentBean().addProperty(prop); }
Example #30
Source File: BindPurple.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
/** * Attribute use always becomes a property. */ public void attributeUse(XSAttributeUse use) { boolean hasFixedValue = use.getFixedValue()!=null; BIProperty pc = BIProperty.getCustomization(use); // map to a constant property ? boolean toConstant = pc.isConstantProperty() && hasFixedValue; TypeUse attType = bindAttDecl(use.getDecl()); CPropertyInfo prop = pc.createAttributeProperty( use, attType ); if(toConstant) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); prop.realization = builder.fieldRendererFactory.getConst(prop.realization); } else if(!attType.isCollection() && (prop.baseType == null ? true : !prop.baseType.isPrimitive())) { // don't support a collection default value. That's difficult to do. // primitive types default value is problematic too - we can't check whether it has been set or no ( ==null) isn't possible TODO: emit a waring in these cases if(use.getDefaultValue()!=null) { // this attribute use has a default value. // the item type is guaranteed to be a leaf type... or TODO: is it really so? // don't support default values if it's a list prop.defaultValue = CDefaultValue.create(attType,use.getDefaultValue()); } else if(use.getFixedValue()!=null) { prop.defaultValue = CDefaultValue.create(attType,use.getFixedValue()); } } else if(prop.baseType != null && prop.baseType.isPrimitive()) { ErrorReporter errorReporter = Ring.get(ErrorReporter.class); errorReporter.warning(prop.getLocator(), Messages.WARN_DEFAULT_VALUE_PRIMITIVE_TYPE, prop.baseType.name()); } getCurrentBean().addProperty(prop); }