org.apache.jdo.impl.enhancer.meta.prop
Class JDOClass

java.lang.Object
  extended byorg.apache.jdo.impl.enhancer.meta.prop.JDOClass

final class JDOClass
extends java.lang.Object

A class to hold all parsed attributes of a class.


Field Summary
private  java.lang.String[] fieldNames
          The names of all fields this class.
private  java.util.List fields
          A list of all parsed fields.
private  boolean isPersistent
          The persistence modifier of the class.
private  boolean isSerializable
          Flag indicating whether this class is serializable.
private  java.lang.String[] managedFieldNames
          The names of all managed fields this class.
private  int modifiers
          The access modifier of the class.
private  java.lang.String name
          The name of the class.
private  java.lang.String oidClassName
          The name of the oid class.
private  java.lang.String superClassName
          The name of the superclass.
 
Constructor Summary
(package private) JDOClass(java.lang.String name)
          Constructs a new object with the given name.
 
Method Summary
 void addField(JDOField field)
          Adds a new field.
 JDOField getField(java.lang.String name)
          Returns the field with the given name.
 java.lang.String[] getFieldNames()
          Returns the names of all fields of the class.
 java.util.List getFields()
          Returns all fields of the class.
 int getIndexOfField(java.lang.String name)
          Returns the index of the field with the given name.
 java.lang.String[] getManagedFieldNames()
          Returns the names of all managed fields this class.
 int getModifiers()
          Returns the modifiers of the class.
 java.lang.String getName()
          Returns the name of the class.
 java.lang.String getOidClassName()
          Returns the oid classname.
 java.lang.String getSuperClassName()
          Returns the superclassname.
 boolean isPersistent()
          Returns whether the class is persistent.
 boolean isSerializable()
          Returns whether the class is serializable.
 boolean isTransient()
          Returns whether the class is transient.
 void setModifiers(int modifiers)
          Returns the modifiers of the class.
 void setOidClassName(java.lang.String classname)
          Sets the oid classname.
 void setPersistent(boolean persistent)
          Sets the persistence modifier of the class.
 void setSerializable(boolean serializable)
          Sets the serializable flag of the class.
 void setSuperClassName(java.lang.String classname)
          Sets the superclassname.
(package private)  void sortFields()
          Sorts the fields of this class according to the names.
 java.lang.String toString()
          Creates a string-representation for this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private final java.lang.String name
The name of the class.


superClassName

private java.lang.String superClassName
The name of the superclass.


oidClassName

private java.lang.String oidClassName
The name of the oid class.


modifiers

private int modifiers
The access modifier of the class.


isPersistent

private boolean isPersistent
The persistence modifier of the class.


isSerializable

private boolean isSerializable
Flag indicating whether this class is serializable.


fields

private final java.util.List fields
A list of all parsed fields.


managedFieldNames

private java.lang.String[] managedFieldNames
The names of all managed fields this class.


fieldNames

private java.lang.String[] fieldNames
The names of all fields this class.

Constructor Detail

JDOClass

JDOClass(java.lang.String name)
Constructs a new object with the given name.

Parameters:
name - The name of the class.
Method Detail

getName

public java.lang.String getName()
Returns the name of the class.

Returns:
The name of the class.

setModifiers

public void setModifiers(int modifiers)
Returns the modifiers of the class.

Parameters:
modifiers - The modifiers of the class.

getModifiers

public int getModifiers()
Returns the modifiers of the class.

Returns:
The modifiers of the class.

setSuperClassName

public void setSuperClassName(java.lang.String classname)
Sets the superclassname. The given classname should have a canonical form (with dots). It is converted to the CM-similar notation (with slashes).

Parameters:
classname - The superclassname.

getSuperClassName

public java.lang.String getSuperClassName()
Returns the superclassname.

Returns:
The superclassname.

setOidClassName

public void setOidClassName(java.lang.String classname)
Sets the oid classname. The given classname should have a canonical form (with dots). It is converted to the CM-similar notation (with slashes).

Parameters:
classname - The oid classname

getOidClassName

public java.lang.String getOidClassName()
Returns the oid classname.

Returns:
The oid classname

setPersistent

public void setPersistent(boolean persistent)
Sets the persistence modifier of the class.

Parameters:
persistent - the persistence modifer
See Also:
isPersistent

isPersistent

public boolean isPersistent()
Returns whether the class is persistent.

Returns:
true if persistent class.
See Also:
isPersistent

isTransient

public boolean isTransient()
Returns whether the class is transient.

Returns:
true if transient class.
See Also:
isPersistent

isSerializable

public boolean isSerializable()
Returns whether the class is serializable.

Returns:
true if serializable class.
See Also:
isSerializable

setSerializable

public void setSerializable(boolean serializable)
Sets the serializable flag of the class.

Parameters:
serializable - the serializable flag
See Also:
isSerializable

addField

public void addField(JDOField field)
Adds a new field.

Parameters:
field - The new field.

getField

public JDOField getField(java.lang.String name)
Returns the field with the given name.

Parameters:
name - The name of the requested field.
Returns:
The field or null if not found.

getIndexOfField

public int getIndexOfField(java.lang.String name)
Returns the index of the field with the given name.

Parameters:
name - The name of the field.
Returns:
The index or -1 if the field was not found.

getFields

public java.util.List getFields()
Returns all fields of the class.

Returns:
The fields

getFieldNames

public java.lang.String[] getFieldNames()
Returns the names of all fields of the class.

Returns:
The field names

sortFields

final void sortFields()
Sorts the fields of this class according to the names. This method should be called if all fields are added. It is necessary to establish an order on the fields.


getManagedFieldNames

public java.lang.String[] getManagedFieldNames()
Returns the names of all managed fields this class.

Returns:
The persistent fieldnames.

toString

public java.lang.String toString()
Creates a string-representation for this object.

Returns:
The string-representation of this object.