org.mmbase.bridge
Interface Field

All Known Implementing Classes:
BasicField

public interface Field

This interface represents a node's field type information object.

Version:
$Id: Field.java,v 1.15 2003/11/26 17:58:27 michiel Exp $
Author:
Pierre van Rooden, Jaco de Groot

Field Summary
static int STATE_PERSISTENT
           
static int STATE_SYSTEM
           
static int STATE_UNKNOWN
           
static int STATE_VIRTUAL
           
static int TYPE_BYTE
           
static int TYPE_DOUBLE
           
static int TYPE_FLOAT
           
static int TYPE_INTEGER
           
static int TYPE_LONG
           
static int TYPE_NODE
           
static int TYPE_STRING
           
static int TYPE_UNKNOWN
           
static int TYPE_XML
           
 
Method Summary
 java.lang.String getDescription()
          Returns the description for this field.
 java.lang.String getDescription(java.util.Locale locale)
          Returns the description for this field in a specified preferred language.
 java.lang.String getGUIName()
          Returns the GUI name for this field.
 java.lang.String getGUIName(java.util.Locale locale)
          Returns the GUI name for this field in a specified preferred language.
 java.lang.String getGUIType()
          Returns the GUI name for the data type this field contains.
 int getMaxLength()
          Returns the maximum length of data this field can contain.
 java.lang.String getName()
          Returns the name of this field.
 NodeManager getNodeManager()
          Returns the node manager this field belongs to.
 int getState()
          Returns this field's state identifier.
 int getType()
          Returns the identifier for the data type this field contains.
 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 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).
 

Field Detail

STATE_VIRTUAL

public static final int STATE_VIRTUAL
See Also:
Constant Field Values

STATE_PERSISTENT

public static final int STATE_PERSISTENT
See Also:
Constant Field Values

STATE_SYSTEM

public static final int STATE_SYSTEM
See Also:
Constant Field Values

STATE_UNKNOWN

public static final int STATE_UNKNOWN
See Also:
Constant Field Values

TYPE_STRING

public static final int TYPE_STRING
See Also:
Constant Field Values

TYPE_INTEGER

public static final int TYPE_INTEGER
See Also:
Constant Field Values

TYPE_BYTE

public static final int TYPE_BYTE
See Also:
Constant Field Values

TYPE_FLOAT

public static final int TYPE_FLOAT
See Also:
Constant Field Values

TYPE_DOUBLE

public static final int TYPE_DOUBLE
See Also:
Constant Field Values

TYPE_LONG

public static final int TYPE_LONG
See Also:
Constant Field Values

TYPE_XML

public static final int TYPE_XML
See Also:
Constant Field Values

TYPE_NODE

public static final int TYPE_NODE
See Also:
Constant Field Values

TYPE_UNKNOWN

public static final int TYPE_UNKNOWN
See Also:
Constant Field Values
Method Detail

getNodeManager

public NodeManager getNodeManager()
Returns the node manager this field belongs to.

Returns:
the node manager this field belongs to

getName

public java.lang.String getName()
Returns the name of this field.

Returns:
the name of this field

getGUIType

public java.lang.String getGUIType()
Returns the GUI name for the data type this field contains.

Returns:
the GUI name for the data type this field contains

getGUIName

public java.lang.String getGUIName()
Returns the GUI name for this field.

Returns:
the GUI name for this field

getGUIName

public java.lang.String getGUIName(java.util.Locale locale)
Returns the GUI name for this field in a specified preferred language.

Parameters:
locale - the locale that determines the language for the GUI name
Returns:
the GUI name for this field
Since:
MMBase-1.7

getDescription

public java.lang.String getDescription()
Returns the description for this field.

Returns:
the description for this field

getDescription

public java.lang.String getDescription(java.util.Locale locale)
Returns the description for this field in a specified preferred language.

Parameters:
locale - the locale that determines the language for the description
Returns:
the description for this field
Since:
MMBase-1.7

getType

public int getType()
Returns the identifier for the data type this field contains.

Returns:
an int which identifies the type of data this field contains

getState

public int getState()
Returns this field's state identifier.

Returns:
an int which identifies the state of this field

isRequired

public boolean isRequired()
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.

Returns:
true if the field is required
Since:
MMBase-1.6

isUnique

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. If your storage implementation or configuration does not support this the uniqueness may not be enforced.

Returns:
true if the field is part of a unique key
Since:
MMBase-1.6

hasIndex

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. 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.

Returns:
true if the field has a key defined
Since:
MMBase-1.7

getMaxLength

public int getMaxLength()
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.

Returns:
the maximum length of data this field can contain


MMBase build 1.7.1.20041002