public class FieldWrapper extends Object implements Field
Field instance.
To implement a modifiable field, you need to override the setters too.| Modifier and Type | Field and Description |
|---|---|
protected Field |
field |
STATE_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| Constructor and Description |
|---|
FieldWrapper(Field field) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Field f) |
DataType<?> |
getDataType()
Returns the data type this field contains.
|
String |
getDescription()
Returns the description of this object for the default locale.
|
String |
getDescription(Locale locale)
Returns the description of this object.
|
int |
getEditPosition()
Retrieve the position of the field when editing.
|
Field |
getField() |
String |
getGUIName()
Returns the GUI name for this object.
|
String |
getGUIName(Locale locale)
Returns the GUI name for this object in a specified preferred language.
|
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.
|
int |
getListPosition()
Retrieve the position of the field when listing.
|
LocalizedString |
getLocalizedDescription()
Returns the set of (localized) descriptions of this object.
|
LocalizedString |
getLocalizedGUIName()
Returns the set of (localized) gui names of this object.
|
int |
getMaxLength()
Returns the maximum length of data this field can contain.
|
String |
getName()
Returns the name or 'key' of this object, or
null if not applicable. |
NodeManager |
getNodeManager()
Returns the node manager this field belongs to.
|
int |
getSearchPosition()
Retrieve the position of the field when searching.
|
int |
getState()
Returns this field's state identifier (virtual, persistent, system, systemvirtual).
|
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.
|
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 'read only' - that is, a user cannot edit it.
|
boolean |
isRequired()
Returns whether this field is required (should have content).
|
boolean |
isUnique()
Returns whether this field is part of a unique key (a set of fields whose combined content should
occur only once).
|
boolean |
isVirtual()
A field's state is 'virtual' if it is not persistent in storage.
|
void |
setDescription(String description)
Sets the description of this object for the default locale.
|
void |
setDescription(String description,
Locale locale)
Sets the description of this object.
|
void |
setGUIName(String g)
Sets the GUI name of this object for the default locale.
|
void |
setGUIName(String g,
Locale locale)
Sets the GUI name of this object.
|
String |
toString() |
Collection<String> |
validate(Object value)
Checks whether a given value is valid for this field.
|
protected final Field field
public FieldWrapper(Field field)
public NodeManager getNodeManager()
FieldgetNodeManager in interface Fieldpublic int getState()
Fieldpublic DataType<?> getDataType()
FieldgetDataType in interface FieldDataType object describing the constraints on this field.public boolean isUnique()
Fieldpublic boolean hasIndex()
Fieldpublic int getType()
FieldgetDataType.getBaseType() instead.public int getListItemType()
FieldgetListItemType in interface Fieldint which identifies the base typepublic int getSearchPosition()
FieldgetSearchPosition in interface Fieldpublic int getListPosition()
FieldgetListPosition in interface Fieldpublic int getEditPosition()
FieldgetEditPosition in interface Fieldpublic int getStoragePosition()
FieldgetStoragePosition in interface Fieldpublic String getGUIType()
FieldgetGUIType in interface FieldField.getDataType()public boolean isRequired()
FieldisRequired in interface Fieldtrue if the field is requiredpublic int getMaxLength()
FieldgetMaxLength in interface Fieldpublic Collection<String> validate(Object value)
Fieldpublic boolean isVirtual()
Fieldpublic boolean isReadOnly()
FieldisReadOnly in interface Fieldtrue when a field is read onlypublic String getName()
Descriptornull if not applicable.getName in interface Descriptorpublic String getGUIName()
DescriptorgetGUIName in interface Descriptorpublic String getGUIName(Locale locale)
DescriptorgetGUIName in interface Descriptorlocale - the locale that determines the language for the GUI namepublic LocalizedString getLocalizedGUIName()
DescriptorgetLocalizedGUIName in interface Descriptorpublic void setGUIName(String g, Locale locale)
DescriptorsetGUIName in interface Descriptorg - the description as a Stringlocale - The locale for which this is valid, or null for the default locale.public void setGUIName(String g)
DescriptorsetGUIName in interface Descriptorg - the description as a Stringpublic LocalizedString getLocalizedDescription()
DescriptorgetLocalizedDescription in interface Descriptorpublic String getDescription(Locale locale)
DescriptorgetDescription in interface Descriptorlocale - The locale for which this must be returned, or null for a default locale.
If no fitting description for the given locale is available, getName() can be returned.public String getDescription()
DescriptorgetDescription in interface Descriptorpublic void setDescription(String description, Locale locale)
DescriptorsetDescription in interface Descriptordescription - the description as a Stringlocale - The locale for which this is valid, or null for a default locale.public void setDescription(String description)
DescriptorsetDescription in interface Descriptordescription - the description as a Stringpublic int compareTo(Field f)
compareTo in interface Comparable<Field>public Field getField()
MMBase 1.9-SNAPSHOT - ${javadoctimestamp}