org.caleigo.core
Interface IFieldDescriptor

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
ICalculatedFieldDescriptor, ICompositeEntityDescriptor.ICompositeFieldDescriptor
All Known Implementing Classes:
AbstractCalculatedFieldDescriptor, CompositeEntityDescriptor.CompositeFieldGroup.CompositeFieldDescriptor, FieldDescriptor

public interface IFieldDescriptor
extends java.io.Serializable

The IFieldDescriptor inteface defines entity fields (often corresponds to columns in relational databases) and their properties in the CEL framework. Note tha fields are aware of what entity descriptor the are part of and the relations they are a component in.

Version:
1.00
Author:
Dennis Zikovic

Field Summary
static int AUTOGEN
          Flag that states if the field is autogenerated or not.
static int HIDDEN_FIELD
          This flag defines the field as hidden meaning that data of the fields type should never be displayed for the end-user.
static int HINT_FIELD
          This flag states if the field is suitable hint field for the entity it is a part of for the end-user.
static int IDENTITY_FIELD
          Constant used to define that the field is a part of the entity´s identity (primary key in a relational database).
static int INDEXED
          Constant used to state if the field is a preferred field to qualify on.
static int NAME_FIELD
          This flag states if the field is suitable name field to define the identity of the entity it is a part of for the end-user.
static int NATURAL_ORDER
          Constant used to define the natural order for the entities it is a part of.
static int OVERVIEW_FIELD
          This flag states that the field is suitable for limited overview of the entity it is a part of.
static int READ_ONLY_FIELD
          This flag defines the field as read-only meaning that data of the fields type should never be edited by the end-user.
static int REQUIRED
          Constant used to define if the field is required and allows null values or not.
 
Method Summary
 boolean canValidate(IDataProvider dataProvider)
          This method returns true if the called field descriptor can validate data described by the field in the context of the provided IDataProvider object.
 java.lang.String getCodeName()
          Return the code name for the field.
 DataType getDataType()
          Returns the data type for the field.
 java.lang.Object getDefaultValue()
          Return the default value for the field or null if none is set.
 java.lang.String getDisplayName()
          Returns the display name for the field.
 IEntityDescriptor getEntityDescriptor()
          Access method that returns the entity descriptor that the described field is part of.
 java.util.Iterator getFieldRelations()
          Access method that returns an iterator for all IFieldRelation objects that the called field descripyor is a part of.
 int getLength()
          Returns the length of the data type if the type is a scalar type.
 IFieldRelation getReferenceFieldRelation()
          Access method that returns the field relation that the called field is a reference to.
 java.lang.String getSourceName()
          Returns the source name for the field.
 boolean isAutoGenerated()
          Access method that returns true if the field is autogenerated or not.
 boolean isHiddenField()
          Access method that returns true if the field is hidden, meaning that data of the fields type should never be displayed for the end-user.
 boolean isHintField()
          Access method that returns true if the field is a suitable hint field for the entity it is a part of for the end-user.
 boolean isIdentityField()
          Access method that returns true if the field is a part of the entity´s identity (primary key in a relational database).
 boolean isIndexed()
          Access method that returns true if the field is a preferred field to qualify on.
 boolean isNameField()
          Access method that returns true if the field is suitable name field to define the identify of the entity it is a part of for the end-user.
 boolean isNaturalOrder()
          Access method that returns true if the field is the natural order field for the entities it is a part of.
 boolean isOverviewField()
          Access method that returns true if the field is suitable for limited overview of the entity it is a part of.
 boolean isReadOnly()
          Access method that returns true if the field as read-only meaning that data of the fields type should never be edited by the end-user.
 boolean isReferenceField()
          Access method that returns true if the field is apart of an entity reference.
 boolean isRequired()
          Access method that returns true if the field is required and allows null values or not.
 ValidationResult validateData(java.lang.Object data, IDataProvider dataProvider)
          This method validates the provided data object as described by the called field descriptor in the context of the provided IDataProvider object.
 

Field Detail

IDENTITY_FIELD

public static final int IDENTITY_FIELD
Constant used to define that the field is a part of the entity´s identity (primary key in a relational database). Note that an entity can have multiple identity fields. All entities in the cel framework must have atleast one identity field.

See Also:
Constant Field Values

NATURAL_ORDER

public static final int NATURAL_ORDER
Constant used to define the natural order for the entities it is a part of. If no natural order field is defined the identity field will be used for natural order.

See Also:
Constant Field Values

REQUIRED

public static final int REQUIRED
Constant used to define if the field is required and allows null values or not. The view layer will for instance use this flag to validate the data null values according to this flag.

See Also:
Constant Field Values

INDEXED

public static final int INDEXED
Constant used to state if the field is a preferred field to qualify on. It is normally used to state if the underlaying database has an index on the field.

See Also:
Constant Field Values

AUTOGEN

public static final int AUTOGEN
Flag that states if the field is autogenerated or not. Fields with this flag should never have values edited by the end-user.

