|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Objectorg.makumba.providers.datadefinition.mdd.FieldDefinitionImpl
public class FieldDefinitionImpl
| Field Summary | |
|---|---|
protected Vector<String> |
charEnumValues
|
protected Vector<String> |
charEnumValuesDeprecated
|
protected int |
charLength
|
protected String |
description
|
protected boolean |
fixed
|
protected LinkedHashMap<Integer,String> |
intEnumValues
|
protected LinkedHashMap<Integer,String> |
intEnumValuesDeprecated
|
protected DataDefinitionImpl |
mdd
|
protected String |
name
|
protected String |
NaNError
|
protected String |
notBooleanError
|
protected boolean |
notEmpty
|
protected String |
notEmptyError
|
protected String |
notIntError
|
protected boolean |
notNull
|
protected String |
notNullError
|
protected String |
notRealError
|
protected DataDefinition |
pointed
|
protected String |
pointedType
|
protected DataDefinitionImpl |
subfield
|
protected FieldType |
type
|
protected boolean |
unique
|
protected String |
uniqueError
|
| 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 | |
|---|---|
FieldDefinitionImpl(DataDefinitionImpl mdd,
FieldNode f)
constructor used when creating the DataDefinitionImpl during parsing |
|
FieldDefinitionImpl(String name,
DataDefinitionImpl dd)
Minimal constructor for standard fields |
|
FieldDefinitionImpl(String name,
FieldDefinition fi)
for virtual FieldDefinition |
|
FieldDefinitionImpl(String name,
FieldDefinition field,
String description)
for virtual field definitions |
|
FieldDefinitionImpl(String name,
String type)
Creates a field definition given a name and a type |
|
FieldDefinitionImpl(String name,
String type,
DataDefinitionImpl mdd)
|
|
FieldDefinitionImpl(String name,
String type,
String description)
Creates a field definition given a name, type and description |
|
| Method Summary | |
|---|---|
void |
addValidationRule(Collection<ValidationRule> rules)
methods for validation rules |
void |
addValidationRule(ValidationRule rule)
Adds a new validation rule to this field. |
boolean |
base_isAssignableFrom(FieldDefinition fi)
|
void |
checkInsert(Dictionary<String,Object> d)
methods for checks (assignability) |
void |
checkUpdate(Dictionary<String,Object> d)
check if the corresponding field from the dictionary can be updated |
Object |
checkValue(Object value)
check if the value can be assigned |
DataDefinitionImpl |
getDataDefinition()
The data definition that contains this field definition |
String |
getDataType()
methods for types (java, sql, null) |
Date |
getDefaultDate()
methods for default values |
int |
getDefaultInt()
Get the default value as an integer. |
String |
getDefaultString()
Get the default value as a String. |
Object |
getDefaultValue()
returns the default value of this field |
Vector<String> |
getDeprecatedValues()
methods for enumerations |
String |
getDescription()
Returns field's description |
Object |
getEmptyValue()
The value returned in case there is no value in the database and no default value is indicated |
int |
getEnumeratorSize()
Get the number of the members of an enumerated field. |
DataDefinition |
getForeignTable()
methods for relational types |
int |
getIntAt(int i)
Get the integer at a certain position in an enumerated type. |
int |
getIntegerType()
returns the integer value associated with the field's internal makumba type. |
Class<?> |
getJavaType()
The Java type of this field. |
String |
getName()
The name of this field, normally the same with the name of the field |
String |
getNameAt(int i)
Get the name at a certain position in an enumerated field. |
String |
getNameFor(int i)
Get the name for a certain value of the enumerated field. |
Collection<String> |
getNames()
Get the names of an enumerated field. |
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()
The type referred. |
String |
getStructure()
|
DataDefinition |
getSubtable()
The subtype created by an immediate ptr or set definition. |
String |
getTitleField()
Get the alternative title field, if the title to be used is indicated specifically on a ptr or set. |
String |
getType()
Returns field's internal makumba type. |
Collection<ValidationRule> |
getValidationRules()
Returns all the validation rules connected to this field. |
Collection |
getValues()
Get the values of an enumerated field. |
int |
getWidth()
Get the maximum character width. |
boolean |
hasDescription()
Tells wether this field has a description in the MDD |
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()
methods for 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()
methods for modifiers |
protected Object |
normalCheck(Object value)
|
void |
setDefaultValue(Object defaultValue)
|
void |
setDescription(String description)
|
void |
setFixed(boolean fixed)
|
void |
setName(String name)
methods for base fields |
void |
setNotEmpty(boolean notEmpty)
|
void |
setNotNull(boolean notNull)
|
void |
setType(String type)
|
void |
setUnique(boolean unique)
|
boolean |
shouldEditBySingleInput()
Indicates whether this field should be edited by a simple mak:input, or needs it's own form. |
String |
toString()
|
String |
toString1()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected DataDefinitionImpl mdd
protected String name
protected FieldType type
protected String description
protected boolean fixed
protected boolean notNull
protected boolean notEmpty
protected boolean unique
protected String notNullError
protected String NaNError
protected String uniqueError
protected String notEmptyError
protected String notIntError
protected String notRealError
protected String notBooleanError
protected LinkedHashMap<Integer,String> intEnumValues
protected LinkedHashMap<Integer,String> intEnumValuesDeprecated
protected Vector<String> charEnumValues
protected Vector<String> charEnumValuesDeprecated
protected int charLength
protected String pointedType
protected transient DataDefinition pointed
protected DataDefinitionImpl subfield
| Constructor Detail |
|---|
public FieldDefinitionImpl(String name,
String type,
String description)
name - the name of the fieldtype - the type of the filed, e.g. char, int, ptr - but no relational type definitiondescription - the description of the field
public FieldDefinitionImpl(String name,
DataDefinitionImpl dd)
public FieldDefinitionImpl(String name,
String type)
name - the name of the fieldtype - the type of the filed, e.g. char, int, ptr - but no relational type definition
public FieldDefinitionImpl(String name,
String type,
DataDefinitionImpl mdd)
public FieldDefinitionImpl(String name,
FieldDefinition fi)
public FieldDefinitionImpl(String name,
FieldDefinition field,
String description)
public FieldDefinitionImpl(DataDefinitionImpl mdd,
FieldNode f)
DataDefinitionImpl during parsing
| Method Detail |
|---|
public void setName(String name)
public String getName()
FieldDefinition
getName in interface FieldDefinitionpublic void setType(String type)
public void setDescription(String description)
public void setFixed(boolean fixed)
public void setNotNull(boolean notNull)
public void setNotEmpty(boolean notEmpty)
public void setUnique(boolean unique)
public void setDefaultValue(Object defaultValue)
public String getDescription()
FieldDefinition
getDescription in interface FieldDefinitionpublic boolean hasDescription()
FieldDefinition
hasDescription in interface FieldDefinitionpublic DataDefinitionImpl getDataDefinition()
FieldDefinition
getDataDefinition in interface FieldDefinitionpublic boolean isUnique()
isUnique in interface FieldDefinitionpublic boolean isFixed()
FieldDefinition
isFixed in interface FieldDefinitionpublic boolean isNotEmpty()
FieldDefinition
isNotEmpty in interface FieldDefinitionpublic boolean isNotNull()
FieldDefinition
isNotNull in interface FieldDefinitionpublic boolean isBinaryType()
isBinaryType in interface FieldDefinitionpublic boolean isBooleanType()
FieldDefinition
isBooleanType in interface FieldDefinitionpublic boolean isComplexSet()
FieldDefinition
isComplexSet in interface FieldDefinitionpublic boolean isDateType()
FieldDefinition
isDateType in interface FieldDefinitionpublic boolean isEnumType()
FieldDefinition
isEnumType in interface FieldDefinitionpublic boolean isExternalSet()
FieldDefinition
isExternalSet in interface FieldDefinitionpublic boolean isFileType()
FieldDefinition
isFileType in interface FieldDefinitionpublic boolean isIndexPointerField()
FieldDefinitionDataDefinition it belongs to.
isIndexPointerField in interface FieldDefinitionpublic boolean isIntegerType()
FieldDefinition
isIntegerType in interface FieldDefinitionpublic boolean isInternalSet()
FieldDefinition
isInternalSet in interface FieldDefinitionpublic boolean isNumberType()
FieldDefinition
isNumberType in interface FieldDefinitionpublic boolean isPointer()
FieldDefinition
isPointer in interface FieldDefinitionpublic boolean isRealType()
FieldDefinition
isRealType in interface FieldDefinitionpublic boolean isSetEnumType()
FieldDefinition
isSetEnumType in interface FieldDefinitionpublic boolean isSetType()
FieldDefinition
isSetType in interface FieldDefinitionpublic boolean isStringType()
FieldDefinition
isStringType in interface FieldDefinitionpublic void addValidationRule(Collection<ValidationRule> rules)
addValidationRule in interface FieldDefinitionpublic void addValidationRule(ValidationRule rule)
FieldDefinition
addValidationRule in interface FieldDefinitionpublic Collection<ValidationRule> getValidationRules()
FieldDefinition
getValidationRules in interface FieldDefinitionpublic void checkInsert(Dictionary<String,Object> d)
checkInsert in interface FieldDefinitionpublic void checkUpdate(Dictionary<String,Object> d)
FieldDefinition
checkUpdate in interface FieldDefinitionpublic Object checkValue(Object value)
FieldDefinition
checkValue in interface FieldDefinitionprotected Object normalCheck(Object value)
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 getDataType()
getDataType in interface FieldDefinitionpublic Class<?> getJavaType()
FieldDefinition
getJavaType in interface FieldDefinitionpublic int getIntegerType()
FieldDefinition
getIntegerType in interface FieldDefinitionpublic Object getNull()
FieldDefinition
getNull in interface FieldDefinitionpublic Object getEmptyValue()
FieldDefinition
getEmptyValue in interface FieldDefinitionpublic String getType()
FieldDefinition
getType in interface FieldDefinitionpublic boolean isDefaultField()
FieldDefinition
isDefaultField in interface FieldDefinitionpublic Date getDefaultDate()
getDefaultDate in interface FieldDefinitionpublic int getDefaultInt()
FieldDefinition
getDefaultInt in interface FieldDefinitionpublic String getDefaultString()
FieldDefinition
getDefaultString in interface FieldDefinitionpublic Object getDefaultValue()
getDefaultValue in interface FieldDefinitionpublic Vector<String> getDeprecatedValues()
getDeprecatedValues in interface FieldDefinitionpublic int getEnumeratorSize()
FieldDefinition
getEnumeratorSize in interface FieldDefinitionpublic int getIntAt(int i)
FieldDefinition
getIntAt in interface FieldDefinitionpublic String getNameAt(int i)
FieldDefinition
getNameAt in interface FieldDefinitionpublic String getNameFor(int i)
FieldDefinition
getNameFor in interface FieldDefinitionpublic Collection<String> getNames()
FieldDefinition
getNames in interface FieldDefinitionpublic Collection getValues()
FieldDefinition
getValues in interface FieldDefinitionpublic DataDefinition getForeignTable()
getForeignTable in interface FieldDefinitionpublic FieldDefinition getOriginalFieldDefinition()
FieldDefinition
getOriginalFieldDefinition in interface FieldDefinitionpublic DataDefinition getPointedType()
FieldDefinition
getPointedType in interface FieldDefinitionpublic DataDefinition getSubtable()
FieldDefinition
getSubtable in interface FieldDefinitionpublic String getTitleField()
FieldDefinition
getTitleField in interface FieldDefinitionDataDefinition.getTitleFieldName()public int getWidth()
FieldDefinition
getWidth in interface FieldDefinitionpublic boolean shouldEditBySingleInput()
FieldDefinition
shouldEditBySingleInput in interface FieldDefinitionpublic String toString()
toString in class Objectpublic String toString1()
public String getStructure()
public String getNotANumberErrorMessage()
FieldDefinition
getNotANumberErrorMessage in interface FieldDefinitionpublic String getNotNullErrorMessage()
FieldDefinition
getNotNullErrorMessage in interface FieldDefinitionpublic String getNotUniqueErrorMessage()
FieldDefinition
getNotUniqueErrorMessage in interface FieldDefinitionpublic String getNotEmptyErrorMessage()
FieldDefinition
getNotEmptyErrorMessage in interface FieldDefinitionpublic String getNotIntErrorMessage()
FieldDefinition
getNotIntErrorMessage in interface FieldDefinitionpublic String getNotRealErrorMessage()
FieldDefinition
getNotRealErrorMessage in interface FieldDefinitionpublic String getNotBooleanErrorMessage()
FieldDefinition
getNotBooleanErrorMessage in interface FieldDefinition
|
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||