| org.mmbase.bridge.Field
All known Subclasses: org.mmbase.bridge.util.FieldWrapper, org.mmbase.core.CoreField, org.mmbase.bridge.implementation.BasicField, org.mmbase.core.AbstractField,
Field | public interface Field extends Descriptor,Comparable<Field>(Code) | | This interface represents a node's field type information object.
author: Pierre van Rooden author: Jaco de Groot version: $Id: Field.java,v 1.37 2007/02/10 15:47:42 nklasens Exp $ |
Method Summary | |
public DataType | getDataType() Returns the data type this field contains. | public int | getEditPosition() Retrieve the position of the field when editing. | public String | getGUIType() Returns the GUI name for the data type this field contains. | public int | getListItemType() If the type of this field is TYPE_LIST, this method returns the MMBase base type for the list elements.
This represents one of field type constants. | public int | getListPosition() Retrieve the position of the field when listing. | public int | getMaxLength() Returns the maximum length of data this field can contain. | public NodeManager | getNodeManager() Returns the node manager this field belongs to. | public int | getSearchPosition() Retrieve the position of the field when searching. | public int | getState() Returns this field's state identifier (virtual, persistent, system, systemvirtual). | public int | getStoragePosition() Retrieve the position of the field in the database table. | public int | getType() Returns the identifier for the MMBase base type for this field.
This represents one of field type constants. | public boolean | hasIndex() Returns whether this field is a key field, meaning that the storage layer should define an index for it, allowing
optimization with search and sort actions. | public boolean | isReadOnly() Returns whether a field is 'read only' - that is, a user cannot edit it. | public boolean | isRequired() Returns whether this field is required (should have content). | public boolean | isUnique() Returns whether this field is part of a unique key (a set of fields whose combined content should
occur only once).
Note that MMBase lets the storage layer handle this. | public boolean | isVirtual() A field's state is 'virtual' if it is not persistent in storage. | public java.util.Collection | validate(Object value) Checks whether a given value is valid for this field. |
STATE_PERSISTENT | final public static int STATE_PERSISTENT(Code) | | A field's state is 'persistent' if it is persistent in storage, and editable.
|
STATE_SYSTEM | final public static int STATE_SYSTEM(Code) | | A field's state is 'system' if it is persistent in storage, but not editable by users.
|
STATE_SYSTEM_VIRTUAL | final public static int STATE_SYSTEM_VIRTUAL(Code) | | A field's state is 'system virtual' if it is not persistent in storage, nor editable by users.
|
STATE_UNKNOWN | final public static int STATE_UNKNOWN(Code) | | The field's state when it is not (yet) known.
|
STATE_VIRTUAL | final public static int STATE_VIRTUAL(Code) | | A field's state is 'virtual' if it is not persistent in storage.
|
TYPE_BINARY | final public static int TYPE_BINARY(Code) | | MMBase base type identifier for the binary (byte[]) data type
|
TYPE_BOOLEAN | final public static int TYPE_BOOLEAN(Code) | | MMBase base type identifier for the Boolean data type
since: MMBase-1.8 |
TYPE_BYTE | final public static int TYPE_BYTE(Code) | | MMBase base type identifier for the binary (byte[]) data type
Field.TYPE_BINARY |
TYPE_DATETIME | final public static int TYPE_DATETIME(Code) | | MMBase base type identifier for the Date data type
since: MMBase-1.8 |
TYPE_DOUBLE | final public static int TYPE_DOUBLE(Code) | | MMBase base type identifier for the Double data type
|
TYPE_FLOAT | final public static int TYPE_FLOAT(Code) | | MMBase base type identifier for the Float data type
|
TYPE_INTEGER | final public static int TYPE_INTEGER(Code) | | MMBase base type identifier for the Integer data type
|
TYPE_LIST | final public static int TYPE_LIST(Code) | | MMBase base type identifier for the List data type
since: MMBase-1.8 |
TYPE_LONG | final public static int TYPE_LONG(Code) | | MMBase base type identifier for the Long data type
|
TYPE_NODE | final public static int TYPE_NODE(Code) | | MMBase base type identifier for the Node data type
|
TYPE_STRING | final public static int TYPE_STRING(Code) | | MMBase base type identifier for the String data type
|
TYPE_UNKNOWN | final public static int TYPE_UNKNOWN(Code) | | MMBase base type identifier for data types whose type is unknown
|
TYPE_XML | final public static int TYPE_XML(Code) | | MMBase base type identifier for the DOM Document data type
|
getDataType | public DataType getDataType()(Code) | | Returns the data type this field contains.
a DataType object describing the constraints on this field. since: MMBase-1.8 |
getEditPosition | public int getEditPosition()(Code) | | Retrieve the position of the field when editing.
A value of -1 indicates the field cannot be edited.
since: MMBase-1.8 |
getListItemType | public int getListItemType()(Code) | | If the type of this field is TYPE_LIST, this method returns the MMBase base type for the list elements.
This represents one of field type constants. This basic type determines how data is stored in MMBase.
For any field types other that TYPE_LIST, this method returns TYPE_UNKNOWN.
an int which identifies the base type |
getListPosition | public int getListPosition()(Code) | | Retrieve the position of the field when listing.
A value of -1 indicates the field is unavailable in a list.
since: MMBase-1.8 |
getMaxLength | public int getMaxLength()(Code) | | Returns the maximum length of data this field can contain.
For example if a field contains characters the size indicates the
maximum number of characters it can contain.
If the field is a numeric field (such as an integer), the result is -1.
the maximum length of data this field can contain |
getNodeManager | public NodeManager getNodeManager()(Code) | | Returns the node manager this field belongs to.
the node manager this field belongs to |
getSearchPosition | public int getSearchPosition()(Code) | | Retrieve the position of the field when searching.
A value of -1 indicates the field is unavailable during search.
since: MMBase-1.8 |
getState | public int getState()(Code) | | Returns this field's state identifier (virtual, persistent, system, systemvirtual).
an int which identifies the state of this field |
getStoragePosition | public int getStoragePosition()(Code) | | Retrieve the position of the field in the database table.
since: MMBase-1.8 |
getType | public int getType()(Code) | | Returns the identifier for the MMBase base type for this field.
This represents one of field type constants. This basic type determines how data is stored in MMBase.
Note that it is possible that the datatype for a field (used for validation and in/out put) can be of a different
basic type than how it is stored in the database. This shoudl not occur often, but is possible in some cases, such
as when you use older clod models (which used INTEGER fields for dates).
In general this should not prove a [problem - however you shoudl not assumeto know the classtype iof data of a
field based on this method.
To acquire the datatype's type, use getDataType.getBaseType() instead.
an int which identifies the base type |
hasIndex | public boolean hasIndex()(Code) | | Returns whether this field is a key field, meaning that the storage layer should define an index for it, allowing
optimization with search and sort actions.
Note that MMBase lets the storage layer decide whether an index is actually defined.
Some implementations or configurations may not do this.
Note: Currently, this method only returns true if the field is the primary key (number field) or a Node field.
true if the field has a key defined since: MMBase-1.7 |
isReadOnly | public boolean isReadOnly()(Code) | | Returns whether a field is 'read only' - that is, a user cannot edit it.
In general, fields with state SYSTEM or SYSTEM_VIRTUAL are defined as read only, while others are not.
It is possible to override this behaviour per field.
true when a field is read only since: MMBase-1.8 |
isRequired | public boolean isRequired()(Code) | | Returns whether this field is required (should have content).
Note that MMBase does not generally enforce required fields to be filled -
If not provided, a default value (generally an empty string or the integer value -1)
is filled in by the system.
As such, isRequired will mostly be used as an indicator for (generic) editors.
true if the field is required since: MMBase-1.6 |
isUnique | public boolean isUnique()(Code) | | Returns whether this field is part of a unique key (a set of fields whose combined content should
occur only once).
Note that MMBase lets the storage layer handle this. If your storage implementation or configuration does
not support this the uniqueness may not be enforced.
true if the field is part of a unique key since: MMBase-1.6 |
isVirtual | public boolean isVirtual()(Code) | | A field's state is 'virtual' if it is not persistent in storage.
true when a field is virtual since: MMBase-1.8 |
validate | public java.util.Collection validate(Object value)(Code) | | Checks whether a given value is valid for this field.
Collection of error-strings (describing the problem) in the current locale, or an empty collection if the value is ok. since: MMBase-1.8 |
|
|