1 22 23 package org.xquark.schema.datatypes; 24 25 import java.text.ParseException ; 26 27 import org.xquark.schema.SchemaException; 28 29 30 class DurationType extends ComparableType { 31 private static final String RCSRevision = "$Revision: 1.2 $"; 32 private static final String RCSName = "$Name: $"; 33 34 DurationType() { 35 super("duration", PrimitiveType.DURATION); 36 } 37 38 protected Object toValidType(Object data) { 39 return (Duration) data; 40 } 41 42 protected Comparable toComparable(String value) throws SchemaException { 43 try { 44 return new Duration(value); 45 } catch (ParseException ex) { 46 super.invalidValue(value); 47 return null; 48 } 49 } 50 51 } 52 | Popular Tags |