|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.bridge.util.FieldWrapper
public class FieldWrapper
Wraps another Field (and makes it unmodifiable). You can use this if you want to implement Field, and want to base that
implementation on a existing Field instance.
To implement a modifiable field, you need to override the setters too.
| Field Summary | |
|---|---|
protected Field |
field
|
| Fields inherited from interface org.mmbase.bridge.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 Summary | |
|---|---|
FieldWrapper(Field field)
|
|
| Method Summary | |
|---|---|
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 ( Field.STATE_VIRTUAL, Field.STATE_PERSISTENT, Field.STATE_SYSTEM or
Field.STATE_SYSTEM_VIRTUAL, in errorneous sitations it may return Field.STATE_UNKNOWN) |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final Field field
| Constructor Detail |
|---|
public FieldWrapper(Field field)
| Method Detail |
|---|
public NodeManager getNodeManager()
Field
getNodeManager in interface Fieldpublic int getState()
FieldField.STATE_VIRTUAL, Field.STATE_PERSISTENT, Field.STATE_SYSTEM or
Field.STATE_SYSTEM_VIRTUAL, in errorneous sitations it may return Field.STATE_UNKNOWN)
getState in interface Fieldint which identifies the state of this fieldField.isReadOnly();public DataType<?> getDataType()
Field
getDataType in interface FieldDataType object describing the constraints on this field.public boolean isUnique()
Field
isUnique in interface Fieldtrue if the field is part of a unique keypublic boolean hasIndex()
Field
hasIndex in interface Fieldtrue if the field has a key definedpublic int getType()
FieldgetDataType.getBaseType() instead.
getType in interface Fieldint which identifies the base typepublic int getListItemType()
Field
getListItemType in interface Fieldint which identifies the base typepublic int getSearchPosition()
Field
getSearchPosition in interface Fieldpublic int getListPosition()
Field
getListPosition in interface Fieldpublic int getEditPosition()
Field
getEditPosition in interface Fieldpublic int getStoragePosition()
Field
getStoragePosition in interface Fieldpublic String getGUIType()
Field
getGUIType in interface FieldField.getDataType()public boolean isRequired()
Field
isRequired in interface Fieldtrue if the field is requiredpublic int getMaxLength()
Field
getMaxLength in interface Fieldpublic Collection<String> validate(Object value)
Field
validate in interface Fieldvalue - value to validate
public boolean isVirtual()
Field
isVirtual in interface Fieldtrue when a field is virtualpublic boolean isReadOnly()
Field
isReadOnly in interface Fieldtrue when a field is read onlypublic String getName()
Descriptornull if not applicable.
getName in interface Descriptorpublic String getGUIName()
Descriptor
getGUIName in interface Descriptorpublic String getGUIName(Locale locale)
Descriptor
getGUIName in interface Descriptorlocale - the locale that determines the language for the GUI name
public LocalizedString getLocalizedGUIName()
Descriptor
getLocalizedGUIName in interface Descriptor
public void setGUIName(String g,
Locale locale)
Descriptor
setGUIName 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)
Descriptor
setGUIName in interface Descriptorg - the description as a Stringpublic LocalizedString getLocalizedDescription()
Descriptor
getLocalizedDescription in interface Descriptorpublic String getDescription(Locale locale)
Descriptor
getDescription 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()
Descriptor
getDescription in interface Descriptor
public void setDescription(String description,
Locale locale)
Descriptor
setDescription 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)
Descriptor
setDescription in interface Descriptordescription - the description as a Stringpublic int compareTo(Field f)
compareTo in interface Comparable<Field>public Field getField()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||