|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 |
Collection<String> |
getNames()
works only for intEnum, charEnum, setintEnum, setcharEnum types FIXME this does not work, because of a ClassCastException when attempting to convert the extra2 informatino into a Vector of Strings |
String |
getNotANumberErrorMessage()
gets the error message for the not a number field constraint, if specified |
String |
getNotBooleanErrorMessage()
gets the error message for the not a boolean field constraint, if specified |
String |
getNotEmptyErrorMessage()
gets the error message for the not empty field constraint, if specified |
String |
getNotIntErrorMessage()
gets the error message for the not an int field constraint, if specified |
String |
getNotNullErrorMessage()
gets the error message for not null field, if specified |
String |
getNotRealErrorMessage()
gets the error message for the not a real field constraint, if specified |
String |
getNotUniqueErrorMessage()
gets the error message for the not unique field constraint, if specified |
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 |
static String |
getStringType(int integerType)
|
String |
getStructure()
|
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. |
Collection |
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 |
isBooleanType()
returns whether this field is a boolean 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 FieldDefinition
public 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 FieldDefinition
public 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 Object
public Object checkValue(Object value)
checkValue
in interface FieldDefinition
public Object base_checkValue(Object value)
public Object check_setintEnum_Value(Object value)
public void checkInsert(Dictionary<String,Object> d)
checkInsert
in interface FieldDefinition
public void checkUpdate(Dictionary<String,Object> d)
checkUpdate
in interface FieldDefinition
public Vector<String> getDeprecatedValues()
getDeprecatedValues
in interface FieldDefinition
Vector
, or null
if called on other typespublic Vector<String> get_intEnum_DeprecatedValues()
public Object getEmptyValue()
getEmptyValue
in interface FieldDefinition
public Object getNull()
FieldDefinition
getNull
in interface FieldDefinition
public String getName()
getName
in interface FieldDefinition
public final String getDataName()
public boolean hasDescription()
hasDescription
in interface FieldDefinition
public String getDescription()
getDescription
in interface FieldDefinition
public String getType()
getType
in interface FieldDefinition
public boolean isIndexPointerField()
FieldDefinition
DataDefinition
it belongs to.
isIndexPointerField
in interface FieldDefinition
public int getIntegerType()
getIntegerType
in interface FieldDefinition
public String getDataType()
FieldDefinition
getDataType
in interface FieldDefinition
public Class<?> getJavaType()
FieldDefinition
getJavaType
in interface FieldDefinition
public boolean isFixed()
isFixed
in interface FieldDefinition
public boolean isNotNull()
isNotNull
in interface FieldDefinition
public boolean isNotEmpty()
FieldDefinition
isNotEmpty
in interface FieldDefinition
public boolean isUnique()
isUnique
in interface FieldDefinition
public Object getDefaultValue()
getDefaultValue
in interface FieldDefinition
public Collection getValues()
getValues
in interface FieldDefinition
public Collection<String> getNames()
ClassCastException
when attempting to convert the extra2 informatino into a Vector of Strings
getNames
in interface FieldDefinition
public int getEnumeratorSize()
getEnumeratorSize
in interface FieldDefinition
public String getNameFor(int i)
getNameFor
in interface FieldDefinition
public String get_intEnum_NameFor(int n)
public String getNameAt(int i)
getNameAt
in interface FieldDefinition
public int getDefaultInt()
getDefaultInt
in interface FieldDefinition
public int getIntAt(int i)
getIntAt
in interface FieldDefinition
public String getDefaultString()
getDefaultString
in interface FieldDefinition
public int getWidth()
getWidth
in interface FieldDefinition
public Object checkValueImpl(Object value)
public 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 FieldDefinition
public DataDefinition getForeignTable()
getForeignTable
in interface FieldDefinition
public DataDefinition get_ptrRel_ForeignTable()
public DataDefinition get_set_ForeignTable()
FieldDefinition pointerToForeign()
public DataDefinition getSubtable()
getSubtable
in interface FieldDefinition
public DataDefinition get_set_Subtable()
public DataDefinition getPointedType()
getPointedType
in interface FieldDefinition
public DataDefinition get_ptrIndex_PointedType()
public DataDefinition get_ptrOne_PointedType()
public DataDefinition get_ptrRel_PointedType()
public String getTitleField()
getTitleField
in interface FieldDefinition
hasTitleFieldIndicated()
public String get_ptr_TitleField()
public boolean hasTitleFieldIndicated()
ClassCastException
- for other typespublic boolean has_ptr_TitleFieldIndicated()
protected Object normalCheck(Object value)
public boolean isDefaultField()
FieldDefinition
isDefaultField
in interface FieldDefinition
public boolean shouldEditBySingleInput()
FieldDefinition
shouldEditBySingleInput
in interface FieldDefinition
public boolean isDateType()
FieldDefinition
isDateType
in interface FieldDefinition
public boolean isIntegerType()
FieldDefinition
isIntegerType
in interface FieldDefinition
public boolean isRealType()
FieldDefinition
isRealType
in interface FieldDefinition
public boolean isNumberType()
FieldDefinition
isNumberType
in interface FieldDefinition
public boolean isBinaryType()
FieldDefinition
isBinaryType
in interface FieldDefinition
public boolean isBooleanType()
FieldDefinition
isBooleanType
in interface FieldDefinition
public boolean isFileType()
FieldDefinition
isFileType
in interface FieldDefinition
public boolean isSetType()
FieldDefinition
isSetType
in interface FieldDefinition
public boolean isEnumType()
FieldDefinition
isEnumType
in interface FieldDefinition
public boolean isSetEnumType()
FieldDefinition
isSetEnumType
in interface FieldDefinition
public boolean isStringType()
FieldDefinition
isStringType
in interface FieldDefinition
public boolean isInternalSet()
FieldDefinition
isInternalSet
in interface FieldDefinition
public boolean isPointer()
FieldDefinition
isPointer
in interface FieldDefinition
public boolean isExternalSet()
FieldDefinition
isExternalSet
in interface FieldDefinition
public boolean isComplexSet()
FieldDefinition
isComplexSet
in interface FieldDefinition
public void addValidationRule(Collection<ValidationRule> rules)
FieldDefinition
addValidationRule
in interface FieldDefinition
public void addValidationRule(ValidationRule rule)
FieldDefinition
addValidationRule
in interface FieldDefinition
public Collection<ValidationRule> getValidationRules()
FieldDefinition
getValidationRules
in interface FieldDefinition
public String getStructure()
public String getNotANumberErrorMessage()
FieldDefinition
getNotANumberErrorMessage
in interface FieldDefinition
public String getNotNullErrorMessage()
FieldDefinition
getNotNullErrorMessage
in interface FieldDefinition
public String getNotUniqueErrorMessage()
FieldDefinition
getNotUniqueErrorMessage
in interface FieldDefinition
public String getNotEmptyErrorMessage()
FieldDefinition
getNotEmptyErrorMessage
in interface FieldDefinition
public String getNotIntErrorMessage()
FieldDefinition
getNotIntErrorMessage
in interface FieldDefinition
public String getNotRealErrorMessage()
FieldDefinition
getNotRealErrorMessage
in interface FieldDefinition
public String getNotBooleanErrorMessage()
FieldDefinition
getNotBooleanErrorMessage
in interface FieldDefinition
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |