net.sf.jso.schema
Class ClassDescriptor

java.lang.Object
  extended bynet.sf.jso.schema.ClassDescriptor
All Implemented Interfaces:
java.io.Serializable

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

Class for class descritptors. Class descriptors represent Storable implementations as they should be stored in JSO schema.

See Also:
Serialized Form

Constructor Summary
ClassDescriptor(java.lang.Class javaClass, java.util.Set fieldSet, java.util.Set indexSet, java.util.Set superclassSet, boolean collectable)
          Constructs the class descriptor.
 
Method Summary
 void addJavaSubclass(java.lang.Class aClass)
          Adds a class to the set of subclasses of the storable class.
 boolean equals(java.lang.Object o)
          Indicates whether some other class descriptor is "equal to" this one.
 boolean equalsIgnoreSubclasses(ClassDescriptor cd)
          Indicates whether some other class descriptor is "equal to" this one.
 java.util.Set getFields()
          Gets the field descriptors for the class descriptor .
 long getId()
          Returns the cataloged id of this class descriptor's class.
 java.util.Set getIndices()
          Gets the index descriptors for the class descriptor .
 java.lang.Class getJavaClass()
          Returns the corresponding java class.
 java.util.Set getJavaSubclasses()
          Returns the set of subclasses of the storable class.
 java.util.Set getJavaSuperclasses()
          Returns the set of superclasses of the storable class.
 TableDescriptor getTableDescriptor()
          Returns a table descriptor for this class descriptor.
 java.lang.String getTableName()
          Returns the name of the storable class's corresponding table.
static java.lang.String getTableNameFor(java.lang.Class aClass)
          Returns a table name for a class.
static java.lang.String getTableNameFor(java.lang.String className)
          Returns a table name for a class name.
 int hashCode()
          Returns a hash code value for the class descriptor.
 boolean isGarbageCollectable()
          Indicates if the storable class is garabage collectable.
 void removeJavaSubclass(java.lang.Class aClass)
          Removes a class to the set of subclasses of the storable class.
 void setId(long anId)
          Sets the cataloged id of this class descriptor's class.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassDescriptor

public ClassDescriptor(java.lang.Class javaClass,
                       java.util.Set fieldSet,
                       java.util.Set indexSet,
                       java.util.Set superclassSet,
                       boolean collectable)
Constructs the class descriptor.

Method Detail

getJavaClass

public java.lang.Class getJavaClass()
Returns the corresponding java class.


setId

public void setId(long anId)
Sets the cataloged id of this class descriptor's class.

Parameters:
anId - The id of this class descriptor's class.

getId

public long getId()
Returns the cataloged id of this class descriptor's class.

Returns:
The id of this class descriptor's class.

isGarbageCollectable

public boolean isGarbageCollectable()
Indicates if the storable class is garabage collectable.


getFields

public java.util.Set getFields()
Gets the field descriptors for the class descriptor .

Returns:
A list of FieldDescriptor objects.

getIndices

public java.util.Set getIndices()
Gets the index descriptors for the class descriptor .

Returns:
A list of IndexDescriptor objects.

getJavaSubclasses

public java.util.Set getJavaSubclasses()
Returns the set of subclasses of the storable class.


getJavaSuperclasses

public java.util.Set getJavaSuperclasses()
Returns the set of superclasses of the storable class.


addJavaSubclass

public void addJavaSubclass(java.lang.Class aClass)
Adds a class to the set of subclasses of the storable class.


removeJavaSubclass

public void removeJavaSubclass(java.lang.Class aClass)
Removes a class to the set of subclasses of the storable class.


getTableNameFor

public static java.lang.String getTableNameFor(java.lang.Class aClass)
Returns a table name for a class.

Parameters:
aClass - Class for which a table name will be returned.
Returns:
A table name for the supplied class.

getTableNameFor

public static java.lang.String getTableNameFor(java.lang.String className)
Returns a table name for a class name.

Parameters:
className - Class name for which a table name will be returned.
Returns:
A table name for the supplied class name.

getTableDescriptor

public TableDescriptor getTableDescriptor()
Returns a table descriptor for this class descriptor.


getTableName

public java.lang.String getTableName()
Returns the name of the storable class's corresponding table.


equals

public boolean equals(java.lang.Object o)
Indicates whether some other class descriptor is "equal to" this one.

Parameters:
o - The object with which to compare.
Returns:
true if the class descriptor is the same as the class descriptor argument; false otherwise.

equalsIgnoreSubclasses

public boolean equalsIgnoreSubclasses(ClassDescriptor cd)
Indicates whether some other class descriptor is "equal to" this one. Comparison does not consider sublcasses.

Parameters:
cd - The class descriptor with which to compare.
Returns:
true if the class descriptor is the same as the class descriptor argument; false otherwise.

hashCode

public int hashCode()
Returns a hash code value for the class descriptor.

Returns:
A hash code value for the class descriptor.