public class Fields extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
STATE_MAXVALUE |
static int |
STATE_MINVALUE |
static int |
TYPE_MAXVALUE |
static int |
TYPE_MINVALUE |
| Constructor and Description |
|---|
Fields() |
| Modifier and Type | Method and Description |
|---|---|
static int |
classToType(Class classType)
Determines the MMBase type of a specified class.
|
static CoreField |
createField(String name,
int type,
int state,
DataType dataType)
Defaulting version of
createField(String, int int, int, DataType) (no list item type,
because it is nearly always irrelevant). |
static CoreField |
createField(String name,
int type,
int listItemType,
int state,
DataType dataType)
Returns an instance of a CoreField based on the type and state.
|
static CoreField |
createSystemField(String name,
int type)
Returns an instance of a CoreField based on the type, with state 'SYSTEM', and a basic datatype assigned.
|
static int |
getState(String state)
Provide an id for the specified mmbase state description.
|
static String |
getStateDescription(int state)
Provide a description for the specified state.
|
static int |
getType(String type)
Provide an id for the specified mmbase type description
|
static String |
getTypeDescription(int type)
Provide a description for the specified type.
|
static void |
sort(List<? extends Field> fields,
int order) |
static Class |
typeToClass(int type)
Determines the class for a specified MMBase base type.
|
public static final int STATE_MINVALUE
public static final int STATE_MAXVALUE
public static final int TYPE_MINVALUE
public static final int TYPE_MAXVALUE
public static CoreField createSystemField(String name, int type)
name - The name of the fieldtype - the MMBase basic field type, one of the Field TYPE constants. Specifying Field.TYPE_LIST,
may give unpredictable results.public static CoreField createField(String name, int type, int listItemType, int state, DataType dataType)
name - The name of the fieldtype - the MMBase basic field type, one of the Field TYPE constants.listItemType - the MMBase type for items of a list (if type is Field.TYPE_LIST).state - the MMBase field state, one of the Field STATE constants.dataType - the unfinished dataType to use for validating the field data. If null, a default datatype is assignedpublic static CoreField createField(String name, int type, int state, DataType dataType)
createField(String, int int, int, DataType) (no list item type,
because it is nearly always irrelevant).public static String getTypeDescription(int type)
type - the type to get the description ofpublic static String getStateDescription(int state)
state - the state to get the description ofpublic static int getState(String state)
state - the state description to get the id ofpublic static int getType(String type)
type - the type description to get the id ofpublic static int classToType(Class classType)
Field.TYPE_UNKNOWN.classType - public static Class typeToClass(int type)
Field.TYPE_UNKNOWN), the method returns null.type - MMBase 1.9-SNAPSHOT - ${javadoctimestamp}