WEB4J Development Tools 4.10.0.0

hirondelle.web4jtools.codegenerator.field
Class Field

Object
  extended by hirondelle.web4jtools.codegenerator.field.Field

public final class Field
extends Object

A data field used by the feature.

A data field usually maps to a database table column.

One of these fields must be marked as the primary key.


Constructor Summary
Field(Id aId, String aName, String aDescription, Boolean aIsRequired, String aType, String aControlStyle, Boolean aIsPrimaryKey, Integer aMinimum, Integer aMaximum, Integer aNumDecimals, String aErrorMessage, Boolean aIsHardValidatedForLength, String aHardValidationPattern, String aCheckPattern, Boolean aCheckEmail, Boolean aCheckSpam, Boolean aIsOrderByField, Boolean aIsDescendingOrder, String aCodeTable)
          Constructor.
 
Method Summary
 boolean equals(Object aThat)
           
 Boolean getCheckEmail()
           
 String getCheckPattern()
           
 Boolean getCheckSpam()
           
 String getCodeTable()
           
 ControlStyle getControlStyle()
           
 String getDescription()
           
 String getErrorMessage()
           
 String getHardValidationPattern()
           
 Id getId()
           
 Boolean getIsDescendingOrder()
           
 Boolean getIsHardValidatedForLength()
           
 Boolean getIsOrderByField()
           
 Boolean getIsPrimaryKey()
           
 Boolean getIsRequired()
           
 Integer getMaximum()
           
 Integer getMinimum()
           
 String getName()
           
 Integer getNumDecimals()
           
 SortOrder getSortOrder()
          Return the SortOrder calculated from getIsOrderByField() and getIsDescendingOrder().
 FieldType getType()
           
 int hashCode()
           
 String toString()
          Intended for debugging only.
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Field

public Field(Id aId,
             String aName,
             String aDescription,
             Boolean aIsRequired,
             String aType,
             String aControlStyle,
             Boolean aIsPrimaryKey,
             Integer aMinimum,
             Integer aMaximum,
             Integer aNumDecimals,
             String aErrorMessage,
             Boolean aIsHardValidatedForLength,
             String aHardValidationPattern,
             String aCheckPattern,
             Boolean aCheckEmail,
             Boolean aCheckSpam,
             Boolean aIsOrderByField,
             Boolean aIsDescendingOrder,
             String aCodeTable)
      throws ModelCtorException
Constructor.

Here, the Id is not a database key. Rather, it is an index into a collection of Fields stored only in memory. It acts much as a primary key, however.

'Required' Requires Some Explanation
Items are required in the sense of needing to be non-null in the Model Object. They are not required in the sense of being non-null in the database. Usually this distinction is irrelevant. However, for primary keys the distinction is indeed relevant : primary keys are required in the database, but often not required in the Model Object. When adding a new record, a Model Object is first created, to model the user input. At this stage, however, the primary key is usually not yet defined. This is particularly true when the database autogenerates its primary keys when new records are added.

Minimum and Maximum
These are numeric entries, and are interpreted differently according to FieldType. For numeric data, they are simply limits on the field's value. For text data, they are limits on the number of characters. See Check for more information on its min and max methods.

Hard Validation
One and only one form of hard validation must be selected, either length or pattern, but not both.

Soft Validation
See ApplicationFirewall and Check for more information on soft validation.

Parameters:
aId - optional, since when adding new records the id is unknown.
aName - is required, 1..100 characters; enter as natural text, such as 'Jet Engine', with a space.
aDescription - is optional, 1..1000 characters.
aIsRequired - is optional; required fields are tested for non-nullity in the Model Object.
aType - is required, defines the FieldType, the java class used to represent the field
aControlStyle - is required, defines the ControlStyle, the HTML control used to enter the field value.
aIsPrimaryKey - is optional; only one field in the feature should be the primary key.
aMinimum - is optional, cannot be greater than aMaximum.
aMaximum - is optional, cannot be less than aMinimum.
aNumDecimals - is optional, integer, 1 or more.
aErrorMessage - is optional, the error message displayed when the user inputs an invalid value, 1..200 characters
aIsHardValidatedForLength - is optional.
aHardValidationPattern - is optional, regular expression, 1..200 characters.
aCheckPattern - is optional, regular expression, 1..200 characters.
aCheckEmail - is optional, true only if this field contains an email address.
aCheckSpam - is optional, true only if this is a text field that should be checked for spam.
aIsOrderByField - is optional, true only if this is the field by which listings should be sorted; only one field in the feature should be the ORDER BY field.
aIsDescendingOrder - is optional, and takes effect only if this is the ORDER BY field.
aCodeTable - is optional, and is the name of an application-scope code table; applies only if aControlStyle is SELECT or RADIO;
Throws:
ModelCtorException
Method Detail

getId

public Id getId()

getName

public String getName()

getDescription

public String getDescription()

getIsRequired

public Boolean getIsRequired()

getType

public FieldType getType()

getControlStyle

public ControlStyle getControlStyle()

getIsPrimaryKey

public Boolean getIsPrimaryKey()

getMinimum

public Integer getMinimum()

getMaximum

public Integer getMaximum()

getNumDecimals

public Integer getNumDecimals()

getErrorMessage

public String getErrorMessage()

getIsHardValidatedForLength

public Boolean getIsHardValidatedForLength()

getHardValidationPattern

public String getHardValidationPattern()

getCheckPattern

public String getCheckPattern()

getCheckEmail

public Boolean getCheckEmail()

getCheckSpam

public Boolean getCheckSpam()

getIsOrderByField

public Boolean getIsOrderByField()

getIsDescendingOrder

public Boolean getIsDescendingOrder()

getCodeTable

public String getCodeTable()

getSortOrder

public SortOrder getSortOrder()
Return the SortOrder calculated from getIsOrderByField() and getIsDescendingOrder().


toString

public String toString()
Intended for debugging only.

Overrides:
toString in class Object

equals

public boolean equals(Object aThat)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

WEB4J Development Tools 4.10.0.0

Copyright Hirondelle Systems - Generated 2013Oct19.12.26