1 57 58 package com.sun.org.apache.xerces.internal.impl.xs; 59 60 import com.sun.org.apache.xerces.internal.impl.dv.XSSimpleType; 61 import com.sun.org.apache.xerces.internal.xs.*; 62 import com.sun.org.apache.xerces.internal.impl.dv.ValidatedInfo; 63 64 72 public class XSAttributeDecl implements XSAttributeDeclaration { 73 74 public final static short SCOPE_ABSENT = 0; 76 public final static short SCOPE_GLOBAL = 1; 77 public final static short SCOPE_LOCAL = 2; 78 79 String fName = null; 81 String fTargetNamespace = null; 83 XSSimpleType fType = null; 85 short fConstraintType = XSConstants.VC_NONE; 87 short fScope = XSConstants.SCOPE_ABSENT; 89 XSComplexTypeDecl fEnclosingCT = null; 91 XSAnnotationImpl fAnnotation = null; 93 ValidatedInfo fDefault = null; 95 96 public void setValues(String name, String targetNamespace, 97 XSSimpleType simpleType, short constraintType, short scope, 98 ValidatedInfo valInfo, XSComplexTypeDecl enclosingCT, 99 XSAnnotationImpl annotation) { 100 fName = name; 101 fTargetNamespace = targetNamespace; 102 fType = simpleType; 103 fConstraintType = constraintType; 104 fScope = scope; 105 fDefault = valInfo; 106 fEnclosingCT = enclosingCT; 107 fAnnotation = annotation; 108 } 109 110 public void reset(){ 111 fName = null; 112 fTargetNamespace = null; 113 fType = null; 114 fConstraintType = XSConstants.VC_NONE; 115 fScope = XSConstants.SCOPE_ABSENT; 116 fDefault = null; 117 fAnnotation = null; 118 } 119 120 123 public short getType() { 124 return XSConstants.ATTRIBUTE_DECLARATION; 125 } 126 127 131 public String getName() { 132 return fName; 133 } 134 135 140 public String getNamespace() { 141 return fTargetNamespace; 142 } 143 144 147 public XSSimpleTypeDefinition getTypeDefinition() { 148 return fType; 149 } 150 151 158 public short getScope() { 159 return fScope; 160 } 161 162 167 public XSComplexTypeDefinition getEnclosingCTDefinition() { 168 return fEnclosingCT; 169 } 170 171 174 public short getConstraintType() { 175 return fConstraintType; 176 } 177 178 182 public String getConstraintValue() { 183 return getConstraintType() == XSConstants.VC_NONE ? 185 null : 186 fDefault.stringValue(); 187 } 188 189 192 public XSAnnotation getAnnotation() { 193 return fAnnotation; 194 } 195 196 public ValidatedInfo getValInfo() { 197 return fDefault; 198 } 199 202 public XSNamespaceItem getNamespaceItem() { 203 return null; 205 } 206 207 public Object getActualVC() { 208 return fDefault.actualValue; 209 } 210 211 public short getActualVCType() { 212 return fDefault.actualValueType; 213 } 214 215 public ShortList getItemValueTypes() { 216 return fDefault.itemValueTypes; 217 } 218 219 } | Popular Tags |