public interface JavaType
Different environments (runtime, enhancer, development) will have different JavaType implementations to provide answers to the various methods.
Modifier and Type | Method and Description |
---|---|
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. |
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.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.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.boolean isInterface()
true
if this object represents an interface type;
false
otherwise.boolean isArray()
true
if this object represents an array type;
false
otherwise.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.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.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.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.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.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.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 metadataboolean isCompatibleWith(JavaType javaType)
javaType
- the type this JavaType is checked with.true
if this is compatible with the specified
type; false
otherwise.java.lang.String getName()
int getModifiers()
JavaType getSuperclass()
void
,
then null
is returned. If this object represents an
array class then the JavaType instance representing the Object class
is returned.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 metadataJavaType getArrayComponentType()
null
.null
otherwise.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 fieldnull
if there is no such field.Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.