|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A JavaType instance represents a type as defined in the Java language. The interface defines interrogative methods to check whether a type is primitive, an interface or array, is a JDO supported collection or map, is a value or trackable class, is a persistence capable class, etc. Furthermore it defines methods to get detailed information about the type such as name, modifiers, superclass and the JDO meta data if this type represent a persistence capable class.
Different environments (runtime, enhancer, development) will have different JavaType implementations to provide answers to the various methods.
Method Summary | |
JavaType |
getArrayComponentType()
Returns the JavaType representing the component type of an array. |
JavaField |
getJavaField(java.lang.String name)
Returns a JavaField instance that reflects the field with the specified name of the class or interface represented by this JavaType instance. |
JDOClass |
getJDOClass()
Returns the JDOClass instance if this JavaType represents a persistence capable class. |
int |
getModifiers()
Returns the Java language modifiers for the field represented by this JavaType, as an integer. |
java.lang.String |
getName()
Returns the name of the type. |
JavaType |
getSuperclass()
Returns the JavaType representing the superclass of the entity represented by this JavaType. |
boolean |
isArray()
Determines if this JavaType object represents an array type. |
boolean |
isCompatibleWith(JavaType javaType)
Returns true if this JavaType is compatible with the specified JavaType. |
boolean |
isFloatingPoint()
Returns true if this JavaType represents a floating
point type. |
boolean |
isIntegral()
Returns true if this JavaType represents an integral
type. |
boolean |
isInterface()
Determines if this JavaType object represents an interface type. |
boolean |
isJDOSupportedCollection()
Returns true if this JavaType represents a JDO
supported collection type. |
boolean |
isJDOSupportedMap()
Returns true if this JavaType represents a JDO
supported map type. |
boolean |
isOrderable()
Returns true if this JavaType represents an orderable
type as specified in JDO. |
boolean |
isPersistenceCapable()
Returns true if this JavaType represents a persistence
capable class. |
boolean |
isPrimitive()
Returns true if this JavaType represents a primitive
type. |
boolean |
isTrackable()
Returns true if this JavaType represents a trackable
Java class. |
boolean |
isValue()
Returns true if this JavaType represents a type whose
values may be treated as values rather than references during
storing. |
boolean |
isWrapperClass()
Returns true if this JavaType represents a Java wrapper
class type. |
Method Detail |
public boolean isPrimitive()
true
if this JavaType represents a primitive
type.
There are eight primitive types: boolean
,
byte
, short
, int
,
long
, char
,
float
, double
.
true
if this JavaType represents a primitive
type; false
otherwise.public boolean isIntegral()
true
if this JavaType represents an integral
type.
There are five are integral types: byte
,
short
, int
, long
, and
char
.
true
if this JavaType represents an integral
type; false
otherwise.public boolean isFloatingPoint()
true
if this JavaType represents a floating
point type.
There are two are floating point types:
float
and double
.
true
if this JavaType represents a floating
point type; false
otherwise.public boolean isInterface()
true
if this object represents an interface type;
false
otherwise.public boolean isArray()
true
if this object represents an array type;
false
otherwise.public boolean isWrapperClass()
true
if this JavaType represents a Java wrapper
class type.
There are eight Java wrapper class types:
java.lang.Boolean
, java.lang.Byte
,
java.lang.Short
, java.lang.Integer
,
java.lang.Long
, java.lang.Character
,
java.lang.Float
, java.lang.Double
.
true
if this JavaType represents a Java wrapper
class type; false
otherwise.public boolean isJDOSupportedCollection()
true
if this JavaType represents a JDO
supported collection type. The JDO specification allows the
following collection interfaces and classes as types of persistent
fields (see section 6.4.3 Persistent fields):
java.util.Collection
, java.util.Set
,
java.util.List
java.util.HashSet
, java.util.TreeSet
java.util.ArrayList
, java.util.LinkedList
java.util.Vector
, java.util.Stack
true
if this JavaType represents a JDO
supported collection; false
otherwise.public boolean isJDOSupportedMap()
true
if this JavaType represents a JDO
supported map type. The JDO specification allows the
following map interfaces and classes as types of persistent
fields (see section 6.4.3 Persistent fields):
java.util.Map
java.util.HashMap
, java.util.TreeMap
java.util.Hashtable
, java.util.Properties
true
if this JavaType represents a JDO
supported map; false
otherwise.public boolean isTrackable()
true
if this JavaType represents a trackable
Java class. A JDO implementation may replace a persistent field of
a trackable type with an assignment compatible instance of its own
implementation of this type which notifies the owning FCO of any
change of this field.
The following types are trackable types:
java.util.Date
, java.sql.Date
,
java.sql.Time
, java.sql.Timestamp
java.util.BitSet
true
if this JavaType represents a trackable
Java class, false
otherwise.public boolean isValue()
true
if this JavaType represents a type whose
values may be treated as values rather than references during
storing. A value type is either a primitive type or a type a JDO
implementation may treat as SCO and the type is not one the
following types: array, JDO supported collection and JDO supported
map.
The following classes are value types:
java.lang.Number
, java.lang.String
java.util.Locale
java.math.BigDecimal
, java.math.BigInteger
java.util.Date
, java.sql.Date
,
java.sql.Time
, java.sql.Timestamp
java.util.BitSet
true
if this JavaType represents a value type;
false
otherwise.public boolean isOrderable()
true
if this JavaType represents an orderable
type as specified in JDO.
The following types are orderable:
boolean
java.lang.Boolean
java.lang.String
java.math.BigDecimal
, java.math.BigInteger
java.util.Date
, java.sql.Date
,
java.sql.Time
, java.sql.Timestamp
true
if this JavaType represents an orderable
type; false
otherwise.public boolean isPersistenceCapable() throws ModelFatalException
true
if this JavaType represents a persistence
capable class.
A ModelFatalException
indicates a
problem accessing the JDO meta data for this JavaType.
true
if this JavaType represents a persistence
capable class; false
otherwise.
ModelFatalException
- if there is a problem accessing the
JDO metadatapublic boolean isCompatibleWith(JavaType javaType)
javaType
- the type this JavaType is checked with.
true
if this is compatible with the specified
type; false
otherwise.public java.lang.String getName()
public int getModifiers()
public JavaType getSuperclass()
void
,
then null
is returned. If this object represents an
array class then the JavaType instance representing the Object class
is returned.
public JDOClass getJDOClass() throws ModelFatalException
null
,
if this JavaType does not represent a persistence capable class.
A ModelFatalException
indicates a
problem accessing the JDO meta data for this JavaType.
null
otherwise.
ModelFatalException
- if there is a problem accessing the
JDO metadatapublic JavaType getArrayComponentType()
null
.
null
otherwise.public JavaField getJavaField(java.lang.String name)
null
, if the
class or interface (or one of its superclasses) does not have a
field with that name.
name
- the name of the field
null
if there is no such field.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |