|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.makumba.providers.datadefinition.mdd.DataDefinitionImpl
public class DataDefinitionImpl
Implementation of the DataDefinition
interface.
This implementation gets its data from a MDDNode
after parsing, and adds the necessary functionality to it.
Nested Class Summary | |
---|---|
protected static class |
DataDefinitionImpl.TitleFieldType
the type of the title expression |
Nested classes/interfaces inherited from interface org.makumba.DataDefinition |
---|
DataDefinition.MultipleUniqueKeyDefinition, DataDefinition.QueryFragmentFunction |
Field Summary | |
---|---|
static String |
ENUM_FIELD_NAME
|
protected String |
fieldNameInParent
name of the parent field, for ptrOne and setComplex |
protected LinkedHashMap<String,FieldDefinition> |
fields
|
protected QueryFragmentFunctions |
functions
|
protected String |
indexName
name of the index field |
protected boolean |
isFileSubfield
indicator if this is MDD is a file subfield |
protected LinkedHashMap<Object,DataDefinition.MultipleUniqueKeyDefinition> |
multiFieldUniqueList
|
protected String |
name
name of the data definition |
protected URL |
origin
origin of the data definition |
protected DataDefinition |
parent
parent MDD of the subfield |
protected String |
ptrSubfield
pointer to the subfield, for construction of subfield names dynamically |
protected String |
setMemberFieldName
name of the enumerator field, for setIntEnum and charIntEnum |
protected String |
setOwnerFieldName
name of the field that holds the relational pointer to the parent field |
protected String |
titleField
the title field |
protected String |
titleFieldExpr
the original title expression |
protected DataDefinitionImpl.TitleFieldType |
titleFieldType
|
protected LinkedHashMap<String,ValidationRule> |
validationRules
|
Fields inherited from interface org.makumba.DataDefinition |
---|
createName, modifyName |
Constructor Summary | |
---|---|
DataDefinitionImpl(MDDNode mdd)
constructor for data definitions during parsing |
|
DataDefinitionImpl(String name)
make a virtual data definition |
|
DataDefinitionImpl(String name,
DataDefinitionImpl parent)
constructor for virtual subfield data definitions, like file |
|
DataDefinitionImpl(String fieldName,
MDDNode mdd,
DataDefinition parent)
constructor for subfield data definitions during parsing |
Method Summary | |
---|---|
void |
addField(FieldDefinition fd)
methods related to fields |
void |
addFunctions(HashMap<String,DataDefinition.QueryFragmentFunction> funcNames)
|
void |
addMultiUniqueKey(DataDefinition.MultipleUniqueKeyDefinition definition)
methods related to multiple uniqueness keys |
void |
addRule(String fieldName,
Collection<ValidationRule> rules)
Add several rules for the given field. |
void |
addRule(String fieldName,
ValidationRule rule)
Add a new rule for the given field. |
protected void |
build()
Builds the DataDefinitionImpl based on the MDDNode . |
void |
checkFieldNames(Dictionary<String,Object> d)
methods for checks |
void |
checkUpdate(String fieldName,
Dictionary<String,Object> d)
Checks whether a record can be updated * |
String |
getCreationDateFieldName()
which is the name of the creation timestamp field, if any? |
DataDefinition |
getDataDefinition()
Get the data definition associated with this validation definition. |
FieldDefinition |
getFieldDefinition(int n)
the field with the respective index, null if such a field doesn't exist |
FieldDefinition |
getFieldDefinition(String name)
the field with the respective name, null if such a field doesn't exist |
Vector<String> |
getFieldNames()
the names of the fields declared in this data definition, in the order of declaration |
FieldDefinition |
getFieldOrPointedFieldDefinition(String nm)
returns the field info associated with a name |
DataDefinition.QueryFragmentFunction |
getFunctionOrPointedFunction(String nm)
returns the field info associated with a name |
QueryFragmentFunctions |
getFunctions()
returns all functions in this data definition. |
String |
getIndexPointerFieldName()
which is the name of the index field, if any? |
String |
getLastModificationDateFieldName()
which is the name of the modification timestamp field, if any? |
DataDefinition.MultipleUniqueKeyDefinition[] |
getMultiFieldUniqueKeys()
Get all multiple-feld uniqueness definition. |
String |
getName()
base methods |
FieldDefinition |
getParentField()
If this type is the data pointed by a 1-1 pointer or subset (ptrOne and setComplex), return the type of the main record, otherwise return null |
ArrayList<FieldDefinition> |
getReferenceFields()
Gets all the fields that are references to other tables, i.e. pointers and some types of sets. |
String |
getSetMemberFieldName()
The name of the set member (Pointer, Character or Integer), for set subtypes |
String |
getSetOwnerFieldName()
The name of the pointer to the main table, for set and internal set subtypes |
String |
getStructure()
|
String |
getTitleFieldName()
The title field indicated, or the default one |
ArrayList<FieldDefinition> |
getUniqueFields()
Gets all the fields that have the unique modifier. |
ValidationDefinition |
getValidationDefinition()
methods for validation definitions |
ValidationRule |
getValidationRule(String ruleName)
Get the validation rule with the given rule name. |
Collection<ValidationRule> |
getValidationRules(String fieldName)
Get all validation rules for the given field name. |
boolean |
hasMultiUniqueKey(String[] fieldNames)
Check whether this data definition has a multi-field uniqe key defined with the given fields. |
boolean |
hasValidationRules()
|
boolean |
isTemporary()
tells whether this data definition was generated temporarily to depict a query result as opposed to being read from an MDD file |
long |
lastModified()
Indicates when the data definition was modified the last time |
String |
toString()
|
String |
toString1()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String ENUM_FIELD_NAME
protected String name
protected String ptrSubfield
protected String indexName
protected String titleField
protected String titleFieldExpr
protected DataDefinitionImpl.TitleFieldType titleFieldType
protected URL origin
protected DataDefinition parent
protected String fieldNameInParent
protected boolean isFileSubfield
protected String setMemberFieldName
protected String setOwnerFieldName
protected LinkedHashMap<String,FieldDefinition> fields
protected LinkedHashMap<String,ValidationRule> validationRules
protected LinkedHashMap<Object,DataDefinition.MultipleUniqueKeyDefinition> multiFieldUniqueList
protected QueryFragmentFunctions functions
Constructor Detail |
---|
public DataDefinitionImpl(String name)
public DataDefinitionImpl(String name, DataDefinitionImpl parent)
public DataDefinitionImpl(String fieldName, MDDNode mdd, DataDefinition parent)
public DataDefinitionImpl(MDDNode mdd)
Method Detail |
---|
protected void build()
DataDefinitionImpl
based on the MDDNode
. This step needs to be done separately, as a
MDD may refer to itself (through ptr or set).
public void addFunctions(HashMap<String,DataDefinition.QueryFragmentFunction> funcNames)
public String getName()
getName
in interface DataDefinition
getName
in interface ValidationDefinition
public String getTitleFieldName()
DataDefinition
getTitleFieldName
in interface DataDefinition
public boolean isTemporary()
DataDefinition
isTemporary
in interface DataDefinition
public long lastModified()
DataDefinition
lastModified
in interface DataDefinition
public DataDefinition getDataDefinition()
ValidationDefinition
getDataDefinition
in interface ValidationDefinition
public void addField(FieldDefinition fd)
addField
in interface DataDefinition
public FieldDefinition getFieldDefinition(String name)
DataDefinition
getFieldDefinition
in interface DataDefinition
public FieldDefinition getFieldDefinition(int n)
DataDefinition
getFieldDefinition
in interface DataDefinition
public Vector<String> getFieldNames()
DataDefinition
getFieldNames
in interface DataDefinition
public FieldDefinition getFieldOrPointedFieldDefinition(String nm)
getFieldOrPointedFieldDefinition
in interface DataDefinition
public DataDefinition.QueryFragmentFunction getFunctionOrPointedFunction(String nm)
getFunctionOrPointedFunction
in interface DataDefinition
public String getIndexPointerFieldName()
getIndexPointerFieldName
in interface DataDefinition
public ArrayList<FieldDefinition> getReferenceFields()
DataDefinition
getReferenceFields
in interface DataDefinition
public ArrayList<FieldDefinition> getUniqueFields()
DataDefinition
getUniqueFields
in interface DataDefinition
public void addMultiUniqueKey(DataDefinition.MultipleUniqueKeyDefinition definition)
addMultiUniqueKey
in interface DataDefinition
public boolean hasMultiUniqueKey(String[] fieldNames)
DataDefinition
hasMultiUniqueKey
in interface DataDefinition
public DataDefinition.MultipleUniqueKeyDefinition[] getMultiFieldUniqueKeys()
DataDefinition
getMultiFieldUniqueKeys
in interface DataDefinition
public void checkFieldNames(Dictionary<String,Object> d)
checkFieldNames
in interface DataDefinition
public void checkUpdate(String fieldName, Dictionary<String,Object> d)
DataDefinition
checkUpdate
in interface DataDefinition
public QueryFragmentFunctions getFunctions()
DataDefinition
getFunctions
in interface DataDefinition
public FieldDefinition getParentField()
getParentField
in interface DataDefinition
public String getSetMemberFieldName()
DataDefinition
getSetMemberFieldName
in interface DataDefinition
public String getSetOwnerFieldName()
DataDefinition
getSetOwnerFieldName
in interface DataDefinition
public ValidationDefinition getValidationDefinition()
getValidationDefinition
in interface DataDefinition
public void addRule(String fieldName, Collection<ValidationRule> rules)
ValidationDefinition
addRule
in interface ValidationDefinition
public void addRule(String fieldName, ValidationRule rule)
ValidationDefinition
addRule
in interface ValidationDefinition
public Collection<ValidationRule> getValidationRules(String fieldName)
ValidationDefinition
getValidationRules
in interface ValidationDefinition
public boolean hasValidationRules()
hasValidationRules
in interface ValidationDefinition
public ValidationRule getValidationRule(String ruleName)
ValidationDefinition
getValidationRule
in interface ValidationDefinition
public String getCreationDateFieldName()
getCreationDateFieldName
in interface DataDefinition
public String getLastModificationDateFieldName()
getLastModificationDateFieldName
in interface DataDefinition
public String toString()
toString
in class Object
public String toString1()
public String getStructure()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |