Class FieldModelImpl
java.lang.Object
ch.tocco.nice2.model.entity.api.DefaultModelBase
ch.tocco.nice2.model.entity.api.DefaultFieldModel
ch.tocco.nice2.model.entity.impl.entity.FieldModelImpl
- All Implemented Interfaces:
FieldModel, ModelElement, ModuleTracker
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDocumentation(String definingModule, String documentation) Adds documentation for theFieldModel, contributed by the definingAppModule.voidaddExtendingModule(String moduleName) Get the base field of a localized field.Returns the name of the nice2 module, where this model element is defined.Returns the content of the documentation element of theFieldModeltag as aLinkedHashMap, divided by theAppModules extending the baseFieldModeland contributing the documentation.Returns a list of nice2 module names, that have contributed to this model element.@Nullable DisplayValuegetLabel()booleanWhen a binary field is changed, a dialog is shown to the user to update all other binary fields which contain the same binary data.booleanTells if this field is multilingual.booleanbooleanbooleanvoidsetBaseField(FieldModel baseField) Set the base field for synthetic localized fields.voidsetBinaryReplacementDisabled(boolean disabled) voidsetDefiningModule(String name) voidsetLabel(DisplayValue display) voidsetLocalized(boolean flag) voidsetPrivilegedAccessOnly(boolean privilegedAccessOnly) voidsetXssFilter(boolean xssFilter) Methods inherited from class DefaultFieldModel
getAdditionalToStringInfo, getDefaultValue, getName, getTarget, getType, getValidator, hasNonEmptyValidator, isKey, isNullable, isSynthetic, isUnique, isVirtual, setDefaultValue, setKey, setName, setNullable, setSynthetic, setTarget, setType, setUnique, setValidator, setVirtualMethods inherited from class DefaultModelBase
toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface FieldModel
getDefaultValue, getName, getTarget, getType, getValidator, hasNonEmptyValidator, isKey, isNullable, isSynthetic, isUnique, isVirtual, setDefaultValue, setName, setNullable, setSynthetic, setTarget, setType, setUnique, setValidator, setVirtual
-
Constructor Details
-
FieldModelImpl
public FieldModelImpl(boolean key)
-
-
Method Details
-
getExtendingModules
Description copied from interface:ModuleTrackerReturns a list of nice2 module names, that have contributed to this model element.- Specified by:
getExtendingModulesin interfaceModuleTracker
-
addExtendingModule
- Specified by:
addExtendingModulein interfaceModuleTracker
-
getDocumentation
Description copied from interface:FieldModelReturns 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.- Specified by:
getDocumentationin interfaceFieldModel- Returns:
- The
LinkedHashMapcontaing theFieldModel's documentation tag.
-
addDocumentation
Description copied from interface:FieldModelAdds documentation for theFieldModel, contributed by the definingAppModule.- Specified by:
addDocumentationin interfaceFieldModel- Parameters:
definingModule- the string representation of theAppModulecontributing the documentationdocumentation- the documentation for theFieldModel
-
getDefiningModule
Description copied from interface:ModuleTrackerReturns the name of the nice2 module, where this model element is defined.- Specified by:
getDefiningModulein interfaceModuleTracker
-
setDefiningModule
- Specified by:
setDefiningModulein interfaceModuleTracker
-
getLabel
- Specified by:
getLabelin interfaceFieldModel- Returns:
- The label of this field.
-
setLabel
- Specified by:
setLabelin interfaceFieldModel- Parameters:
display- the display, non-null- See Also:
-
setLocalized
public void setLocalized(boolean flag) - Specified by:
setLocalizedin interfaceFieldModel- Parameters:
flag-trueto make it a multilingual field,falseto not.
-
isLocalized
public boolean isLocalized()Description copied from interface:FieldModelTells 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.- Specified by:
isLocalizedin interfaceFieldModel- See Also:
-
setXssFilter
public void setXssFilter(boolean xssFilter) - Specified by:
setXssFilterin interfaceFieldModel
-
isXssFilter
public boolean isXssFilter()- Specified by:
isXssFilterin interfaceFieldModel
-
setBaseField
Description copied from interface:FieldModelSet the base field for synthetic localized fields.- Specified by:
setBaseFieldin interfaceFieldModel
-
getBaseField
Description copied from interface:FieldModelGet the base field of a localized field. If the field we're currently working on is localized andFieldModel.getBaseField()doesn't return a field, then it might already be the base field.- Specified by:
getBaseFieldin interfaceFieldModel- Returns:
- the base field of the localized field.
- See Also:
-
isMandatory
public boolean isMandatory()- Specified by:
isMandatoryin interfaceFieldModel- Returns:
- true if a MandatoryValidator is registered for the underlying field and thus the field is mandatory
-
isBinaryReplacementDisabled
public boolean isBinaryReplacementDisabled()Description copied from interface:FieldModelWhen 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`.- Specified by:
isBinaryReplacementDisabledin interfaceFieldModel
-
setBinaryReplacementDisabled
public void setBinaryReplacementDisabled(boolean disabled) - Specified by:
setBinaryReplacementDisabledin interfaceFieldModel
-
isPrivilegedAccessOnly
public boolean isPrivilegedAccessOnly()- Specified by:
isPrivilegedAccessOnlyin interfaceFieldModel
-
setPrivilegedAccessOnly
public void setPrivilegedAccessOnly(boolean privilegedAccessOnly) - Specified by:
setPrivilegedAccessOnlyin interfaceFieldModel
-