1 16 17 package org.apache.xerces.impl.xs; 18 19 import org.apache.xerces.impl.dv.ValidatedInfo; 20 import org.apache.xerces.xs.ShortList; 21 import org.apache.xerces.xs.XSAttributeDeclaration; 22 import org.apache.xerces.xs.XSAttributeUse; 23 import org.apache.xerces.xs.XSConstants; 24 import org.apache.xerces.xs.XSNamespaceItem; 25 26 35 public class XSAttributeUseImpl implements XSAttributeUse { 36 37 public XSAttributeDecl fAttrDecl = null; 39 public short fUse = SchemaSymbols.USE_OPTIONAL; 41 public short fConstraintType = XSConstants.VC_NONE; 43 public ValidatedInfo fDefault = null; 45 46 public void reset(){ 47 fDefault = null; 48 fAttrDecl = null; 49 fUse = SchemaSymbols.USE_OPTIONAL; 50 fConstraintType = XSConstants.VC_NONE; 51 } 52 53 56 public short getType() { 57 return XSConstants.ATTRIBUTE_USE; 58 } 59 60 64 public String getName() { 65 return null; 66 } 67 68 73 public String getNamespace() { 74 return null; 75 } 76 77 82 public boolean getRequired() { 83 return fUse == SchemaSymbols.USE_REQUIRED; 84 } 85 86 90 public XSAttributeDeclaration getAttrDeclaration() { 91 return fAttrDecl; 92 } 93 94 97 public short getConstraintType() { 98 return fConstraintType; 99 } 100 101 105 public String getConstraintValue() { 106 return getConstraintType() == XSConstants.VC_NONE ? 108 null : 109 ((fDefault != null && fDefault.actualValue != null) ? 110 fDefault.actualValue.toString() : null); 111 } 112 113 116 public XSNamespaceItem getNamespaceItem() { 117 return null; 118 } 119 120 public Object getActualVC() { 121 return getConstraintType() == XSConstants.VC_NONE ? 122 null : 123 fDefault.actualValue; 124 } 125 126 public short getActualVCType() { 127 return getConstraintType() == XSConstants.VC_NONE ? 128 XSConstants.UNAVAILABLE_DT : 129 fDefault.actualValueType; 130 } 131 132 public ShortList getItemValueTypes() { 133 return getConstraintType() == XSConstants.VC_NONE ? 134 null : 135 fDefault.itemValueTypes; 136 } 137 138 } | Popular Tags |