net.ontopia.persistence.proxy
Class ClassDescriptor

java.lang.Object
  extended by net.ontopia.persistence.proxy.ClassDescriptor

public class ClassDescriptor
extends java.lang.Object

INTERNAL: Class used for holding object relational mapping class declarations. It is used by the ObjectRelationalMapping class.

A class descriptor contains information about object classes defined in object relational mappings. Class descriptors consists of a set of field descriptors.


Field Summary
protected  java.lang.Class[] extends_classes
           
protected  java.util.Map fdescs
           
protected  java.util.List fdescs_list
           
protected  java.lang.String[] identity_fields
           
protected  java.lang.Class[] interfaces
           
protected  boolean isabstract
           
protected  java.lang.Class klass
           
protected  java.lang.Class klass_immutable
           
protected  ObjectRelationalMapping mapping
           
protected  java.lang.String master_table
           
protected  int structure
           
protected  int type
           
 
Constructor Summary
ClassDescriptor(java.lang.Class klass, java.lang.Class klass_immutable, ObjectRelationalMapping mapping)
           
 
Method Summary
 void addField(FieldDescriptor fdesc)
          INTERNAL: Adds the field descriptor to the class descriptor.
 FieldDescriptor[] getAggregateFields()
          INTERNAL: Returns an array containing the fields that are aggregate objects.
 java.lang.Class getDescriptorClass()
          INTERNAL: Returns the descriptor class.
 java.lang.Class[] getExtends()
          INTERNAL: Returns the descriptor classes that this descriptor class extends.
 FieldDescriptor getFieldByName(java.lang.String field_name)
          INTERNAL: Gets the field descriptor representing the field with the given name.
protected  java.util.Map getFieldDescriptorMap()
           
 FieldDescriptor[] getFieldDescriptors()
          INTERNAL: Returns all the field descriptors of this class descriptor.
 java.lang.String[] getFieldNames()
          INTERNAL: Gets all the field names of this class descriptor.
 FieldDescriptor[] getIdentityFields()
          INTERNAL: Returns an array containing the fields that are identity fields.
 java.lang.Class getImmutableDescriptorClass()
          INTERNAL: Returns the immutable descriptor class.
 java.lang.Class[] getInterfaces()
          INTERNAL: Gets the interfaces that this descriptor class implement.
 ObjectRelationalMapping getMapping()
          INTERNAL: Gets the object relational mapping that the class descriptor belongs to.
 java.lang.String getMasterTable()
          INTERNAL: Returns the name of the master table in which the class is stored.
 java.lang.String getName()
          INTERNAL: Returns the name of the descriptor class (the mapped class).
 FieldDescriptor[] getPrimitiveFields()
          INTERNAL: Returns an array containing the fields that are of primitive types.
 FieldDescriptor[] getReferenceFields()
          INTERNAL: Returns an array containing the fields that references other mapped objects.
 int getStructure()
          INTERNAL: Returns the class structure.
 int getType()
          INTERNAL: Returns the class type.
 FieldDescriptor[] getValueFields()
          INTERNAL: Returns an array containing the fields that are value fields, i.e.
 boolean isAbstract()
          INTERNAL: Returns true if the descriptor class is mapped as an abstract class.
 boolean isAggregate()
           
protected  void populateExtendsMap(java.util.Map _fdescs)
           
 void setAbstract(boolean isabstract)
          INTERNAL: Sets the abstract flag.
 void setExtends(java.lang.Class[] extends_classes)
          INTERNAL: Sets the descriptor classes that this descriptor class extends.
 void setInterfaces(java.lang.Class[] interfaces)
          INTERNAL: Sets the interfaces that this descriptor class implement.
 void setMasterTable(java.lang.String master_table)
          INTERNAL: Sets the name of the master table in which the class is stored.
 void setStructure(int structure)
          INTERNAL: Sets the class structure.
 void setType(int type)
          INTERNAL: Sets the class type.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mapping

protected ObjectRelationalMapping mapping

klass

protected java.lang.Class klass

klass_immutable

protected java.lang.Class klass_immutable

identity_fields

protected java.lang.String[] identity_fields

isabstract

protected boolean isabstract

type

protected int type

structure

protected int structure

