de.hedenus.xmltypes.impl
Class AbstractTypeImpl

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

public abstract class AbstractTypeImpl
extends java.lang.Object
implements Type

Basic Type implementation.

Author:
Michael Hedenus

Field Summary
protected  Type[] baseTypes
           
protected  java.lang.String name
           
protected  TypeFactoryImpl typeFactory
           
 
Constructor Summary
protected AbstractTypeImpl(TypeFactoryImpl typeFactory, java.lang.String name, Type[] baseTypes)
           
 
Method Summary
protected  void checkNull(java.lang.Object val)
           
 Type[] getBaseTypes()
          Returns the base types of the type.
 java.lang.String getName()
          Returns the name of the type according to the type system, for example "http://www.w3.org/2001/XMLSchema#string".
 java.lang.String toLiteral(java.lang.Object value)
          Returns a lexical representation (literal) of a value.
 java.lang.String toString()
          Returns a string representation of the type, for example "http://www.w3.org/2001/XMLSchema#string"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface de.hedenus.xmltypes.Type
getRepresentationClass, getTypeSystem, isAbstract, isPrimitive, parse, validate
 

Field Detail

typeFactory

protected final TypeFactoryImpl typeFactory

name

protected final java.lang.String name

baseTypes

protected final Type[] baseTypes
Constructor Detail

AbstractTypeImpl

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

getName

public java.lang.String getName()
Description copied from interface: Type
Returns the name of the type according to the type system, for example "http://www.w3.org/2001/XMLSchema#string".

Specified by:
getName in interface Type

toString

public java.lang.String toString()
Description copied from interface: Type
Returns a string representation of the type, for example "http://www.w3.org/2001/XMLSchema#string"

Specified by:
toString in interface Type
Overrides:
toString in class java.lang.Object

getBaseTypes

public Type[] getBaseTypes()
Description copied from interface: Type
Returns the base types of the type.

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
Throws:
TypeException

checkNull

protected void checkNull(java.lang.Object val)