de.hedenus.xmltypes.impl
Class AbstractTypeImpl
java.lang.Object
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
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 |
typeFactory
protected final TypeFactoryImpl typeFactory
name
protected final java.lang.String name
baseTypes
protected final Type[] baseTypes
AbstractTypeImpl
protected AbstractTypeImpl(TypeFactoryImpl typeFactory,
java.lang.String name,
Type[] baseTypes)
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.
- If the type is a union type the constituent types are returned.
- If the type is a constrained type the unconstrained type is returned.
- If the type is a unconstrained type the base types in the type hierarchy are returned.
- If the type is a root of the type hierarchy,
null
is returned.
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)