master_table

protected java.lang.String master_table

extends_classes

protected java.lang.Class[] extends_classes

interfaces

protected java.lang.Class[] interfaces

fdescs_list

protected java.util.List fdescs_list

fdescs

protected java.util.Map fdescs
Constructor Detail

ClassDescriptor

public ClassDescriptor(java.lang.Class klass,
                       java.lang.Class klass_immutable,
                       ObjectRelationalMapping mapping)
Method Detail

getMapping

public ObjectRelationalMapping getMapping()
INTERNAL: Gets the object relational mapping that the class descriptor belongs to.


getName

public java.lang.String getName()
INTERNAL: Returns the name of the descriptor class (the mapped class).


getDescriptorClass

public java.lang.Class getDescriptorClass()
INTERNAL: Returns the descriptor class.


getImmutableDescriptorClass

public java.lang.Class getImmutableDescriptorClass()
INTERNAL: Returns the immutable descriptor class.


getIdentityFields

public FieldDescriptor[] getIdentityFields()
INTERNAL: Returns an array containing the fields that are identity fields.

An identity field is the field that together represents the identity, or primary key, of instances of the class.


getValueFields

public FieldDescriptor[] getValueFields()
INTERNAL: Returns an array containing the fields that are value fields, i.e. not identity fields.


getPrimitiveFields

public FieldDescriptor[] getPrimitiveFields()
INTERNAL: Returns an array containing the fields that are of primitive types.


getReferenceFields

public FieldDescriptor[] getReferenceFields()
INTERNAL: Returns an array containing the fields that references other mapped objects.


getAggregateFields

public FieldDescriptor[] getAggregateFields()
INTERNAL: Returns an array containing the fields that are aggregate objects. Aggregate objects are composite objects that don't have explicit identity.


getType

public int getType()
INTERNAL: Returns the class type.


setType

public void setType(int type)
INTERNAL: Sets the class type. This is can either be ClassInfoIF.TYPE_IDENTIFIABLE or ClassInfoIF.TYPE_AGGREGATE.


isAggregate

public boolean isAggregate()

getStructure

public int getStructure()
INTERNAL: Returns the class structure.


setStructure

public void setStructure(int structure)
INTERNAL: Sets the class structure. This is can either be ClassInfoIF.STRUCTURE_OBJECT or ClassInfoIF.STRUCTURE_COLLECTION.


setAbstract

public void setAbstract(boolean isabstract)
INTERNAL: Sets the abstract flag. The default is that the descriptor class is non-abstract (i.e. concrete).


isAbstract

public boolean isAbstract()
INTERNAL: Returns true if the descriptor class is mapped as an abstract class.


getMasterTable

public java.lang.String getMasterTable()
INTERNAL: Returns the name of the master table in which the class is stored.


setMasterTable

public void setMasterTable(java.lang.String master_table)
INTERNAL: Sets the name of the master table in which the class is stored.


getExtends

public java.lang.Class[] getExtends()
INTERNAL: Returns the descriptor classes that this descriptor class extends. (Not implemented)


setExtends

public void setExtends(java.lang.Class[] extends_classes)
INTERNAL: Sets the descriptor classes that this descriptor class extends. (Not implemented)


getFieldDescriptorMap

protected java.util.Map getFieldDescriptorMap()

populateExtendsMap

protected void populateExtendsMap(java.util.Map _fdescs)

getInterfaces

public java.lang.Class[] getInterfaces()
INTERNAL: Gets the interfaces that this descriptor class implement.


setInterfaces

public void setInterfaces(java.lang.Class[] interfaces)
INTERNAL: Sets the interfaces that this descriptor class implement.


getFieldDescriptors

public FieldDescriptor[] getFieldDescriptors()
INTERNAL: Returns all the field descriptors of this class descriptor.


getFieldNames

public java.lang.String[] getFieldNames()
INTERNAL: Gets all the field names of this class descriptor.


getFieldByName

public FieldDescriptor getFieldByName(java.lang.String field_name)
INTERNAL: Gets the field descriptor representing the field with the given name.


addField

public void addField(FieldDescriptor fdesc)
INTERNAL: Adds the field descriptor to the class descriptor.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2000-2012 Ontopia.