Class AbstractFieldInfo

java.lang.Object
net.ontopia.persistence.proxy.AbstractFieldInfo
All Implemented Interfaces:
FieldHandlerIF, FieldInfoIF
Direct Known Subclasses:
AggregateFieldInfo, PrimitiveFieldInfo, ReferenceFieldInfo

public abstract class AbstractFieldInfo extends Object implements FieldInfoIF
INTERNAL: An abstract field info class containing the common behaviour for FieldInfoIFs.
  • Field Details

    • name

      protected String name
    • index

      protected int index
    • cardinality

      protected int cardinality
    • readonly

      protected boolean readonly
    • is_collection

      protected boolean is_collection
    • parent_cinfo

      protected ClassInfoIF parent_cinfo
    • value_class

      protected Class<?> value_class
    • field

      protected FieldDescriptor field
    • getter

      protected Method getter
    • setter

      protected Method setter
  • Constructor Details

    • AbstractFieldInfo

      protected AbstractFieldInfo(ClassInfoIF parent_cinfo, String name, int index, Class<?> value_class, boolean is_collection, int cardinality, boolean readonly)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: FieldInfoIF
      INTERNAL: Gets the field name.
      Specified by:
      getName in interface FieldInfoIF
    • getIndex

      public int getIndex()
      Description copied from interface: FieldInfoIF
      INTERNAL: Gets the value field index of this field. This is the id (index) used by transactions and persistent instances to refer to this particular object field.
      Specified by:
      getIndex in interface FieldInfoIF
    • isReadOnly

      public boolean isReadOnly()
      Description copied from interface: FieldInfoIF
      INTERNAL: Returns true if this field is read-only field.
      Specified by:
      isReadOnly in interface FieldInfoIF
    • getCardinality

      public int getCardinality()
      Description copied from interface: FieldInfoIF
      INTERNAL: Gets the field cardinality.
      Specified by:
      getCardinality in interface FieldInfoIF
    • isCollectionField

      public boolean isCollectionField()
      Description copied from interface: FieldInfoIF
      INTERNAL: Returns true if the field is a collection field (has a cardinality of 1:1 or 1:M).
      Specified by:
      isCollectionField in interface FieldInfoIF
    • isPrimitiveField

      public boolean isPrimitiveField()
      Description copied from interface: FieldInfoIF
      INTERNAL: Returns true if the field is a primitive field. Field value must be of primitive type.
      Specified by:
      isPrimitiveField in interface FieldInfoIF
    • isReferenceField

      public boolean isReferenceField()
      Description copied from interface: FieldInfoIF
      INTERNAL: Returns true if the field is a reference field. Field value must be of identifiable type.
      Specified by:
      isReferenceField in interface FieldInfoIF
    • isAggregateField

      public boolean isAggregateField()
      Description copied from interface: FieldInfoIF
      INTERNAL: Returns true if the field is an aggregate field. Field value must be of aggregate type.
      Specified by:
      isAggregateField in interface FieldInfoIF
    • getParentClassInfo

      public ClassInfoIF getParentClassInfo()
      Description copied from interface: FieldInfoIF
      INTERNAL: Gets the class info for the field's object type.
      Specified by:
      getParentClassInfo in interface FieldInfoIF
    • getValueClass

      public Class<?> getValueClass()
      Description copied from interface: FieldInfoIF
      INTERNAL: Gets the field value class. For primitive fields the primitive wrapper class is returned.
      Specified by:
      getValueClass in interface FieldInfoIF
    • getTable

      public String getTable()
      Description copied from interface: FieldInfoIF
      INTERNAL: Gets the table in which the field value is stored (aka the master table).
      Specified by:
      getTable in interface FieldInfoIF
    • getValue

      public Object getValue(Object object) throws Exception
      Description copied from interface: FieldInfoIF
      INTERNAL: Gets the field value from the given object.
      Specified by:
      getValue in interface FieldInfoIF
      Throws:
      Exception
    • setValue

      public void setValue(Object object, Object value) throws Exception
      Description copied from interface: FieldInfoIF
      INTERNAL: Sets the field value for the given object.
      Specified by:
      setValue in interface FieldInfoIF
      Throws:
      Exception
    • getGetterMethod

      protected Method getGetterMethod()
    • getSetterMethod

      protected Method getSetterMethod()
    • getJoinTable

      public String getJoinTable()
      Description copied from interface: FieldInfoIF
      INTERNAL: Gets the name of the table which needs to be joined to order to access the field value from the master table.
      Specified by:
      getJoinTable in interface FieldInfoIF
    • getJoinKeys

      public String[] getJoinKeys()
      Description copied from interface: FieldInfoIF
      INTERNAL: Gets the columns in the join table that contains the keys of the referencing object.
      Specified by:
      getJoinKeys in interface FieldInfoIF
    • getManyKeys

      public String[] getManyKeys()
      Description copied from interface: FieldInfoIF
      INTERNAL: Gets the columns in the join table that contains the keys of the referenced object.
      Specified by:
      getManyKeys in interface FieldInfoIF
    • getDescriptor

      public FieldDescriptor getDescriptor()
      INTERNAL: Returns the underlying FieldDescriptor instance if one exists.