de.hedenus.xmltypes.impl
Class UrType

java.lang.Object
  extended by de.hedenus.xmltypes.impl.AbstractTypeImpl
      extended by de.hedenus.xmltypes.impl.W3SchemaType
          extended by de.hedenus.xmltypes.impl.UrType
All Implemented Interfaces:
Type
Direct Known Subclasses:
AnySimpleType, AnyType

public abstract class UrType
extends W3SchemaType

Ur-type.

Author:
Michael Hedenus

Field Summary
 
Fields inherited from class de.hedenus.xmltypes.impl.AbstractTypeImpl
baseTypes, name, typeFactory
 
Constructor Summary
protected UrType(TypeFactoryImpl typeFactory, java.lang.String name, Type[] baseTypes)
           
 
Method Summary
 java.lang.Class getRepresentationClass()
          Returns the mapped Java type.
 boolean isAbstract()
          Returns true.
 boolean isPrimitive()
          Returns true.
 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 de.hedenus.xmltypes.impl.W3SchemaType
getTypeSystem
 
Methods inherited from class de.hedenus.xmltypes.impl.AbstractTypeImpl
checkNull, getBaseTypes, getName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UrType

protected UrType(TypeFactoryImpl typeFactory,
                 java.lang.String name,
                 Type[] baseTypes)
Method Detail

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.


isAbstract

public boolean isAbstract()
Returns true.


isPrimitive

public boolean isPrimitive()
Returns true.