public abstract class AbstractField<D> extends AbstractDescriptor implements Field
| Modifier and Type | Field and Description |
|---|---|
protected DataType<D> |
dataType |
protected int |
listItemType |
protected boolean |
readOnly |
protected int |
state |
protected int |
type |
description, guiName, keySTATE_PERSISTENT, STATE_SYSTEM, STATE_SYSTEM_VIRTUAL, STATE_UNKNOWN, STATE_VIRTUAL, TYPE_BINARY, TYPE_BOOLEAN, TYPE_BYTE, TYPE_DATETIME, TYPE_DECIMAL, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INTEGER, TYPE_LIST, TYPE_LONG, TYPE_NODE, TYPE_STRING, TYPE_UNKNOWN, TYPE_XML| Modifier | Constructor and Description |
|---|---|
protected |
AbstractField(String name,
Field field)
Create a field object based on another field.
|
protected |
AbstractField(String name,
Field field,
boolean cloneDataForRewrite)
Create a field object based on another field.
|
protected |
AbstractField(String name,
int type,
int listItemType,
int state,
DataType<D> dataType)
Create a field object
|
| Modifier and Type | Method and Description |
|---|---|
AbstractField |
clone() |
AbstractField |
clone(String name,
boolean copyDataTypeForRewrite) |
int |
compareTo(Field f) |
boolean |
equals(Object o)
Whether data type equals to other data type.
|
DataType |
getDataType()
Returns the data type this field contains.
|
abstract int |
getEditPosition()
Retrieve the position of the field when editing.
|
abstract String |
getGUIType()
Returns the GUI name for the data type this field contains.
|
int |
getListItemType()
If the type of this field is TYPE_LIST, this method returns the MMBase base type for the list elements.
|
abstract int |
getListPosition()
Retrieve the position of the field when listing.
|
abstract int |
getMaxLength()
Returns the maximum length of data this field can contain.
|
abstract NodeManager |
getNodeManager()
Returns the node manager this field belongs to.
|
abstract int |
getSearchPosition()
Retrieve the position of the field when searching.
|
int |
getState()
Returns this field's state identifier (virtual, persistent, system, systemvirtual).
|
abstract int |
getStoragePosition()
Retrieve the position of the field in the database table.
|
int |
getType()
Returns the identifier for the MMBase base type for this field.
|
int |
hashCode() |
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.
|
boolean |
isReadOnly()
Returns whether a field is a read only.
|
boolean |
isRequired()
Returns whether this field is required (should have content).
|
boolean |
isTemporary()
Returns whether a field is a temporary field.
|
boolean |
isUnique()
Retrieve whether the field is a key and thus need be unique.
|
boolean |
isVirtual()
A field's state is 'virtual' if it is not persistent in storage.
|
void |
setDataType(DataType<D> dataType)
Sets the datatype of a field.
|
void |
setState(int state) |
String |
toString()
Returns a description for this field.
|
clone, getDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUINamefinalize, getClass, notify, notifyAll, wait, wait, waitgetDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUINameprotected int type
protected int state
protected int listItemType
protected boolean readOnly
protected AbstractField(String name, Field field)
name - the name of the fieldfield - the parent fieldprotected AbstractField(String name, Field field, boolean cloneDataForRewrite)
name - the name of the fieldfield - the parent fieldcloneDataForRewrite - determines whether the datatype of the parent field is copied (which means it can be altered
without affecting the original datatype)protected AbstractField(String name, int type, int listItemType, int state, DataType<D> dataType)
name - the name of the fieldtype - the identifier for the MMBase base type for this fieldlistItemType - If the type of this field is TYPE_LIST, then this is the MMBase base type for the list elements.state - identifier (virtual, persistent, system, systemvirtual)dataType - the data type of the fieldpublic abstract NodeManager getNodeManager()
FieldgetNodeManager in interface Fieldpublic int compareTo(Field f)
compareTo in interface Comparable<Field>public boolean equals(Object o)
public final int getState()
Fieldpublic void setState(int state)
public int getType()
FieldgetDataType.getBaseType() instead.public int getListItemType()
FieldgetListItemType in interface Fieldint which identifies the base typepublic DataType getDataType()
FieldgetDataType in interface FieldDataType object describing the constraints on this field.public void setDataType(DataType<D> dataType) throws IllegalArgumentException
dataType - IllegalArgumentExceptiongetType()public boolean hasIndex()
Fieldpublic abstract int getSearchPosition()
FieldgetSearchPosition in interface Fieldpublic abstract int getListPosition()
FieldgetListPosition in interface Fieldpublic abstract int getEditPosition()
FieldgetEditPosition in interface Fieldpublic abstract int getStoragePosition()
FieldgetStoragePosition in interface Fieldpublic boolean isUnique()
public abstract int getMaxLength()
FieldgetMaxLength in interface Fieldpublic boolean isRequired()
FieldisRequired in interface Fieldtrue if the field is requiredField.isRequired()public boolean isVirtual()
FieldisVirtual in interface Fieldtrue when a field is virtualField.isVirtual()public boolean isTemporary()
true when temporarypublic boolean isReadOnly()
isReadOnly in interface Fieldtrue when read onlyField.isVirtual()public abstract String getGUIType()
FieldgetGUIType in interface FieldField.getDataType()public String toString()
toString in class AbstractDescriptorpublic AbstractField clone()
clone in interface PublicCloneable<AbstractDescriptor>clone in class AbstractDescriptorpublic AbstractField clone(String name, boolean copyDataTypeForRewrite)
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}