|
WEB4J Development Tools 4.10.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objecthirondelle.web4jtools.codegenerator.field.Field
public final class Field
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 |
---|
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
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.
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 fieldaControlStyle
- 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 charactersaIsHardValidatedForLength
- 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;
ModelCtorException
Method Detail |
---|
public Id getId()
public String getName()
public String getDescription()
public Boolean getIsRequired()
public FieldType getType()
public ControlStyle getControlStyle()
public Boolean getIsPrimaryKey()
public Integer getMinimum()
public Integer getMaximum()
public Integer getNumDecimals()
public String getErrorMessage()
public Boolean getIsHardValidatedForLength()
public String getHardValidationPattern()
public String getCheckPattern()
public Boolean getCheckEmail()
public Boolean getCheckSpam()
public Boolean getIsOrderByField()
public Boolean getIsDescendingOrder()
public String getCodeTable()
public SortOrder getSortOrder()
SortOrder
calculated from getIsOrderByField()
and getIsDescendingOrder()
.
public String toString()
toString
in class Object
public boolean equals(Object aThat)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
WEB4J Development Tools 4.10.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |