|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.impl.model.java.AbstractJavaType
public abstract class AbstractJavaType
Abstract super class for JavaType implementations. It provides a default implementation for all methods except getName. The methods return the Java default value of the return type.
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 Summary | |
---|---|
AbstractJavaType()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractJavaType()
Method Detail |
---|
public boolean isPrimitive()
JavaType
true
if this JavaType represents a primitive
type.
There are eight primitive types: boolean
,
byte
, short
, int
,
long
, char
,
float
, double
.
isPrimitive
in interface JavaType
true
if this JavaType represents a primitive
type; false
otherwise.public boolean isIntegral()
JavaType
true
if this JavaType represents an integral
type.
There are five are integral types: byte
,
short
, int
, long
, and
char
.
isIntegral
in interface JavaType
true
if this JavaType represents an integral
type; false
otherwise.public boolean isFloatingPoint()
JavaType
true
if this JavaType represents a floating
point type.
There are two are floating point types:
float
and double
.
isFloatingPoint
in interface JavaType
true
if this JavaType represents a floating
point type; false
otherwise.public boolean isInterface()
JavaType
isInterface
in interface JavaType
true
if this object represents an interface type;
false
otherwise.public boolean isArray()
JavaType
isArray
in interface JavaType
true
if this object represents an array type;
false
otherwise.public boolean isWrapperClass()
JavaType
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
.
isWrapperClass
in interface JavaType
true
if this JavaType represents a Java wrapper
class type; false
otherwise.public boolean isJDOSupportedCollection()
JavaType
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
isJDOSupportedCollection
in interface JavaType
true
if this JavaType represents a JDO
supported collection; false
otherwise.public boolean isJDOSupportedMap()
JavaType
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
isJDOSupportedMap
in interface JavaType
true
if this JavaType represents a JDO
supported map; false
otherwise.public boolean isTrackable()
JavaType
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
isTrackable
in interface JavaType
true
if this JavaType represents a trackable
Java class, false
otherwise.public boolean isValue()
JavaType
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
isValue
in interface JavaType
true
if this JavaType represents a value type;
false
otherwise.public boolean isOrderable()
JavaType
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
isOrderable
in interface JavaType
true
if this JavaType represents an orderable
type; false
otherwise.public boolean isPersistenceCapable()
JavaType
true
if this JavaType represents a persistence
capable class.
A ModelFatalException
indicates a
problem accessing the JDO meta data for this JavaType.
isPersistenceCapable
in interface JavaType
true
if this JavaType represents a persistence
capable class; false
otherwise.public boolean isCompatibleWith(JavaType javaType)
JavaType
isCompatibleWith
in interface JavaType
javaType
- the type this JavaType is checked with.
true
if this is compatible with the specified
type; false
otherwise.public abstract java.lang.String getName()
JavaType
getName
in interface JavaType
public int getModifiers()
JavaType
getModifiers
in interface JavaType
public JavaType getSuperclass()
JavaType
void
,
then null
is returned. If this object represents an
array class then the JavaType instance representing the Object class
is returned.
getSuperclass
in interface JavaType
public JDOClass getJDOClass()
JavaType
null
,
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 JavaType
null
otherwise.public JavaType getArrayComponentType()
JavaType
null
.
getArrayComponentType
in interface JavaType
null
otherwise.public JavaField getJavaField(java.lang.String name)
JavaType
null
, if the
class or interface (or one of its superclasses) does not have a
field with that name.
getJavaField
in interface JavaType
name
- the name of the field
null
if there is no such field.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- 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.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |