Package overit.geocall.lang
Class ForeignField
java.lang.Object
overit.geocall.lang.ForeignField
- All Implemented Interfaces:
Serializable
This class defines a ForeignField, the object that represents the translation of a field name
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringString that defines the name of the ForeignFieldprotected intDefines the position of the fieldprotected booleanDefines if, according to what is defined in the dictionary, a translation is appropriate for output fields.protected booleanDefines if, according to what is defined in the dictionary, a translation is appropriate for output fields. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfindPosition(Map fieldMap) Sets the position attribute of the ForeignField, searching it in the fieldsMappassed as parameter, starting from the field name.voidfindPosition(DBView dbv) Sets the position attribute of the ForeignField, searching it in theDBViewpassed as parameter, starting from the field name and using theDBView.getFieldPos(java.lang.String)method.getName()retrieves the nameintget the positionpositionof the fieldbooleanChecks if the ForeignField has an invalid positionbooleanget the translated state of the fieldtranslatedbooleanget the translated state of the fieldtranslatedForEditingbooleanChecks if the ForeignField has an unknown positionbooleanChecks if the ForeignField has a valid position
-
Field Details
-
name
String that defines the name of the ForeignField -
translated
protected boolean translatedDefines if, according to what is defined in the dictionary, a translation is appropriate for output fields. If in the dictionary there is an entry like $FIELDNAME== this variables will be set to false (there is no translation for the field name but the field requires a static translation of its content, for the output). -
translatedForEditing
protected boolean translatedForEditingDefines if, according to what is defined in the dictionary, a translation is appropriate for output fields. If in the dictionary there is an entry like $FIELDNAME=- this variables will be set to false (there is no translation for the field name but the field requires a static translation of its content, even for the input). -
position
protected int positionDefines the position of the field
-
-
Constructor Details
-
ForeignField
Creates a ForeignField with the desired name- Parameters:
name- The name of the field
-
-
Method Details
-
getName
retrieves the name- Returns:
- the name
-
isTranslated
public boolean isTranslated()get the translated state of the fieldtranslated- Returns:
- the translated state of the field
translated
-
isTranslatedForEditing
public boolean isTranslatedForEditing()get the translated state of the fieldtranslatedForEditing- Returns:
- the translated state of the field
translatedForEditing
-
getPosition
public int getPosition()get the positionpositionof the field- Returns:
- the position
positionof the field
-
findPosition
Sets the position attribute of the ForeignField, searching it in the fieldsMappassed as parameter, starting from the field name. If in the map there isn't an entry with key equals to the ForeignField name, the position will be set to -1 (invalid position)- Parameters:
fieldMap- TheMapin which search the field position
-
findPosition
Sets the position attribute of the ForeignField, searching it in theDBViewpassed as parameter, starting from the field name and using theDBView.getFieldPos(java.lang.String)method. If the field does not exists in the DBView, the position will be set to -1 (invalid position)- Parameters:
dbv- TheDBViewin which search the field position
-
unknownPosition
public boolean unknownPosition()Checks if the ForeignField has an unknown position- Returns:
trueif the field has an unknown position,falseotherwise
-
validPosition
public boolean validPosition()Checks if the ForeignField has a valid position- Returns:
trueif the field has a valid position,falseotherwise
-
invalidPosition
public boolean invalidPosition()Checks if the ForeignField has an invalid position- Returns:
trueif the field has an invalid position,falseotherwise
-