Java Code Examples for com.sun.xml.internal.xsom.XSAttributeUse#getFixedValue()
The following examples show how to use
com.sun.xml.internal.xsom.XSAttributeUse#getFixedValue() .
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: SchemaWriter.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public void attributeUse( XSAttributeUse use ) { XSAttributeDecl decl = use.getDecl(); String additionalAtts=""; if(use.isRequired()) additionalAtts += " use=\"required\""; if(use.getFixedValue()!=null && use.getDecl().getFixedValue()==null) additionalAtts += " fixed=\""+use.getFixedValue()+'\"'; if(use.getDefaultValue()!=null && use.getDecl().getDefaultValue()==null) additionalAtts += " default=\""+use.getDefaultValue()+'\"'; if(decl.isLocal()) { // this is anonymous attribute use dump(decl,additionalAtts); } else { // reference to a global one println(MessageFormat.format("<attribute ref=\"'{'{0}'}'{1}{2}\"/>", decl.getTargetNamespace(), decl.getName(), additionalAtts)); } }
Example 2
Source File: BIProperty.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public CAttributePropertyInfo createAttributeProperty( XSAttributeUse use, TypeUse tu ) { boolean forConstant = getCustomization(use).isConstantProperty() && use.getFixedValue()!=null; String name = getPropertyName(forConstant); if(name==null) { NameConverter conv = getBuilder().getNameConverter(); if(forConstant) name = conv.toConstantName(use.getDecl().getName()); else name = conv.toPropertyName(use.getDecl().getName()); if(tu.isCollection() && getBuilder().getGlobalBinding().isSimpleMode()) name = JJavaName.getPluralForm(name); } markAsAcknowledged(); constantPropertyErrorCheck(); return wrapUp(new CAttributePropertyInfo(name,use,getCustomizations(use),use.getLocator(), BGMBuilder.getName(use.getDecl()), tu, BGMBuilder.getName(use.getDecl().getType()), use.isRequired() ),use); }
Example 3
Source File: BIProperty.java From hottub with GNU General Public License v2.0 | 6 votes |
public CAttributePropertyInfo createAttributeProperty( XSAttributeUse use, TypeUse tu ) { boolean forConstant = getCustomization(use).isConstantProperty() && use.getFixedValue()!=null; String name = getPropertyName(forConstant); if(name==null) { NameConverter conv = getBuilder().getNameConverter(); if(forConstant) name = conv.toConstantName(use.getDecl().getName()); else name = conv.toPropertyName(use.getDecl().getName()); if(tu.isCollection() && getBuilder().getGlobalBinding().isSimpleMode()) name = JJavaName.getPluralForm(name); } markAsAcknowledged(); constantPropertyErrorCheck(); return wrapUp(new CAttributePropertyInfo(name,use,getCustomizations(use),use.getLocator(), BGMBuilder.getName(use.getDecl()), tu, BGMBuilder.getName(use.getDecl().getType()), use.isRequired() ),use); }
Example 4
Source File: SchemaWriter.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public void attributeUse( XSAttributeUse use ) { XSAttributeDecl decl = use.getDecl(); String additionalAtts=""; if(use.isRequired()) additionalAtts += " use=\"required\""; if(use.getFixedValue()!=null && use.getDecl().getFixedValue()==null) additionalAtts += " fixed=\""+use.getFixedValue()+'\"'; if(use.getDefaultValue()!=null && use.getDecl().getDefaultValue()==null) additionalAtts += " default=\""+use.getDefaultValue()+'\"'; if(decl.isLocal()) { // this is anonymous attribute use dump(decl,additionalAtts); } else { // reference to a global one println(MessageFormat.format("<attribute ref=\"'{'{0}'}'{1}{2}\"/>", decl.getTargetNamespace(), decl.getName(), additionalAtts)); } }
Example 5
Source File: SchemaWriter.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public void attributeUse( XSAttributeUse use ) { XSAttributeDecl decl = use.getDecl(); String additionalAtts=""; if(use.isRequired()) additionalAtts += " use=\"required\""; if(use.getFixedValue()!=null && use.getDecl().getFixedValue()==null) additionalAtts += " fixed=\""+use.getFixedValue()+'\"'; if(use.getDefaultValue()!=null && use.getDecl().getDefaultValue()==null) additionalAtts += " default=\""+use.getDefaultValue()+'\"'; if(decl.isLocal()) { // this is anonymous attribute use dump(decl,additionalAtts); } else { // reference to a global one println(MessageFormat.format("<attribute ref=\"'{'{0}'}'{1}{2}\"/>", decl.getTargetNamespace(), decl.getName(), additionalAtts)); } }
Example 6
Source File: BIProperty.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public CAttributePropertyInfo createAttributeProperty( XSAttributeUse use, TypeUse tu ) { boolean forConstant = getCustomization(use).isConstantProperty() && use.getFixedValue()!=null; String name = getPropertyName(forConstant); if(name==null) { NameConverter conv = getBuilder().getNameConverter(); if(forConstant) name = conv.toConstantName(use.getDecl().getName()); else name = conv.toPropertyName(use.getDecl().getName()); if(tu.isCollection() && getBuilder().getGlobalBinding().isSimpleMode()) name = JJavaName.getPluralForm(name); } markAsAcknowledged(); constantPropertyErrorCheck(); return wrapUp(new CAttributePropertyInfo(name,use,getCustomizations(use),use.getLocator(), BGMBuilder.getName(use.getDecl()), tu, BGMBuilder.getName(use.getDecl().getType()), use.isRequired() ),use); }
Example 7
Source File: BIProperty.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public CAttributePropertyInfo createAttributeProperty( XSAttributeUse use, TypeUse tu ) { boolean forConstant = getCustomization(use).isConstantProperty() && use.getFixedValue()!=null; String name = getPropertyName(forConstant); if(name==null) { NameConverter conv = getBuilder().getNameConverter(); if(forConstant) name = conv.toConstantName(use.getDecl().getName()); else name = conv.toPropertyName(use.getDecl().getName()); if(tu.isCollection() && getBuilder().getGlobalBinding().isSimpleMode()) name = JJavaName.getPluralForm(name); } markAsAcknowledged(); constantPropertyErrorCheck(); return wrapUp(new CAttributePropertyInfo(name,use,getCustomizations(use),use.getLocator(), BGMBuilder.getName(use.getDecl()), tu, BGMBuilder.getName(use.getDecl().getType()), use.isRequired() ),use); }
Example 8
Source File: SchemaWriter.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public void attributeUse( XSAttributeUse use ) { XSAttributeDecl decl = use.getDecl(); String additionalAtts=""; if(use.isRequired()) additionalAtts += " use=\"required\""; if(use.getFixedValue()!=null && use.getDecl().getFixedValue()==null) additionalAtts += " fixed=\""+use.getFixedValue()+'\"'; if(use.getDefaultValue()!=null && use.getDecl().getDefaultValue()==null) additionalAtts += " default=\""+use.getDefaultValue()+'\"'; if(decl.isLocal()) { // this is anonymous attribute use dump(decl,additionalAtts); } else { // reference to a global one println(MessageFormat.format("<attribute ref=\"'{'{0}'}'{1}{2}\"/>", decl.getTargetNamespace(), decl.getName(), additionalAtts)); } }
Example 9
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 10
Source File: SchemaTreeTraverser.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
public void attributeUse(XSAttributeUse use) { XSAttributeDecl decl = use.getDecl(); String additionalAtts = ""; if (use.isRequired()) { additionalAtts += " use=\"required\""; } if (use.getFixedValue() != null && use.getDecl().getFixedValue() == null) { additionalAtts += " fixed=\"" + use.getFixedValue() + "\""; } if (use.getDefaultValue() != null && use.getDecl().getDefaultValue() == null) { additionalAtts += " default=\"" + use.getDefaultValue() + "\""; } if (decl.isLocal()) { // this is anonymous attribute use dump(decl, additionalAtts); } else { // reference to a global one String str = MessageFormat.format( "Attribute ref \"'{'{0}'}'{1}{2}\"", new Object[]{ decl.getTargetNamespace(), decl.getName(), additionalAtts}); SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator()); this.currNode.add(newNode); } }
Example 11
Source File: SchemaTreeTraverser.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
public void attributeUse(XSAttributeUse use) { XSAttributeDecl decl = use.getDecl(); String additionalAtts = ""; if (use.isRequired()) { additionalAtts += " use=\"required\""; } if (use.getFixedValue() != null && use.getDecl().getFixedValue() == null) { additionalAtts += " fixed=\"" + use.getFixedValue() + "\""; } if (use.getDefaultValue() != null && use.getDecl().getDefaultValue() == null) { additionalAtts += " default=\"" + use.getDefaultValue() + "\""; } if (decl.isLocal()) { // this is anonymous attribute use dump(decl, additionalAtts); } else { // reference to a global one String str = MessageFormat.format( "Attribute ref \"'{'{0}'}'{1}{2}\"", new Object[]{ decl.getTargetNamespace(), decl.getName(), additionalAtts}); SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator()); this.currNode.add(newNode); } }
Example 12
Source File: SchemaTreeTraverser.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public void attributeUse(XSAttributeUse use) { XSAttributeDecl decl = use.getDecl(); String additionalAtts = ""; if (use.isRequired()) { additionalAtts += " use=\"required\""; } if (use.getFixedValue() != null && use.getDecl().getFixedValue() == null) { additionalAtts += " fixed=\"" + use.getFixedValue() + "\""; } if (use.getDefaultValue() != null && use.getDecl().getDefaultValue() == null) { additionalAtts += " default=\"" + use.getDefaultValue() + "\""; } if (decl.isLocal()) { // this is anonymous attribute use dump(decl, additionalAtts); } else { // reference to a global one String str = MessageFormat.format( "Attribute ref \"'{'{0}'}'{1}{2}\"", new Object[]{ decl.getTargetNamespace(), decl.getName(), additionalAtts}); SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator()); this.currNode.add(newNode); } }
Example 13
Source File: SchemaTreeTraverser.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public void attributeUse(XSAttributeUse use) { XSAttributeDecl decl = use.getDecl(); String additionalAtts = ""; if (use.isRequired()) { additionalAtts += " use=\"required\""; } if (use.getFixedValue() != null && use.getDecl().getFixedValue() == null) { additionalAtts += " fixed=\"" + use.getFixedValue() + "\""; } if (use.getDefaultValue() != null && use.getDecl().getDefaultValue() == null) { additionalAtts += " default=\"" + use.getDefaultValue() + "\""; } if (decl.isLocal()) { // this is anonymous attribute use dump(decl, additionalAtts); } else { // reference to a global one String str = MessageFormat.format( "Attribute ref \"'{'{0}'}'{1}{2}\"", new Object[]{ decl.getTargetNamespace(), decl.getName(), additionalAtts}); SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator()); this.currNode.add(newNode); } }
Example 14
Source File: SchemaTreeTraverser.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
public void attributeUse(XSAttributeUse use) { XSAttributeDecl decl = use.getDecl(); String additionalAtts = ""; if (use.isRequired()) { additionalAtts += " use=\"required\""; } if (use.getFixedValue() != null && use.getDecl().getFixedValue() == null) { additionalAtts += " fixed=\"" + use.getFixedValue() + "\""; } if (use.getDefaultValue() != null && use.getDecl().getDefaultValue() == null) { additionalAtts += " default=\"" + use.getDefaultValue() + "\""; } if (decl.isLocal()) { // this is anonymous attribute use dump(decl, additionalAtts); } else { // reference to a global one String str = MessageFormat.format( "Attribute ref \"'{'{0}'}'{1}{2}\"", new Object[]{ decl.getTargetNamespace(), decl.getName(), additionalAtts}); SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator()); this.currNode.add(newNode); } }
Example 15
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 16
Source File: SchemaTreeTraverser.java From hottub with GNU General Public License v2.0 | 5 votes |
public void attributeUse(XSAttributeUse use) { XSAttributeDecl decl = use.getDecl(); String additionalAtts = ""; if (use.isRequired()) { additionalAtts += " use=\"required\""; } if (use.getFixedValue() != null && use.getDecl().getFixedValue() == null) { additionalAtts += " fixed=\"" + use.getFixedValue() + "\""; } if (use.getDefaultValue() != null && use.getDecl().getDefaultValue() == null) { additionalAtts += " default=\"" + use.getDefaultValue() + "\""; } if (decl.isLocal()) { // this is anonymous attribute use dump(decl, additionalAtts); } else { // reference to a global one String str = MessageFormat.format( "Attribute ref \"'{'{0}'}'{1}{2}\"", new Object[]{ decl.getTargetNamespace(), decl.getName(), additionalAtts}); SchemaTreeNode newNode = new SchemaTreeNode(str, decl.getLocator()); this.currNode.add(newNode); } }
Example 17
Source File: BIProperty.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
public Boolean attributeUse(XSAttributeUse use) { return use.getFixedValue()!=null; }
Example 18
Source File: BIProperty.java From hottub with GNU General Public License v2.0 | 4 votes |
public Boolean attributeUse(XSAttributeUse use) { return use.getFixedValue()!=null; }
Example 19
Source File: BIProperty.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
public Boolean attributeUse(XSAttributeUse use) { return use.getFixedValue()!=null; }
Example 20
Source File: BIProperty.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
public Boolean attributeUse(XSAttributeUse use) { return use.getFixedValue()!=null; }