public class CoreField extends AbstractField<Object> implements Field, Storable
dataType, listItemType, readOnly, state, typedescription, 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 |
|---|---|
|
CoreField(Field field)
Creates a CoreField object based on a more generic 'Field'.
|
protected |
CoreField(String name,
CoreField coreField)
Copy constructor.
|
protected |
CoreField(String name,
int type,
int listItemType,
int state,
DataType dataType)
Create a core object
|
| Modifier and Type | Method and Description |
|---|---|
CoreField |
clone() |
CoreField |
clone(String name) |
int |
compareTo(Field o)
Compare this object to the supplied one (should be a CoreField)
|
boolean |
equals(Object o)
Whether data type equals to other data type.
|
void |
finish()
Finishes this encapsulated DataType with current field.
|
int |
getEditPosition()
Retrieve the position of the field when editing.
|
String |
getGUIType()
Retrieve the GUI type of the field.
|
int |
getListPosition()
Retrieve the position of the field when listing.
|
int |
getMaxLength()
Returns the (maximum) size of this field, as determined by the storage layer.
|
NodeManager |
getNodeManager()
Returns the node manager this field belongs to.
|
MMObjectBuilder |
getParent()
Retrieves the parent builder for this field
|
int |
getSearchPosition()
Retrieve the position of the field when searching.
|
Object |
getStorageIdentifier()
Returns a storage identifier for this object.
|
int |
getStoragePosition()
Retrieve the position of the field in the database table.
|
int |
getStorageType()
Retrieves the storage type.
|
int |
hashCode() |
boolean |
inStorage()
Returns whether an object is (or, for a new object, should be) defined in the storage.
|
boolean |
isNotNull() |
void |
rewrite() |
void |
setDataType(DataType dataType)
Sets the datatype of a field.
|
void |
setEditPosition(int i)
Set the position of the field when editing.
|
void |
setListItemType(int listItemType) |
void |
setListPosition(int i)
Set the position of the field when listing.
|
void |
setMaxLength(int size) |
void |
setNotNull(boolean nl) |
void |
setParent(MMObjectBuilder parent)
Set the parent builder for this field
|
void |
setReadOnly(boolean readOnly) |
void |
setSearchPosition(int i)
Set the position of the field when searching.
|
void |
setState(int state) |
void |
setStoragePosition(int i)
Set the position of the field in the database table.
|
void |
setStorageType(int type)
Sets the storage type.
|
void |
setType(int type) |
void |
setUnique(boolean unique) |
boolean |
storageEquals(CoreField f)
Whether this CoreField is equal to another for storage purposes (so, ignoring gui and documentation fields)
|
String |
toString()
Returns a description for this field.
|
Collection<String> |
validate(Object value)
Checks whether a given value is valid for this field.
|
clone, getDataType, getListItemType, getState, getType, hasIndex, isReadOnly, isRequired, isTemporary, isUnique, isVirtualgetDefaultLocale, getDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUIName, setLocalizedDescription, setLocalizedGUINamefinalize, getClass, notify, notifyAll, wait, wait, waitgetDataType, getListItemType, getState, getType, hasIndex, isReadOnly, isRequired, isUnique, isVirtualgetDescription, getDescription, getGUIName, getGUIName, getLocalizedDescription, getLocalizedGUIName, getName, setDescription, setDescription, setGUIName, setGUINamepublic CoreField(Field field)
protected CoreField(String name, int type, int listItemType, int state, DataType dataType)
name - the name of the data typedataType - the data type for this fieldpublic NodeManager getNodeManager()
FieldgetNodeManager in interface FieldgetNodeManager in class AbstractField<Object>public final CoreField clone()
clone in interface PublicCloneable<AbstractDescriptor>clone in class AbstractField<Object>public CoreField clone(String name)
clone in class AbstractDescriptorpublic void setReadOnly(boolean readOnly)
public void setNotNull(boolean nl)
public boolean isNotNull()
public int getSearchPosition()
getSearchPosition in interface FieldgetSearchPosition in class AbstractField<Object>public void setSearchPosition(int i)
getSearchPosition()public int getListPosition()
getListPosition in interface FieldgetListPosition in class AbstractField<Object>public void setListPosition(int i)
getListPosition()public int getEditPosition()
getEditPosition in interface FieldgetEditPosition in class AbstractField<Object>public void setEditPosition(int i)
getEditPosition()public int getStoragePosition()
getStoragePosition in interface FieldgetStoragePosition in class AbstractField<Object>public void setStoragePosition(int i)
public MMObjectBuilder getParent()
public void setParent(MMObjectBuilder parent)
parent - the parent builderpublic void setState(int state)
setState in class AbstractField<Object>public void setType(int type)
public void setListItemType(int listItemType)
public Collection<String> validate(Object value)
Fieldpublic boolean storageEquals(CoreField f)
public boolean equals(Object o)
AbstractFieldequals in class AbstractField<Object>o - the reference object with which to compare.Object.equals(java.lang.Object)public int hashCode()
hashCode in class AbstractField<Object>Object.hashCode()public int compareTo(Field o)
compareTo in interface Comparable<Field>compareTo in class AbstractField<Object>o - the object to compare topublic void finish()
IllegalStateException - If the datatype is already finishedpublic void rewrite()
public int getMaxLength()
getMaxLength in interface FieldgetMaxLength in class AbstractField<Object>public void setMaxLength(int size)
public void setDataType(DataType dataType) throws IllegalArgumentException
AbstractFieldsetDataType in class AbstractField<Object>IllegalArgumentExceptionAbstractField.getType()public void setUnique(boolean unique)
public Object getStorageIdentifier() throws StorageException
StorageManagerFactory.getStorageIdentifier() when it is first instantiated.getStorageIdentifier in interface StorableStorageExceptionpublic int getStorageType()
StorablegetStorageType in interface Storablepublic void setStorageType(int type)
StorablesetStorageType in interface Storabletype - the value to setpublic boolean inStorage()
Storablefalse.public String getGUIType()
getGUIType in interface FieldgetGUIType in class AbstractField<Object>Field.getDataType()public String toString()
AbstractFieldtoString in class AbstractField<Object>MMBase 1.9-SNAPSHOT - ${javadoctimestamp}