|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectorg.makumba.providers.datadefinition.makumba.FieldInfo
public class FieldInfo
This is a structure containing the elementary data about a field: name, type, attributes, description, and other type-specific extra info. All this information is available through the associated FieldHandler
| Field Summary | |
|---|---|
(package private) DataDefinition |
dd
|
(package private) Object |
defaultValue
|
(package private) String |
description
|
static Date |
emptyDate
|
(package private) static Object |
emptyInt
|
(package private) static Object |
emptyReal
|
(package private) Object |
extra1
|
(package private) Object |
extra2
|
(package private) Object |
extra3
|
(package private) boolean |
fixed
|
(package private) static org.apache.commons.collections.bidimap.DualHashBidiMap |
integerTypeMap
|
(package private) String |
name
|
(package private) boolean |
notEmpty
|
(package private) boolean |
notNull
|
(package private) String |
type
|
(package private) boolean |
unique
|
| Fields inherited from interface org.makumba.FieldDefinition |
|---|
_binary, _boolean, _char, _charEnum, _date, _dateCreate, _dateModify, _file, _int, _intEnum, _nil, _ptr, _ptrIndex, _ptrOne, _ptrRel, _real, _set, _setCharEnum, _setComplex, _setIntEnum, _text, ERROR_NOT_EMPTY, ERROR_NOT_NULL, ERROR_NOT_UNIQUE |
| Constructor Summary | |
|---|---|
FieldInfo(DataDefinition ri,
String name)
|
|
FieldInfo(FieldInfo fi)
|
|
FieldInfo(String name,
FieldInfo fi)
for temporary field info |
|
FieldInfo(String name,
String t)
|
|
| Method Summary | |
|---|---|
void |
addValidationRule(Collection<ValidationRule> rules)
adds several new validation rules to this field. |
void |
addValidationRule(ValidationRule rule)
Adds a new validation rule to this field. |
Object |
base_checkValue(Object value)
check if the value can be assigned |
boolean |
base_isAssignableFrom(FieldDefinition fi)
|
Object |
check_binary_ValueImpl(Object value)
|
Object |
check_boolean_ValueImpl(Object value)
|
Object |
check_char_ValueImpl(Object value)
|
Object |
check_charEnum_ValueImpl(Object value)
|
Object |
check_date_ValueImpl(Object value)
|
Object |
check_int_ValueImpl(Object value)
|
Object |
check_intEnum_ValueImpl(Object value)
|
Object |
check_ptrIndex_ValueImpl(Object value)
|
Object |
check_real_ValueImpl(Object value)
|
Object |
check_set_ValueImpl(Object value)
|
Object |
check_setcharEnum_ValueImpl(Object value)
|
Object |
check_setComplex_ValueImpl(Object value)
|
Object |
check_setintEnum_Value(Object value)
|
Object |
check_text_ValueImpl(Object value)
|
void |
checkInsert(Dictionary<String,Object> d)
check if the value can be assigned |
void |
checkUpdate(Dictionary<String,Object> d)
check if the value can be assigned |
Object |
checkValue(Object value)
check if the value can be assigned |
Object |
checkValueImpl(Object value)
|
Vector<String> |
get_intEnum_DeprecatedValues()
|
String |
get_intEnum_NameFor(int n)
|
String |
get_ptr_TitleField()
|
DataDefinition |
get_ptrIndex_PointedType()
|
DataDefinition |
get_ptrOne_PointedType()
|
DataDefinition |
get_ptrOne_Subtable()
|
DataDefinition |
get_ptrRel_ForeignTable()
|
DataDefinition |
get_ptrRel_PointedType()
|
DataDefinition |
get_set_ForeignTable()
|
DataDefinition |
get_set_Subtable()
|
DataDefinition |
getDataDefinition()
The data definition that contains this field definition |
String |
getDataName()
the data field this handler is associated to |
String |
getDataType()
The data type of this field. |
Date |
getDefaultDate()
works only for date type |
int |
getDefaultInt()
works only for int, intEnum, setintEnum types |
String |
getDefaultString()
works only for char, text, binary, charEnum, setcharEnum types |
Object |
getDefaultValue()
returns the default value of this field |
Vector<String> |
getDeprecatedValues()
Get deprecated values of the enumerator, works only for intEnum type. |
String |
getDescription()
returns field's description, if present. |
Object |
getEmptyValue()
the value returned in case there is no value in the database and no default value is indicated |
(package private) FieldInfo |
getEnum()
|
int |
getEnumeratorSize()
works only for intEnum, charEnum, setintEnum, setcharEnum types |
static FieldInfo |
getFieldInfo(String name,
Object type,
boolean typeSearch)
|
static FieldInfo |
getFieldInfo(String name,
Object type,
boolean typeSearch,
String description)
|
DataDefinition |
getForeignTable()
works only for ptr, ptrRel and set types |
int |
getIntAt(int i)
works only for intEnum, setintEnum types |
int |
getIntegerType()
returns field type's integer value |
Class<?> |
getJavaType()
The Java type of this field. |
String |
getName()
the name of this handler, normally the same with the name of the field |
String |
getNameAt(int i)
works only for intEnum, charEnum, setintEnum, setcharEnum types |
String |
getNameFor(int i)
works only for intEnum type |
Enumeration<String> |
getNames()
works only for intEnum, charEnum, setintEnum, setcharEnum types |
Object |
getNull()
The null value for this type |
FieldDefinition |
getOriginalFieldDefinition()
The original field definition this field definition was made of, used e.g. in form responders. |
DataDefinition |
getPointedType()
works only for all pointer and set types |
String |
getStringAt(int i)
works only for intEnum, charEnum, setintEnum, setcharEnum types |
static String |
getStringType(int integerType)
|
DataDefinition |
getSubtable()
works only for ptrOne, set, setComplex, setcharEnum and setintEnum types |
String |
getTitleField()
works only for ptr and set types |
String |
getType()
returns field's type |
Collection<ValidationRule> |
getValidationRules()
Returns all the validation rules connected to this field. |
Enumeration |
getValues()
works only for intEnum, charEnum, setintEnum, setcharEnum types |
int |
getWidth()
works only for char, charEnum, setcharEnum types |
boolean |
has_ptr_TitleFieldIndicated()
|
boolean |
hasDescription()
tells whether this field has a description originally |
boolean |
hasTitleFieldIndicated()
works only for ptr and set types |
boolean |
is_int_AssignableFrom(FieldDefinition fi)
|
boolean |
is_intEnum_AssignableFrom(FieldDefinition fi)
|
boolean |
is_ptrRel_AssignableFrom(FieldDefinition fi)
|
boolean |
is_real_AssignableFrom(FieldDefinition fi)
|
boolean |
is_set_AssignableFrom(FieldDefinition fi)
|
boolean |
isAssignableFrom(FieldDefinition fi)
check compatibility with the given type |
boolean |
isBinaryType()
returns whether this field is a binary type. |
boolean |
isComplexSet()
returns whether this field is a setComplex. |
boolean |
isDateType()
returns whether this field is a date type, i.e. date, or the default fields dateCreate and dateModify. |
boolean |
isDefaultField()
returns whether this field is a default field generated by makumba. |
boolean |
isEnumType()
returns whether this field is a simple enum type, i.e. intEnum or charEnum. |
boolean |
isExternalSet()
returns whether this field is an external set, i.e. set ptr, but not setIntEnum, not setCharEnum nor setComplex. |
boolean |
isFileType()
returns whether this field is a file type. |
boolean |
isFixed()
tells whether this field is fixed |
boolean |
isIndexPointerField()
Indicates whether this field is the index pointer field of the DataDefinition it belongs to. |
boolean |
isIntegerType()
returns whether this field is an integer type. |
boolean |
isInternalSet()
returns whether this field is any kind of internal set type, i.e. set, setIntEnum, setCharEnum and setComplex, but not set. |
boolean |
isNotEmpty()
tells whether this field is not empty |
boolean |
isNotNull()
tells whether this field is not null |
boolean |
isNumberType()
returns whether this field is a number type, i.e. int or real. |
boolean |
isPointer()
returns whether this field is a pointer. |
boolean |
isRealType()
returns whether this field is a real type. |
boolean |
isSetEnumType()
returns whether this field is a set enum type, i.e. setIntEnum or setCharEnum. |
boolean |
isSetType()
returns whether this field is a set type, i.e. set, setIntEnum or setCharEnum or setComplex. |
boolean |
isStringType()
returns whether this field is a string type, i.e. char or text. |
boolean |
isUnique()
tells whether this field is unique |
protected Object |
normalCheck(Object value)
|
(package private) FieldDefinition |
pointerToForeign()
|
boolean |
shouldEditBySingleInput()
Indicates whether this field should be edited by a simple mak:input, or needs it's own form. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
DataDefinition dd
static final org.apache.commons.collections.bidimap.DualHashBidiMap integerTypeMap
String name
String type
boolean fixed
boolean notNull
boolean notEmpty
boolean unique
Object defaultValue
String description
Object extra1
Object extra2
Object extra3
public static final Date emptyDate
static final Object emptyInt
static final Object emptyReal
| Constructor Detail |
|---|
public FieldInfo(DataDefinition ri,
String name)
public FieldInfo(FieldInfo fi)
public FieldInfo(String name,
FieldInfo fi)
public FieldInfo(String name,
String t)
| Method Detail |
|---|
public DataDefinition getDataDefinition()
FieldDefinition
getDataDefinition in interface FieldDefinitionpublic FieldDefinition getOriginalFieldDefinition()
FieldDefinition
getOriginalFieldDefinition in interface FieldDefinition
public static FieldInfo getFieldInfo(String name,
Object type,
boolean typeSearch)
public static FieldInfo getFieldInfo(String name,
Object type,
boolean typeSearch,
String description)
public static String getStringType(int integerType)
public boolean isAssignableFrom(FieldDefinition fi)
FieldDefinition
isAssignableFrom in interface FieldDefinitionpublic boolean base_isAssignableFrom(FieldDefinition fi)
public boolean is_int_AssignableFrom(FieldDefinition fi)
public boolean is_intEnum_AssignableFrom(FieldDefinition fi)
public boolean is_ptrRel_AssignableFrom(FieldDefinition fi)
public boolean is_real_AssignableFrom(FieldDefinition fi)
public boolean is_set_AssignableFrom(FieldDefinition fi)
public String toString()
toString in class Objectpublic Object checkValue(Object value)
checkValue in interface FieldDefinitionpublic Object base_checkValue(Object value)
public Object check_setintEnum_Value(Object value)
public void checkInsert(Dictionary<String,Object> d)
checkInsert in interface FieldDefinitionpublic void checkUpdate(Dictionary<String,Object> d)
checkUpdate in interface FieldDefinitionpublic Vector<String> getDeprecatedValues()
getDeprecatedValues in interface FieldDefinitionVector, or null if called on other typespublic Vector<String> get_intEnum_DeprecatedValues()
public Object getEmptyValue()
getEmptyValue in interface FieldDefinitionpublic Object getNull()
FieldDefinition
getNull in interface FieldDefinitionpublic String getName()
getName in interface FieldDefinitionpublic final String getDataName()
public boolean hasDescription()
hasDescription in interface FieldDefinitionpublic String getDescription()
getDescription in interface FieldDefinitionpublic String getType()
getType in interface FieldDefinitionpublic boolean isIndexPointerField()
FieldDefinitionDataDefinition it belongs to.
isIndexPointerField in interface FieldDefinitionpublic int getIntegerType()
getIntegerType in interface FieldDefinitionpublic String getDataType()
FieldDefinition
getDataType in interface FieldDefinitionpublic Class<?> getJavaType()
FieldDefinition
getJavaType in interface FieldDefinitionpublic boolean isFixed()
isFixed in interface FieldDefinitionpublic boolean isNotNull()
isNotNull in interface FieldDefinitionpublic boolean isNotEmpty()
FieldDefinition
isNotEmpty in interface FieldDefinitionpublic boolean isUnique()
isUnique in interface FieldDefinitionpublic Object getDefaultValue()
getDefaultValue in interface FieldDefinitionpublic Enumeration getValues()
getValues in interface FieldDefinitionpublic Enumeration<String> getNames()
getNames in interface FieldDefinitionpublic int getEnumeratorSize()
getEnumeratorSize in interface FieldDefinitionpublic String getStringAt(int i)
getStringAt in interface FieldDefinitionpublic String getNameFor(int i)
getNameFor in interface FieldDefinitionpublic String get_intEnum_NameFor(int n)
public String getNameAt(int i)
getNameAt in interface FieldDefinitionpublic int getDefaultInt()
getDefaultInt in interface FieldDefinitionpublic int getIntAt(int i)
getIntAt in interface FieldDefinitionpublic String getDefaultString()
getDefaultString in interface FieldDefinitionpublic int getWidth()
getWidth in interface FieldDefinitionpublic Object checkValueImpl(Object value)
checkValueImpl in interface FieldDefinitionpublic Object check_char_ValueImpl(Object value)
public Object check_charEnum_ValueImpl(Object value)
public Object check_date_ValueImpl(Object value)
public Object check_int_ValueImpl(Object value)
public Object check_intEnum_ValueImpl(Object value)
public Object check_ptrIndex_ValueImpl(Object value)
public Object check_real_ValueImpl(Object value)
public Object check_set_ValueImpl(Object value)
public Object check_setcharEnum_ValueImpl(Object value)
public Object check_setComplex_ValueImpl(Object value)
public Object check_text_ValueImpl(Object value)
public Object check_binary_ValueImpl(Object value)
public Object check_boolean_ValueImpl(Object value)
FieldInfo getEnum()
public DataDefinition get_ptrOne_Subtable()
public Date getDefaultDate()
getDefaultDate in interface FieldDefinitionpublic DataDefinition getForeignTable()
getForeignTable in interface FieldDefinitionpublic DataDefinition get_ptrRel_ForeignTable()
public DataDefinition get_set_ForeignTable()
FieldDefinition pointerToForeign()
public DataDefinition getSubtable()
getSubtable in interface FieldDefinitionpublic DataDefinition get_set_Subtable()
public DataDefinition getPointedType()
getPointedType in interface FieldDefinitionpublic DataDefinition get_ptrIndex_PointedType()
public DataDefinition get_ptrOne_PointedType()
public DataDefinition get_ptrRel_PointedType()
public String getTitleField()
getTitleField in interface FieldDefinitionhasTitleFieldIndicated()public String get_ptr_TitleField()
public boolean hasTitleFieldIndicated()
hasTitleFieldIndicated in interface FieldDefinitionClassCastException - for other typespublic boolean has_ptr_TitleFieldIndicated()
protected Object normalCheck(Object value)
public boolean isDefaultField()
FieldDefinition
isDefaultField in interface FieldDefinitionpublic boolean shouldEditBySingleInput()
FieldDefinition
shouldEditBySingleInput in interface FieldDefinitionpublic boolean isDateType()
FieldDefinition
isDateType in interface FieldDefinitionpublic boolean isIntegerType()
FieldDefinition
isIntegerType in interface FieldDefinitionpublic boolean isRealType()
FieldDefinition
isRealType in interface FieldDefinitionpublic boolean isNumberType()
FieldDefinition
isNumberType in interface FieldDefinitionpublic boolean isBinaryType()
FieldDefinition
isBinaryType in interface FieldDefinitionpublic boolean isFileType()
FieldDefinition
isFileType in interface FieldDefinitionpublic boolean isSetType()
FieldDefinition
isSetType in interface FieldDefinitionpublic boolean isEnumType()
FieldDefinition
isEnumType in interface FieldDefinitionpublic boolean isSetEnumType()
FieldDefinition
isSetEnumType in interface FieldDefinitionpublic boolean isStringType()
FieldDefinition
isStringType in interface FieldDefinitionpublic boolean isInternalSet()
FieldDefinition
isInternalSet in interface FieldDefinitionpublic boolean isPointer()
FieldDefinition
isPointer in interface FieldDefinitionpublic boolean isExternalSet()
FieldDefinition
isExternalSet in interface FieldDefinitionpublic boolean isComplexSet()
FieldDefinition
isComplexSet in interface FieldDefinitionpublic void addValidationRule(Collection<ValidationRule> rules)
FieldDefinition
addValidationRule in interface FieldDefinitionpublic void addValidationRule(ValidationRule rule)
FieldDefinition
addValidationRule in interface FieldDefinitionpublic Collection<ValidationRule> getValidationRules()
FieldDefinition
getValidationRules in interface FieldDefinition
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||