public abstract class AbstractJavaType extends java.lang.Object implements JavaType
A non-abstract subclass must implement method getName() and
needs to override any of the other methods where the default
implementation is not appropriate.
Note, the class implements methods equals(Object obj),
hashCode() and toString()using the name of a JavaType.
| Constructor and Description |
|---|
AbstractJavaType() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
|
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.
|
abstract 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.
|
int |
hashCode()
Returns a hash code value for the object.
|
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. |
java.lang.String |
toString()
Returns a string representation of the object.
|
public boolean isPrimitive()
JavaTypetrue if this JavaType represents a primitive
type.
There are eight primitive types: boolean,
byte, short, int,
long, char,
float, double.
isPrimitive in interface JavaTypetrue if this JavaType represents a primitive
type; false otherwise.public boolean isIntegral()
JavaTypetrue if this JavaType represents an integral
type.
There are five are integral types: byte,
short, int, long, and
char.
isIntegral in interface JavaTypetrue if this JavaType represents an integral
type; false otherwise.public boolean isFloatingPoint()
JavaTypetrue if this JavaType represents a floating
point type.
There are two are floating point types:
float and double.
isFloatingPoint in interface JavaTypetrue if this JavaType represents a floating
point type; false otherwise.public boolean isInterface()
JavaTypeisInterface in interface JavaTypetrue if this object represents an interface type;
false otherwise.public boolean isArray()
JavaTypepublic boolean isWrapperClass()
JavaTypetrue 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.
isWrapperClass in interface JavaTypetrue if this JavaType represents a Java wrapper
class type; false otherwise.public boolean isJDOSupportedCollection()
JavaTypetrue 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
isJDOSupportedCollection in interface JavaTypetrue if this JavaType represents a JDO
supported collection; false otherwise.public boolean isJDOSupportedMap()
JavaTypetrue 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
isJDOSupportedMap in interface JavaTypetrue if this JavaType represents a JDO
supported map; false otherwise.public boolean isTrackable()
JavaTypetrue 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
isTrackable in interface JavaTypetrue if this JavaType represents a trackable
Java class, false otherwise.public boolean isValue()
JavaTypetrue 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
public boolean isOrderable()
JavaTypetrue 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
isOrderable in interface JavaTypetrue if this JavaType represents an orderable
type; false otherwise.public boolean isPersistenceCapable()
JavaTypetrue if this JavaType represents a persistence
capable class.
A ModelFatalException indicates a
problem accessing the JDO meta data for this JavaType.
isPersistenceCapable in interface JavaTypetrue if this JavaType represents a persistence
capable class; false otherwise.public boolean isCompatibleWith(JavaType javaType)
JavaTypeisCompatibleWith in interface JavaTypejavaType - the type this JavaType is checked with.true if this is compatible with the specified
type; false otherwise.public abstract java.lang.String getName()
JavaTypepublic int getModifiers()
JavaTypegetModifiers in interface JavaTypepublic JavaType getSuperclass()
JavaTypevoid,
then null is returned. If this object represents an
array class then the JavaType instance representing the Object class
is returned.getSuperclass in interface JavaTypepublic JDOClass getJDOClass()
JavaTypenull,
if this JavaType does not represent a persistence capable class.
A ModelFatalException indicates a
problem accessing the JDO meta data for this JavaType.
getJDOClass in interface JavaTypenull otherwise.public JavaType getArrayComponentType()
JavaTypenull.getArrayComponentType in interface JavaTypenull otherwise.public JavaField getJavaField(java.lang.String name)
JavaTypenull, if the
class or interface (or one of its superclasses) does not have a
field with that name.getJavaField in interface JavaTypename - the name of the fieldnull if there is no such field.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the reference object with which to compare.
This implementation compares the name of the specified object to be equal to the name of this JavaType. this
true if this object is the same as the obj
argument; false otherwise.public int hashCode()
This implementation returns the hashCode of the name of this JavaType.
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2005-2012 Apache Software Foundation. All Rights Reserved.