|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.access.types.ExtendedTypeMap
public class ExtendedTypeMap
Stores ExtendedTypes, implementing an algorithm to determine the right type for a given
Java class. See getRegisteredType(String)
documentation for lookup algorith
details.
Field Summary | |
---|---|
protected DefaultType |
defaultType
|
protected Map |
typeMap
|
Constructor Summary | |
---|---|
ExtendedTypeMap()
Creates new ExtendedTypeMap, populating it with default JDBC-compatible types. |
Method Summary | |
---|---|
void |
addFactory(ExtendedTypeFactory factory)
Adds an ExtendedTypeFactory that will be consulted if no direct mapping for a given class exists. |
protected ExtendedType |
createType(String className)
Returns a default type for specific Java classes. |
ExtendedType |
getDefaultType()
Returns a default ExtendedType that is used to handle unmapped types. |
protected ExtendedType |
getDefaultType(String javaClassName)
Deprecated. since 3.0 - use createType(String) instead. |
Collection |
getFactories()
Returns ExtendedTypeFactories registered with this instance. |
ExtendedType |
getRegisteredType(Class javaClass)
Returns a type registered for the class name. |
ExtendedType |
getRegisteredType(String javaClassName)
Returns a guranteed non-null ExtendedType instance for a given Java class name. |
String[] |
getRegisteredTypeNames()
Returns array of Java class names supported by Cayenne for JDBC mapping. |
protected void |
initDefaultFactories()
Registers default factories for creating enum types and serializable types. |
protected void |
initDefaultTypes()
Registers default extended types. |
void |
registerType(ExtendedType type)
Adds a new type to the list of registered types. |
void |
removeFactory(ExtendedTypeFactory factory)
Removes a factory from the regsitered factories if it was previosly added. |
void |
unregisterType(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 |
---|
protected Map typeMap
protected DefaultType defaultType
Constructor Detail |
---|
public ExtendedTypeMap()
Method Detail |
---|
protected void initDefaultTypes()
protected void initDefaultFactories()
public Collection getFactories()
public void addFactory(ExtendedTypeFactory factory)
Note that the order in which factories are added is important, as factories are consulted in turn when an ExtendedType is looked up, and lookup is stopped when any factory provides a non-null type.
public void removeFactory(ExtendedTypeFactory factory)
public void registerType(ExtendedType type)
type
argument, the old
handler is overwriden by the new one.
public ExtendedType getDefaultType()
public ExtendedType getRegisteredType(String javaClassName)
ExtendedTypeFactory
instances registered by users. If a factory returns a
non-null type, it is returned to the user and the rest of the factories are
ignored. ExtendedTypeFactory
instances that can dynamically construct extended types for serializable objects
and JDK 1.5 enums.
public ExtendedType getRegisteredType(Class javaClass)
public void unregisterType(String javaClassName)
javaClassName
parameter.
public String[] getRegisteredTypeNames()
protected ExtendedType getDefaultType(String javaClassName)
createType(String)
instead.
protected ExtendedType createType(String className)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |