de.hedenus.xmltypes.impl
Class DateType
java.lang.Object
de.hedenus.xmltypes.impl.AbstractTypeImpl
de.hedenus.xmltypes.impl.W3SchemaType
de.hedenus.xmltypes.impl.BuiltInPrimitiveType
de.hedenus.xmltypes.impl.DateType
- All Implemented Interfaces:
- Type
public class DateType
- extends BuiltInPrimitiveType
Date type.
- Author:
- Michael Hedenus
Method Summary |
java.lang.Class |
getRepresentationClass()
Returns the mapped Java type. |
java.lang.Object |
parse(java.lang.String literal)
Parses a lexical value. |
java.lang.String |
toLiteral(java.lang.Object value)
Returns a lexical representation (literal) of a value. |
boolean |
validate(java.lang.Object value)
Returns true iff the value is valid. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DateType
protected DateType(TypeFactoryImpl typeFactory)
parse
public java.lang.Object parse(java.lang.String literal)
throws TypeException
- Description copied from interface:
Type
- Parses a lexical value. Only the unconstrained base types may be used for parsing, i.e.
it is possible that the parsing is successful but the resulting object is not valid
according to the constraints of this particluar type.
For example let the type be http://www.w3.org/2001/XMLSchema#nonNegativeInteger and the value be -5 then
it is up to the implementation either to throw an exception (because the value is negative)
or to return the value and let the application check it using the validate() method.
The latter case would allow the user to be informed and to correct the value.
If the method is successful then the returned value should at least be valid according to
the unconstrained base type of this particalur type.
- Throws:
TypeException
toLiteral
public java.lang.String toLiteral(java.lang.Object value)
throws TypeException
- Description copied from interface:
Type
- Returns a lexical representation (literal) of a value.
This method assumes that the value is valid, so before
passing a value to this method it should be checked if it is really appropriate.
- Specified by:
toLiteral
in interface Type
- Overrides:
toLiteral
in class AbstractTypeImpl
- Throws:
TypeException
validate
public boolean validate(java.lang.Object value)
- Description copied from interface:
Type
- Returns true iff the value is valid.
getRepresentationClass
public java.lang.Class getRepresentationClass()
- Description copied from interface:
Type
- Returns the mapped Java type.