org.apache.jdo.impl.model.jdo.util
Class TypeSupport

java.lang.Object
  extended byorg.apache.jdo.impl.model.jdo.util.TypeSupport

public class TypeSupport
extends java.lang.Object


Field Summary
private static java.util.Set primitiveTypeNames
           
 
Constructor Summary
TypeSupport()
           
 
Method Summary
static boolean isEmbeddedElementType(JavaType type)
          Returns true if the embedded-element property of a field having the specified type defaults to true.
static boolean isEmbeddedFieldType(JavaType type)
          Returns true if the embedded property of a field having the specified type defaults to true.
private static boolean isPersistenceArrayType(JavaType type)
          Returns true if the specified type represents an array and its element type is a persistence capable class.
static boolean isPersistenceFieldType(JavaType type)
          Returns true if the persistence-modifier of a field having the specified type defaults to true.
static boolean isValueArrayType(JavaType type)
          Returns true if the specified type represents an array and its element type is a value type.
static JavaType resolveType(JDOModel jdoModel, java.lang.String typeName, java.lang.String packagePrefix)
          Returns a JavaType representation for the specified type name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

primitiveTypeNames

private static java.util.Set primitiveTypeNames
Constructor Detail

TypeSupport

public TypeSupport()
Method Detail

isPersistenceFieldType

public static boolean isPersistenceFieldType(JavaType type)
Returns true if the persistence-modifier of a field having the specified type defaults to true.

Parameters:
type - the type to be checked
Returns:
true if type is a value type; false otherwise

isEmbeddedElementType

public static boolean isEmbeddedElementType(JavaType type)
Returns true if the embedded-element property of a field having the specified type defaults to true.

Parameters:
type - the type to be checked
Returns:
true if type is a embedded-element type; false otherwise

isEmbeddedFieldType

public static boolean isEmbeddedFieldType(JavaType type)
Returns true if the embedded property of a field having the specified type defaults to true.

Parameters:
type - the type to be checked
Returns:
true if type is a embedded type; false otherwise

resolveType

public static JavaType resolveType(JDOModel jdoModel,
                                   java.lang.String typeName,
                                   java.lang.String packagePrefix)
Returns a JavaType representation for the specified type name. The method delegates the request to the JavaModel attached to the specified JDOModel. An unqualified name is qualified using first the specified packagePrefix and then "java.lang.", but only if the type name is the the name of a primitive type. If the method still does not find a valid type, then it returns null.

Parameters:
jdoModel - the owning JDOModel
typeName - the name of the type to be checked
packagePrefix - the package prefix used to qualify the type name
Returns:
the JavaType representation of the specified type name or null if it cannot be resolved.

isValueArrayType

public static boolean isValueArrayType(JavaType type)
Returns true if the specified type represents an array and its element type is a value type.

Parameters:
type - the JavaType to be checked
Returns:
true if type is a value array; false otherwise.

isPersistenceArrayType

private static boolean isPersistenceArrayType(JavaType type)
Returns true if the specified type represents an array and its element type is a persistence capable class.

Parameters:
type - the JavaType to be checked
Returns:
true if type is a persistent array; false otherwise.