org.objectweb.jorm.type.api
Class PType

java.lang.Object
  |
  +--org.objectweb.jorm.type.api.PType
All Implemented Interfaces:
java.io.Serializable

public class PType
extends java.lang.Object
implements java.io.Serializable

The PType class defines the minimal information required to define a JORM type that belongs to a PTypeSpace. It should be derived for PType representing JORM classes. This derivation should be different between classes and generic classes.

Author:
P. D?chamboux
See Also:
Serialized Form

Field Summary
static int NOSIZE
           
static short TYPECODE_BIGDECIMAL
           
static short TYPECODE_BOOLEAN
           
static short TYPECODE_BYTE
           
static short TYPECODE_BYTEARRAY
           
static short TYPECODE_CHAR
           
static short TYPECODE_CHARARRAY
           
static short TYPECODE_DATE
           
static short TYPECODE_DOUBLE
           
static short TYPECODE_FLOAT
           
static short TYPECODE_INT
           
static short TYPECODE_LONG
           
static short TYPECODE_OBJBOOLEAN
           
static short TYPECODE_OBJBYTE
           
static short TYPECODE_OBJCHAR
           
static short TYPECODE_OBJDOUBLE
           
static short TYPECODE_OBJFLOAT
           
static short TYPECODE_OBJINT
           
static short TYPECODE_OBJLONG
           
static short TYPECODE_OBJSHORT
           
static short TYPECODE_REFERENCE
           
static short TYPECODE_SERIALIZED
           
static short TYPECODE_SHORT
           
static short TYPECODE_STRING
           
 
Constructor Summary
protected PType(short typecode, java.lang.String jormname, java.lang.String javaname, java.lang.String constname, java.lang.String codingname)
          It constructs the types that represent basic JORM types defined as constants within the PTypeSpace interface.
protected PType(java.lang.String classname, PTypeSpace typespace)
          It constructs the types that represent JORM classes, be it generic or not.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getCodingName()
          It retrieves the coding name associated to this PType.
 PType[] getInheritedPType()
          It retrieves the PType directly inherited by a PType representing a JORM class.
 java.lang.String getJavaName()
          It retrieves the Java name associated to this PType.
 java.lang.String getJormName()
          It retrieves the JORM name associated to this PType.
 PType getNestedPType()
          It retrieves the nested PType in case of a generic class PType.
 java.lang.String getProgName()
          It retrieves the name of the associated constant for programming access.
 PTypeSpace getPTypeSpace()
          It retrieves the type space associated to this PType.
 PType[] getSubTypes()
          Retrieves all subtypes of this PType defined within its PTypeSpace.
 int getTypeCode()
          It retrieves the code associated to this PType.
 boolean isa(PType pt)
          It compares if the current PType conforms to the given PType.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NOSIZE

public static final int NOSIZE
See Also:
Constant Field Values

TYPECODE_BOOLEAN

public static final short TYPECODE_BOOLEAN
See Also:
Constant Field Values

TYPECODE_CHAR

public static final short TYPECODE_CHAR
See Also:
Constant Field Values

TYPECODE_BYTE

public static final short TYPECODE_BYTE
See Also:
Constant Field Values

TYPECODE_SHORT

public static final short TYPECODE_SHORT
See Also:
Constant Field Values

TYPECODE_INT

public static final short TYPECODE_INT
See Also:
Constant Field Values

TYPECODE_LONG

public static final short TYPECODE_LONG
See Also:
Constant Field Values

TYPECODE_FLOAT

public static final short TYPECODE_FLOAT
See Also:
Constant Field Values

TYPECODE_DOUBLE

public static final short TYPECODE_DOUBLE
See Also:
Constant Field Values

TYPECODE_OBJBOOLEAN

public static final short TYPECODE_OBJBOOLEAN
See Also:
Constant Field Values

TYPECODE_OBJCHAR

public static final short TYPECODE_OBJCHAR
See Also:
Constant Field Values

TYPECODE_OBJBYTE

public static final short TYPECODE_OBJBYTE
See Also:
Constant Field Values

TYPECODE_OBJSHORT

public static final short TYPECODE_OBJSHORT
See Also:
Constant Field Values

TYPECODE_OBJINT

public static final short TYPECODE_OBJINT
See Also:
Constant Field Values

TYPECODE_OBJLONG

public static final short TYPECODE_OBJLONG
See Also:
Constant Field Values

TYPECODE_OBJFLOAT

public static final short TYPECODE_OBJFLOAT
See Also:
Constant Field Values

TYPECODE_OBJDOUBLE

public static final short TYPECODE_OBJDOUBLE
See Also:
Constant Field Values

TYPECODE_STRING

public static final short TYPECODE_STRING
See Also:
Constant Field Values

TYPECODE_DATE

public static final short TYPECODE_DATE
See Also:
Constant Field Values

TYPECODE_CHARARRAY

public static final short TYPECODE_CHARARRAY
See Also:
Constant Field Values

TYPECODE_BYTEARRAY

public static final short TYPECODE_BYTEARRAY
See Also:
Constant Field Values

TYPECODE_SERIALIZED

public static final short TYPECODE_SERIALIZED
See Also:
Constant Field Values

TYPECODE_BIGDECIMAL

public static final short TYPECODE_BIGDECIMAL
See Also:
Constant Field Values

TYPECODE_REFERENCE

public static final short TYPECODE_REFERENCE
See Also:
Constant Field Values
Constructor Detail

PType

protected PType(short typecode,
                java.lang.String jormname,
                java.lang.String javaname,
                java.lang.String constname,
                java.lang.String codingname)
It constructs the types that represent basic JORM types defined as constants within the PTypeSpace interface.

Parameters:
typecode - The type code as defined within PType.
jormname - The JORM name of this basic type.
javaname - The Java associated with this basic type.
constname - The constant name for prog. access.

PType

protected PType(java.lang.String classname,
                PTypeSpace typespace)
It constructs the types that represent JORM classes, be it generic or not.

Parameters:
classname - The name of the class for which a PType must be constructed.
typespace - The type space to which the constructed PType belongs.
Method Detail

isa

public boolean isa(PType pt)
It compares if the current PType conforms to the given PType. In case of PType representing JORM classes, the comparison is delegated to the associated PTypeSpace.

Parameters:
pt - The PType to be compared with.
Returns:
It returns true if this PType conforms to the one passed as parameter.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

getInheritedPType

public PType[] getInheritedPType()
It retrieves the PType directly inherited by a PType representing a JORM class.

Returns:
The array of directly inherited PType.

getJormName

public java.lang.String getJormName()
It retrieves the JORM name associated to this PType.

Returns:
It returns the JORM name.

getJavaName

public java.lang.String getJavaName()
It retrieves the Java name associated to this PType.

Returns:
It returns the Java name.

getCodingName

public java.lang.String getCodingName()
It retrieves the coding name associated to this PType.

Returns:
It returns the coding name.

getProgName

public java.lang.String getProgName()
It retrieves the name of the associated constant for programming access.

Returns:
It returns the Java name.

getNestedPType

public PType getNestedPType()
It retrieves the nested PType in case of a generic class PType.

Returns:
The nested PType.

getPTypeSpace

public PTypeSpace getPTypeSpace()
It retrieves the type space associated to this PType.

Returns:
The associated type space.

getSubTypes

public PType[] getSubTypes()
Retrieves all subtypes of this PType defined within its PTypeSpace.

Returns:
The array of PType containing all these subtypes.

getTypeCode

public int getTypeCode()
It retrieves the code associated to this PType.

Returns:
It returns the Java name.