org.mmbase.bridge
Class Fields

java.lang.Object
  extended by org.mmbase.bridge.Fields
Direct Known Subclasses:
Fields

public class Fields
extends Object

Since:
MMBase-1.8
Version:
$Id: Fields.java 42556 2010-06-15 09:17:05Z michiel $

Field Summary
static int STATE_MAXVALUE
           
static int STATE_MINVALUE
           
static int TYPE_MAXVALUE
           
static int TYPE_MINVALUE
           
 
Constructor Summary
Fields()
           
 
Method Summary
static int classToType(Class classType)
          Determines the MMBase type of a specified class.
static Field createField(Cloud cloud, 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 Field createField(Cloud cloud, String name, int type, int listItemType, int state, DataType dataType)
           
static Field createSystemField(Cloud cloud, String name, int type)
           
static Map<String,Field> getFieldTypes(SearchQuery query, NodeManager nm)
           
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_MINVALUE

public static final int STATE_MINVALUE
See Also:
Constant Field Values

STATE_MAXVALUE

public static final int STATE_MAXVALUE
See Also:
Constant Field Values

TYPE_MINVALUE

public static final int TYPE_MINVALUE
See Also:
Constant Field Values

TYPE_MAXVALUE

public static final int TYPE_MAXVALUE
Constructor Detail

Fields

public Fields()
Method Detail

getTypeDescription

public static String getTypeDescription(int type)
Provide a description for the specified type. Useful for debugging, errors or presenting GUI info.

Parameters:
type - the type to get the description of
Returns:
the description of the type.

getStateDescription

public static String getStateDescription(int state)
Provide a description for the specified state. Useful for debugging, errors or presenting GUI info.

Parameters:
state - the state to get the description of
Returns:
the description of the state.

getState

public static int getState(String state)
Provide an id for the specified mmbase state description.

Parameters:
state - the state description to get the id of
Returns:
the id of the state.

getType

public static int getType(String type)
Provide an id for the specified mmbase type description

Parameters:
type - the type description to get the id of
Returns:
the id of the type.

classToType

public static int classToType(Class classType)
Determines the MMBase type of a specified class. The MMBase base type is sue by the storage layer to determine how to store a field. If the base type cannot be determined from the class, the value returned is Field.TYPE_UNKNOWN.

Parameters:
classType -
Returns:
an MMBase base type constant

typeToClass

public static Class typeToClass(int type)
Determines the class for a specified MMBase base type. If the value is Field.TYPE_UNKNOWN), the method returns null.

Parameters:
type -
Returns:
an MMBase base type constant

sort

public static void sort(List<? extends Field> fields,
                        int order)

getFieldTypes

public static Map<String,Field> getFieldTypes(SearchQuery query,
                                              NodeManager nm)

createSystemField

public static Field createSystemField(Cloud cloud,
                                      String name,
                                      int type)

createField

public static Field createField(Cloud cloud,
                                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).


createField

public static Field createField(Cloud cloud,
                                String name,
                                int type,
                                int listItemType,
                                int state,
                                DataType dataType)


MMBase 2.0-SNAPSHOT - null