1 22 23 package org.xquark.schema.datatypes; 24 25 import org.xquark.schema.SchemaException; 26 import org.xquark.schema.validation.ValidationContextProvider; 27 28 29 class StringType extends MesureableType { 30 private static final String RCSRevision = "$Revision: 1.2 $"; 31 private static final String RCSName = "$Name: $"; 32 33 StringType() { 34 super("string", PrimitiveType.STRING); 35 nWhiteSpace = PrimitiveType.PRESERVE; 37 fixedBitSet = 0; 38 } 39 40 protected Object toValidType(Object data) { 41 return (String ) data; 42 } 43 44 public void checkFacets(Object valueSpace) throws SchemaException { 45 super.checkFacets(valueSpace); 46 super.checkLength(((String ) valueSpace).length(), valueSpace); 47 } 48 49 protected Object toValueSpace(String value, ValidationContextProvider context) throws SchemaException { 50 return value.toString(); 51 } 52 53 } 54 | Popular Tags |