1 package net.sf.saxon.type; 2 3 import net.sf.saxon.expr.Expression; 4 import net.sf.saxon.expr.StaticContext; 5 import net.sf.saxon.expr.StaticProperty; 6 import net.sf.saxon.om.NodeInfo; 7 import net.sf.saxon.om.SequenceIterator; 8 import net.sf.saxon.om.SingletonIterator; 9 import net.sf.saxon.style.StandardNames; 10 import net.sf.saxon.value.UntypedAtomicValue; 11 import net.sf.saxon.value.Value; 12 13 import java.io.Serializable ; 14 15 19 20 public final class AnyType implements ComplexType, Serializable { 21 22 private static AnyType theInstance = new AnyType(); 23 24 27 private AnyType() { 28 super(); 29 } 30 31 35 36 public static AnyType getInstance() { 37 return theInstance; 38 } 39 40 43 public int getValidationStatus() { 44 return VALIDATED; 45 } 46 47 51 52 public SchemaType getBaseType() { 53 return null; 54 } 55 56 64 65 public SchemaType getKnownBaseType() throws IllegalStateException { 66 return null; 67 } 68 69 76 77 public int getDerivationMethod() { 78 return 0; 79 } 80 81 88 89 public boolean allowsDerivation(int derivation) { 90 return true; 91 } 92 93 97 98 public boolean isAbstract() { 99 return false; 100 } 101 102 107 108 public boolean isComplexType() { 109 return true; 110 } 111 112 116 117 public boolean isSimpleType() { 118 return false; 119 } 120 121 127 128 public int getBlock() { 129 return 0; 130 } 131 132 136 public boolean isComplexContent() { 137 return true; 138 } 139 140 144 145 public boolean isSimpleContent() { 146 return false; 147 } 148 149 154 155 public boolean isAllContent() { 156 return false; 157 } 158 159 164 165 public SimpleType getSimpleContentType() { 166 return null; 167 } 168 169 173 public boolean isRestricted() { 174 return false; 175 } 176 177 181 182 public boolean isEmptyContent() { 183 return false; 184 } 185 186 190 191 public boolean isEmptiable() { 192 return true; 193 } 194 195 199 200 public boolean isMixedContent() { 201 return true; 202 } 203 204 208 209 public int getFingerprint() { 210 return StandardNames.XS_ANY_TYPE; 211 } 212 213 218 219 public int getNameCode() { 220 return StandardNames.XS_ANY_TYPE; 221 } 222 223 227 228 public String getDescription() { 229 return "xs:anyType"; 230 } 231 232 237 238 public String getDisplayName() { 239 return "xs:anyType"; 240 } 241 242 247 248 public boolean isSameType(SchemaType other) { 249 return (other instanceof AnyType); 250 } 251 252 262 263 public void analyzeContentExpression(Expression expression, int kind, StaticContext env) { 264 return; 265 } 266 267 273 274 public SequenceIterator getTypedValue(NodeInfo node) { 275 return SingletonIterator.makeIterator(new UntypedAtomicValue(node.getStringValue())); 276 } 277 278 287 288 public Value atomize(NodeInfo node) { 289 return new UntypedAtomicValue(node.getStringValue()); 290 } 291 292 299 300 public String subsumes(ComplexType sub) { 301 return null; 302 } 303 304 312 313 public void isTypeDerivationOK(SchemaType type, int block) throws SchemaException { 314 throw new SchemaException("Cannot derive xs:anyType from another type"); 315 } 316 317 326 327 public SchemaType getElementParticleType(int fingerprint) { 328 return this; 329 } 330 331 341 342 public int getElementParticleCardinality(int fingerprint) { 343 return StaticProperty.ALLOWS_ZERO_OR_MORE; 344 } 345 346 355 356 public SchemaType getAttributeUseType(int fingerprint) { 357 return AnySimpleType.getInstance(); 358 } 359 } 360 361 362 | Popular Tags |