org.objectweb.speedo.metadata
Class SpeedoClass

java.lang.Object
  extended byorg.objectweb.speedo.metadata.SpeedoElement
      extended byorg.objectweb.speedo.metadata.SpeedoClass

public class SpeedoClass
extends SpeedoElement

Describes a persistence capable class.

Author:
Y. Devaux

Field Summary
 boolean classAlreadyEnhanced
           
 ClassCode classCode
          Descriptor of this class code.
 boolean failed
          Indicates whether something goes wrong during the JDO Instances generation.
 byte identityType
          Attribute identity-type.
 boolean isAbstract
          Indicates if the class is abstract.
 boolean isInstanceCallbacks
          Indicates if the class implements InstanceCallbacks
 boolean isSerializable
          Indicates if the class implements InstanceCallbacks
 java.util.Map jdoField
          Description of persistent capable fields of this class.
 SpeedoPackage jdoPackage
          Description of the package which contains this class.
 java.lang.Class jormclass
          Class jorm corresponding to this jdoclass
 java.lang.String name
          Class name.
 java.lang.String objectidClass
          Attribute objectid-class.
 boolean requireEnhancement
           
 boolean requiresExtent
          Attribute requires-extent.
 java.lang.String signature
          Class signature.
 java.lang.String superClassName
          Super class name.
 long VersionUID
          Version UID for serialization.
 
Fields inherited from class org.objectweb.speedo.metadata.SpeedoElement
jdoExtension
 
Constructor Summary
SpeedoClass()
           
 
Method Summary
 void add(java.lang.Object field)
          Adds a SpeedoField to the class.
 void add(java.lang.Object field, boolean failsOnError, Logger logger)
          Adds a SpeedoField to the class.
 int computeFieldNumbers()
          Computes the field numbers for the fields of this class.
 boolean generateObjectId()
           
 java.lang.String getFQName()
           
 java.lang.String getJDOFileName()
           
 java.lang.String getJormFileName()
           
 int getPkFieldCount()
           
 SpeedoClass getSpeedoClassFromContext(java.lang.String className)
           
 java.lang.String toString()
          Transforms a SpeedoClass into a String.
 
Methods inherited from class org.objectweb.speedo.metadata.SpeedoElement
addExtension, getExtension, getExtensionByKey, getExtensionValueByKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

public java.lang.String name
Class name.


identityType

public byte identityType
Attribute identity-type.


objectidClass

public java.lang.String objectidClass
Attribute objectid-class.


requiresExtent

public boolean requiresExtent
Attribute requires-extent.


superClassName

public java.lang.String superClassName
Super class name.


jdoField

public java.util.Map jdoField
Description of persistent capable fields of this class. The HashMap key is the field name.


classCode

public ClassCode classCode
Descriptor of this class code.


jdoPackage

public SpeedoPackage jdoPackage
Description of the package which contains this class.


isAbstract

public boolean isAbstract
Indicates if the class is abstract.


isInstanceCallbacks

public boolean isInstanceCallbacks
Indicates if the class implements InstanceCallbacks


isSerializable

public boolean isSerializable
Indicates if the class implements InstanceCallbacks


signature

public java.lang.String signature
Class signature.


VersionUID

public long VersionUID
Version UID for serialization.


failed

public boolean failed
Indicates whether something goes wrong during the JDO Instances generation.


jormclass

public java.lang.Class jormclass
Class jorm corresponding to this jdoclass


classAlreadyEnhanced

public boolean classAlreadyEnhanced

requireEnhancement

public boolean requireEnhancement
Constructor Detail

SpeedoClass

public SpeedoClass()
Method Detail

getFQName

public java.lang.String getFQName()

toString

public java.lang.String toString()
Transforms a SpeedoClass into a String.

Returns:
the Sting corresponding to the SpeedoClass.

add

public void add(java.lang.Object field)
Adds a SpeedoField to the class. Precondition: this field doesn't exist in the jdoFields HashMap.

Parameters:
field - field to add.

add

public void add(java.lang.Object field,
                boolean failsOnError,
                Logger logger)
         throws SpeedoException
Adds a SpeedoField to the class.

Parameters:
field - field to add.
failsOnError - if an error must be thrown or creates a warning.
logger - logger for writting warn message if necessary.
Throws:
SpeedoException - if the field was already defined into the class.

computeFieldNumbers

public int computeFieldNumbers()
Computes the field numbers for the fields of this class.

Returns:
the number of fields of this class (including inherited fields).

getJormFileName

public java.lang.String getJormFileName()

generateObjectId

public boolean generateObjectId()

getPkFieldCount

public int getPkFieldCount()

getSpeedoClassFromContext

public SpeedoClass getSpeedoClassFromContext(java.lang.String className)

getJDOFileName

public java.lang.String getJDOFileName()