org.jpox
Class TypeManager

java.lang.Object
  extended by org.jpox.TypeManager

public class TypeManager
extends java.lang.Object

Registry of type support within JPOX. The plugin mechanism provides the registration of supported types, so that users can register support for their own types and these are loaded when the TypeManager is constructed.

Version:
$Revision: 1.49 $

Field Summary
protected  ApiAdapter api
           
protected  ClassLoaderResolver clr
           
 
Constructor Summary
TypeManager(ApiAdapter api, PluginManager mgr, ClassLoaderResolver clr)
          Constructor, loading JPOX's support for type mappings using the plugin mechanism.
 
Method Summary
protected  org.jpox.TypeManager.JPOXType findJPOXTypeForClass(java.lang.Class cls)
           
 FieldPersistenceModifier getDefaultFieldPersistenceModifier(java.lang.Class c, int modifier, boolean isPCclass)
          Accessor for the default "persistence-modifier" for a field given the class, its modifier and whether it is a PersistentCapable class.
 java.lang.Class getMappingType(java.lang.String className)
          Accessor for the Java Mapping type class for the supplied class.
 java.lang.Class getSecondClassWrapper(java.lang.String className)
          Accessor for the Second Class Wrapper class for the supplied class.
 java.lang.Class getSecondClassWrapperSimple(java.lang.String className)
          Accessor for the SCO "simple" wrapper class for the supplied class.
 java.util.Set getSupportedTypes()
          Accessor for the Supported Types.
protected  org.jpox.TypeManager.JPOXType getType(java.lang.String className)
          Utility class to retrieve a supported type
 boolean isDefaultEmbeddedType(java.lang.Class c)
          Utility to return whether a type defaults to embedded or not.
 boolean isDefaultFetchGroup(java.lang.Class c)
          Accessor for whether the class is by default in the default fetch group.
 boolean isReferenceType(java.lang.Class cls)
          Convenience method returning whether the passed type is a reference type.
 boolean isSCOList(java.lang.Class c)
          Accessor for whether the type is a List type that uses a SCOList wrapper type.
 boolean isSCOMap(java.lang.Class c)
          Accessor for whether the type is a Map type that uses a SCOMap wrapper type.
 boolean isSecondClassMutableType(java.lang.String class_name)
          Accessor for whether a class is a supported second class mutable type
 boolean isSecondClassWrapper(java.lang.String className)
          Accessor for whether a class is a Second Class Wrapper type.
 boolean isSupportedType(java.lang.String className)
          Accessor for whether a class is supported.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

clr

protected final ClassLoaderResolver clr

api

protected final ApiAdapter api
Constructor Detail

TypeManager

public TypeManager(ApiAdapter api,
                   PluginManager mgr,
                   ClassLoaderResolver clr)
Constructor, loading JPOX's support for type mappings using the plugin mechanism.

Parameters:
api - The API in use
clr - the ClassLoader Resolver
mgr - the PluginManager
Method Detail

isReferenceType

public boolean isReferenceType(java.lang.Class cls)
Convenience method returning whether the passed type is a reference type. This typically means whether it is an interface or java.lang.Object.

Parameters:
cls - The class
Returns:
Whether it is a reference type

isSupportedType

public boolean isSupportedType(java.lang.String className)
Accessor for whether a class is supported.

Parameters:
className - The class name
Returns:
Whether the class is supported (to some degree)

getSupportedTypes

public java.util.Set getSupportedTypes()
Accessor for the Supported Types.

Returns:
Set of supported types (containing the fully qualified class names (String)).

isSecondClassMutableType

public boolean isSecondClassMutableType(java.lang.String class_name)
Accessor for whether a class is a supported second class mutable type

Parameters:
class_name - The class name
Returns:
Whether it is a second class mutable type

isSCOList

public boolean isSCOList(java.lang.Class c)
Accessor for whether the type is a List type that uses a SCOList wrapper type.

Parameters:
c - The class
Returns:
if c is a List type

isSCOMap

public boolean isSCOMap(java.lang.Class c)
Accessor for whether the type is a Map type that uses a SCOMap wrapper type.

Parameters:
c - The class
Returns:
true if c is a Map type

getMappingType

public java.lang.Class getMappingType(java.lang.String className)
Accessor for the Java Mapping type class for the supplied class.

Parameters:
className - The class name
Returns:
The Java mapping type

getSecondClassWrapper

public java.lang.Class getSecondClassWrapper(java.lang.String className)
Accessor for the Second Class Wrapper class for the supplied class. A type will have a SCO wrapper if it is SCO supported and is mutable.

Parameters:
className - The class name
Returns:
The second class wrapper

getSecondClassWrapperSimple

public java.lang.Class getSecondClassWrapperSimple(java.lang.String className)
Accessor for the SCO "simple" wrapper class for the supplied class. A type will have a SCO wrapper if it is SCO supported and is mutable. The "simple" wrapper provides simple wrapping of operations and dirty detection only.

Parameters:
className - The class name
Returns:
The second class wrapper

isSecondClassWrapper

public boolean isSecondClassWrapper(java.lang.String className)
Accessor for whether a class is a Second Class Wrapper type.

Parameters:
className - The name of the class
Returns:
Whether it is a second class wrapper type

getDefaultFieldPersistenceModifier

public final FieldPersistenceModifier getDefaultFieldPersistenceModifier(java.lang.Class c,
                                                                         int modifier,
                                                                         boolean isPCclass)
Accessor for the default "persistence-modifier" for a field given the class, its modifier and whether it is a PersistentCapable class.

Parameters:
c - The class
modifier - The modifiers for the field
isPCclass - Whether it is persistence capable.
Returns:
The default field PersistenceModifier.

isDefaultFetchGroup

public boolean isDefaultFetchGroup(java.lang.Class c)
Accessor for whether the class is by default in the default fetch group.

Parameters:
c - The class
Returns:
return true if is part of default fetch group by default

isDefaultEmbeddedType

public boolean isDefaultEmbeddedType(java.lang.Class c)
Utility to return whether a type defaults to embedded or not. See JDO 2 Section 18.14 <field> for definition. This only provides for the basic types, and ignores arrays/collections.

Parameters:
c - The type
Returns:
Whether it defaults to embedded or not.

getType

protected org.jpox.TypeManager.JPOXType getType(java.lang.String className)
Utility class to retrieve a supported type

Parameters:
className - The class name
Returns:
The internal type information for the class

findJPOXTypeForClass

protected org.jpox.TypeManager.JPOXType findJPOXTypeForClass(java.lang.Class cls)


Copyright © -2008 . All Rights Reserved.