|
|
|||||||||||
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 fieldpublic 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 definitionpublic 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 FieldDefinition
public 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 FieldDefinition
public boolean hasDescription()
FieldDefinition
hasDescription
in interface FieldDefinition
public DataDefinitionImpl getDataDefinition()
FieldDefinition
getDataDefinition
in interface FieldDefinition
public boolean isUnique()
isUnique
in interface FieldDefinition
public boolean isFixed()
FieldDefinition
isFixed
in interface FieldDefinition
public boolean isNotEmpty()
FieldDefinition
isNotEmpty
in interface FieldDefinition
public boolean isNotNull()
FieldDefinition
isNotNull
in interface FieldDefinition
public boolean isBinaryType()
isBinaryType
in interface FieldDefinition
public boolean isBooleanType()
FieldDefinition
isBooleanType
in interface FieldDefinition
public boolean isComplexSet()
FieldDefinition
isComplexSet
in interface FieldDefinition
public boolean isDateType()
FieldDefinition
isDateType
in interface FieldDefinition
public boolean isEnumType()
FieldDefinition
isEnumType
in interface FieldDefinition
public boolean isExternalSet()
FieldDefinition
isExternalSet
in interface FieldDefinition
public boolean isFileType()
FieldDefinition
isFileType
in interface FieldDefinition
public boolean isIndexPointerField()
FieldDefinition
DataDefinition
it belongs to.
isIndexPointerField
in interface FieldDefinition
public boolean isIntegerType()
FieldDefinition
isIntegerType
in interface FieldDefinition
public boolean isInternalSet()
FieldDefinition
isInternalSet
in interface FieldDefinition
public boolean isNumberType()
FieldDefinition
isNumberType
in interface FieldDefinition
public boolean isPointer()
FieldDefinition
isPointer
in interface FieldDefinition
public boolean isRealType()
FieldDefinition
isRealType
in interface FieldDefinition
public boolean isSetEnumType()
FieldDefinition
isSetEnumType
in interface FieldDefinition
public boolean isSetType()
FieldDefinition
isSetType
in interface FieldDefinition
public boolean isStringType()
FieldDefinition
isStringType
in interface FieldDefinition
public void addValidationRule(Collection<ValidationRule> rules)
addValidationRule
in interface FieldDefinition
public void addValidationRule(ValidationRule rule)
FieldDefinition
addValidationRule
in interface FieldDefinition
public Collection<ValidationRule> getValidationRules()
FieldDefinition
getValidationRules
in interface FieldDefinition
public void checkInsert(Dictionary<String,Object> d)
checkInsert
in interface FieldDefinition
public void checkUpdate(Dictionary<String,Object> d)
FieldDefinition
checkUpdate
in interface FieldDefinition
public Object checkValue(Object value)
FieldDefinition
checkValue
in interface FieldDefinition
protected Object normalCheck(Object value)
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 getDataType()
getDataType
in interface FieldDefinition
public Class<?> getJavaType()
FieldDefinition
getJavaType
in interface FieldDefinition
public int getIntegerType()
FieldDefinition
getIntegerType
in interface FieldDefinition
public Object getNull()
FieldDefinition
getNull
in interface FieldDefinition
public Object getEmptyValue()
FieldDefinition
getEmptyValue
in interface FieldDefinition
public String getType()
FieldDefinition
getType
in interface FieldDefinition
public boolean isDefaultField()
FieldDefinition
isDefaultField
in interface FieldDefinition
public Date getDefaultDate()
getDefaultDate
in interface FieldDefinition
public int getDefaultInt()
FieldDefinition
getDefaultInt
in interface FieldDefinition
public String getDefaultString()
FieldDefinition
getDefaultString
in interface FieldDefinition
public Object getDefaultValue()
getDefaultValue
in interface FieldDefinition
public Vector<String> getDeprecatedValues()
getDeprecatedValues
in interface FieldDefinition
public int getEnumeratorSize()
FieldDefinition
getEnumeratorSize
in interface FieldDefinition
public int getIntAt(int i)
FieldDefinition
getIntAt
in interface FieldDefinition
public String getNameAt(int i)
FieldDefinition
getNameAt
in interface FieldDefinition
public String getNameFor(int i)
FieldDefinition
getNameFor
in interface FieldDefinition
public Collection<String> getNames()
FieldDefinition
getNames
in interface FieldDefinition
public Collection getValues()
FieldDefinition
getValues
in interface FieldDefinition
public DataDefinition getForeignTable()
getForeignTable
in interface FieldDefinition
public FieldDefinition getOriginalFieldDefinition()
FieldDefinition
getOriginalFieldDefinition
in interface FieldDefinition
public DataDefinition getPointedType()
FieldDefinition
getPointedType
in interface FieldDefinition
public DataDefinition getSubtable()
FieldDefinition
getSubtable
in interface FieldDefinition
public String getTitleField()
FieldDefinition
getTitleField
in interface FieldDefinition
DataDefinition.getTitleFieldName()
public int getWidth()
FieldDefinition
getWidth
in interface FieldDefinition
public boolean shouldEditBySingleInput()
FieldDefinition
shouldEditBySingleInput
in interface FieldDefinition
public String toString()
toString
in class Object
public String toString1()
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 |