Package ch.tocco.nice2.model.entity.api
Interface FieldModel
- All Superinterfaces:
 ModelElement,ModuleTracker
- All Known Implementing Classes:
 DefaultFieldModel,FieldModelImpl
The model of one 
Entity Model's field.
 The backendData is of type FieldModelInfo.
- 
Method Summary
Modifier and TypeMethodDescriptionvoidaddDocumentation(String definingModule, String documentation) Adds documentation for theFieldModel, contributed by the definingAppModule.Get the base field of a localized field.Returns the DefaultValueDescriptor.Returns the content of the documentation element of theFieldModeltag as aLinkedHashMap, divided by theAppModules extending the baseFieldModeland contributing the documentation.@Nullable DisplayValuegetLabel()getName()Returns the entity field name; the name attribute of the field tag in xml.Returns the internal field name, eg db table field name; the target attribute of the field tag in xml.Type<?> getType()booleanbooleanWhen a binary field is changed, a dialog is shown to the user to update all other binary fields which contain the same binary data.booleanisKey()Tells if this field is the or part of the primary key.booleanTells if this field is multilingual.booleanbooleanTells if the field accepts the null value to be stored in it.booleanbooleanbooleanisUnique()Tells if the field's values are unique (i.e.booleanbooleanvoidsetBaseField(FieldModel baseField) Set the base field for synthetic localized fields.voidsetBinaryReplacementDisabled(boolean disabled) voidsetDefaultValue(Object descriptor) voidsetLabel(DisplayValue display) voidsetLocalized(boolean flag) voidvoidsetNullable(boolean nullable) voidsetPrivilegedAccessOnly(boolean privilegedAccessOnly) voidsetSynthetic(boolean synthetic) voidvoidvoidsetUnique(boolean unique) voidsetValidator(AndGroupValidator validator) Sets the primary validator which may contain real validation validators and other groups.voidsetVirtual(boolean virtual) voidsetXssFilter(boolean xssFilter) Methods inherited from interface ch.tocco.nice2.model.entity.api.ModuleTracker
addExtendingModule, getDefiningModule, getExtendingModules, setDefiningModule 
- 
Method Details
- 
getName
String getName()Returns the entity field name; the name attribute of the field tag in xml. - 
getTarget
String getTarget()Returns the internal field name, eg db table field name; the target attribute of the field tag in xml. - 
isNullable
boolean isNullable()Tells if the field accepts the null value to be stored in it.Key fieldsare never nullable. - 
isUnique
boolean isUnique()Tells if the field's values are unique (i.e. a value may only exists once)- Returns:
 - true if the field's values are unique
 
 - 
isKey
boolean isKey()Tells if this field is the or part of the primary key.It has nothing to do with indexed fields, nor with foreign keys.
 - 
isVirtual
boolean isVirtual() - 
isSynthetic
boolean isSynthetic() - 
getType
Type<?> getType()- Returns:
 - Returns the nice Type object which for example represents a string.
 
 - 
getDefaultValue
Object getDefaultValue()Returns the DefaultValueDescriptor. This is the dynamic default value that can be defined on the entity as well as on the form.The reason that this signature returns 'Object' is because the interface cannot be seen.
- Returns:
 - instance of DefaultValueDescriptor
 
 - 
setNullable
void setNullable(boolean nullable) - Parameters:
 nullable- true/false- Throws:
 IllegalStateException- when trying to set this value after reading the mode.- See Also:
 
 - 
setUnique
void setUnique(boolean unique) - Parameters:
 unique- true/false
 - 
setVirtual
void setVirtual(boolean virtual)  - 
setSynthetic
void setSynthetic(boolean synthetic)  - 
setName
- Parameters:
 name- the name, non-null- Throws:
 IllegalStateException- when trying to set this value after reading the mode.- See Also:
 
 - 
setTarget
- Parameters:
 target- the target- Throws:
 IllegalStateException- when trying to set this value after reading the mode.- See Also:
 
 - 
setType
- Parameters:
 type- the type- Throws:
 IllegalStateException- when trying to set this value after reading the mode.- See Also:
 
 - 
setDefaultValue
 - 
hasNonEmptyValidator
boolean hasNonEmptyValidator()- Returns:
 - Tells if this field model has a validator, a GroupValidator to be precise, which has at least one entry.
 - See Also:
 
 - 
getValidator
GroupValidator getValidator()- Returns:
 - Returns the outermost group validator which may be empty.
 - See Also:
 
 - 
setValidator
Sets the primary validator which may contain real validation validators and other groups.Method for the startup process.
- Parameters:
 validator- The group validator.
 - 
getLabel
- Returns:
 - The label of this field.
 
 - 
setLabel
- Parameters:
 display- the display, non-null- Throws:
 IllegalStateException- when trying to set this value after reading the mode.- See Also:
 
 - 
getDocumentation
LinkedHashMap<String,String> getDocumentation()Returns the content of the documentation element of theFieldModeltag as aLinkedHashMap, divided by theAppModules extending the baseFieldModeland contributing the documentation. The contents of the map are ordered according to the loading sequence of theAppModules.- Returns:
 - The 
LinkedHashMapcontaing theFieldModel's documentation tag. 
 - 
addDocumentation
Adds documentation for theFieldModel, contributed by the definingAppModule.- Parameters:
 definingModule- the string representation of theAppModulecontributing the documentationdocumentation- the documentation for theFieldModel
 - 
setLocalized
void setLocalized(boolean flag) - Parameters:
 flag-trueto make it a multilingual field,falseto not.
 - 
isLocalized
boolean isLocalized()Tells if this field is multilingual. If it is then this field model most likely has siblings; for every system language there is such a field model for the same field.- See Also:
 
 - 
setXssFilter
void setXssFilter(boolean xssFilter)  - 
isXssFilter
boolean isXssFilter() - 
setBaseField
Set the base field for synthetic localized fields. - 
getBaseField
Optional<FieldModel> getBaseField()Get the base field of a localized field. If the field we're currently working on is localized andgetBaseField()doesn't return a field, then it might already be the base field.- Returns:
 - the base field of the localized field.
 - See Also:
 
 - 
isMandatory
boolean isMandatory()- Returns:
 - true if a MandatoryValidator is registered for the underlying field and thus the field is mandatory
 
 - 
isBinaryReplacementDisabled
boolean isBinaryReplacementDisabled()When a binary field is changed, a dialog is shown to the user to update all other binary fields which contain the same binary data. If this boolean flag ist set to `true`, the dialog won't show up if this field is changed. The default value for this flag is `false`. - 
setBinaryReplacementDisabled
void setBinaryReplacementDisabled(boolean disabled)  - 
isPrivilegedAccessOnly
boolean isPrivilegedAccessOnly() - 
setPrivilegedAccessOnly
void setPrivilegedAccessOnly(boolean privilegedAccessOnly)  
 -