Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.objectstyle.cayenne.access.types
Class ExtendedTypeMap  view ExtendedTypeMap download ExtendedTypeMap.java

java.lang.Object
  extended byorg.objectstyle.cayenne.access.types.ExtendedTypeMap

public class ExtendedTypeMap
extends java.lang.Object

Contains a map of ExtendedType objects, that serve as handlers for converting values between Java application and JDBC layer.

Class uses singleton model, since mapping is usually shared within the application.


Field Summary
protected  DefaultType defaultType
           
protected  java.util.Map typeMap
           
 
Constructor Summary
ExtendedTypeMap()
           
 
Method Summary
 ExtendedType getDefaultType()
           
 ExtendedType getRegisteredType(java.lang.Class javaClass)
          Returns a type registered for the class name.
 ExtendedType getRegisteredType(java.lang.String javaClassName)
          Returns a type registered for the class name.
 java.lang.String[] getRegisteredTypeNames()
          Returns array of Java class names supported by Cayenne for JDBC mapping.
protected  void initDefaultTypes()
          Registers default extended types.
 void registerType(ExtendedType type)
          Adds new type to the list of registered types.
 void unregisterType(java.lang.String javaClassName)
          Removes registered ExtendedType object corresponding to javaClassName parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

typeMap

protected java.util.Map typeMap

defaultType

protected DefaultType defaultType
Constructor Detail

ExtendedTypeMap

public ExtendedTypeMap()
Method Detail

initDefaultTypes

protected void initDefaultTypes()
Registers default extended types. This method is called from constructor and exists mainly for the benefit of subclasses that can override it and configure their own extended types.


registerType

public void registerType(ExtendedType type)
Adds new type to the list of registered types.


getDefaultType

public ExtendedType getDefaultType()

getRegisteredType

public ExtendedType getRegisteredType(java.lang.String javaClassName)
Returns a type registered for the class name. If no such type exists, returns the default type. It is guaranteed that this method returns a non-null ExtendedType instance. Note that for array types class name must be in the form 'MyClass[]'.


getRegisteredType

public ExtendedType getRegisteredType(java.lang.Class javaClass)
Returns a type registered for the class name. If no such type exists, returns the default type. It is guaranteed that this method returns a non-null ExtendedType instance.


unregisterType

public void unregisterType(java.lang.String javaClassName)
Removes registered ExtendedType object corresponding to javaClassName parameter.


getRegisteredTypeNames

public java.lang.String[] getRegisteredTypeNames()
Returns array of Java class names supported by Cayenne for JDBC mapping.