See Also:
Constant Field Values

NAME_FIELD

public static final int NAME_FIELD
This flag states if the field is suitable name field to define the identity of the entity it is a part of for the end-user. If no name field is defined the identity field then no reference mapping will be done for the end-user in the view layer. An etity may only have one name field.

See Also:
Constant Field Values

OVERVIEW_FIELD

public static final int OVERVIEW_FIELD
This flag states that the field is suitable for limited overview of the entity it is a part of. It is used in the view layer to define what fields that by default should be displayed in lists and in qualifier views. An entity should normally have less the five overview fields.

See Also:
Constant Field Values

HINT_FIELD

public static final int HINT_FIELD
This flag states if the field is suitable hint field for the entity it is a part of for the end-user. If no hint field is defined then no hints will be automatically displayed for the end-user in the view layer. An etity may only have one hint field.

See Also:
Constant Field Values

HIDDEN_FIELD

public static final int HIDDEN_FIELD
This flag defines the field as hidden meaning that data of the fields type should never be displayed for the end-user.

See Also:
Constant Field Values

READ_ONLY_FIELD

public static final int READ_ONLY_FIELD
This flag defines the field as read-only meaning that data of the fields type should never be edited by the end-user.

See Also:
Constant Field Values
Method Detail

getCodeName

public java.lang.String getCodeName()
Return the code name for the field. The code name should be used for programitic identification. This is safer and recomended compared to the use of field indexes. The code name is also the name of the data property for the field in enities.


getSourceName

public java.lang.String getSourceName()
Returns the source name for the field. The source name is an identifier for the field in the data service layer.


getDisplayName

public java.lang.String getDisplayName()
Returns the display name for the field. The reurned value has been passed through the ResourceProvider to allow localisation.


getDataType

public DataType getDataType()
Returns the data type for the field.


getLength

public int getLength()
Returns the length of the data type if the type is a scalar type.


getDefaultValue

public java.lang.Object getDefaultValue()
Return the default value for the field or null if none is set. This defayult value will automaticalli be set as the default value for created entities tha the field is part of.


isIdentityField

public boolean isIdentityField()
Access method that returns true if the field is a part of the entity´s identity (primary key in a relational database). Note that an entity can have multiple identity fields. All entities in the cel framework must have atleast one identity field.


isNaturalOrder

public boolean isNaturalOrder()
Access method that returns true if the field is the natural order field for the entities it is a part of. If no natural order field is defined the identity field will be used for natural order.


isRequired

public boolean isRequired()
Access method that returns true if the field is required and allows null values or not. The view layer will for instance use this flag to validate the data null values according to this flag.


isIndexed

public boolean isIndexed()
Access method that returns true if the field is a preferred field to qualify on. It is normally used to state if the underlaying database has an index on the field.


isAutoGenerated

public boolean isAutoGenerated()
Access method that returns true if the field is autogenerated or not. Fields with this flag should never have values edited by the end-user.


isNameField

public boolean isNameField()
Access method that returns true if the field is suitable name field to define the identify of the entity it is a part of for the end-user. If no name field is defined the identity field then no reference mapping will be done for the end-user in the view layer. An etity may only have one name field.


isOverviewField

public boolean isOverviewField()
Access method that returns true if the field is suitable for limited overview of the entity it is a part of. It is used in the view layer to define what fields that by default should be displayed in lists and in qualifier views. An entity should normally have less the five overview fields.


isHintField

public boolean isHintField()
Access method that returns true if the field is a suitable hint field for the entity it is a part of for the end-user. If no hint field is defined then no hints will be automatically displayed for the end-user in the view layer. An etity may only have one hint field.


isHiddenField

public boolean isHiddenField()
Access method that returns true if the field is hidden, meaning that data of the fields type should never be displayed for the end-user.


isReadOnly

public boolean isReadOnly()
Access method that returns true if the field as read-only meaning that data of the fields type should never be edited by the end-user.


isReferenceField

public boolean isReferenceField()
Access method that returns true if the field is apart of an entity reference.


getEntityDescriptor

public IEntityDescriptor getEntityDescriptor()
Access method that returns the entity descriptor that the described field is part of.


canValidate

public boolean canValidate(IDataProvider dataProvider)
This method returns true if the called field descriptor can validate data described by the field in the context of the provided IDataProvider object. The minimum requiriment is that described field data can be provided but in some cases other data resources is also required.


validateData

public ValidationResult validateData(java.lang.Object data,
                                     IDataProvider dataProvider)
This method validates the provided data object as described by the called field descriptor in the context of the provided IDataProvider object.


getReferenceFieldRelation

public IFieldRelation getReferenceFieldRelation()
Access method that returns the field relation that the called field is a reference to. If the called field descriptor is not a reference field then null is returned.


getFieldRelations

public java.util.Iterator getFieldRelations()
Access method that returns an iterator for all IFieldRelation objects that the called field descripyor is a part of.



Copyright © 2005 Caleigo. All Rights Reserved.