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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDocumentation
(String definingModule, String documentation) Adds documentation for theFieldModel
, contributed by the definingAppModule
.void
addExtendingModule
(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 theFieldModel
tag as aLinkedHashMap
, divided by theAppModule
s extending the baseFieldModel
and contributing the documentation.Returns a list of nice2 module names, that have contributed to this model element.@Nullable DisplayValue
getLabel()
boolean
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.boolean
Tells if this field is multilingual.boolean
boolean
boolean
void
setBaseField
(FieldModel baseField) Set the base field for synthetic localized fields.void
setBinaryReplacementDisabled
(boolean disabled) void
setDefiningModule
(String name) void
setLabel
(DisplayValue display) void
setLocalized
(boolean flag) void
setPrivilegedAccessOnly
(boolean privilegedAccessOnly) void
setXssFilter
(boolean xssFilter) Methods inherited from class ch.tocco.nice2.model.entity.api.DefaultFieldModel
getAdditionalToStringInfo, getDefaultValue, getName, getTarget, getType, getValidator, hasNonEmptyValidator, isKey, isNullable, isSynthetic, isUnique, isVirtual, setDefaultValue, setKey, setName, setNullable, setSynthetic, setTarget, setType, setUnique, setValidator, setVirtual
Methods inherited from class ch.tocco.nice2.model.entity.api.DefaultModelBase
toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.model.entity.api.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:ModuleTracker
Returns a list of nice2 module names, that have contributed to this model element.- Specified by:
getExtendingModules
in interfaceModuleTracker
-
addExtendingModule
- Specified by:
addExtendingModule
in interfaceModuleTracker
-
getDocumentation
Description copied from interface:FieldModel
Returns the content of the documentation element of theFieldModel
tag as aLinkedHashMap
, divided by theAppModule
s extending the baseFieldModel
and contributing the documentation. The contents of the map are ordered according to the loading sequence of theAppModule
s.- Specified by:
getDocumentation
in interfaceFieldModel
- Returns:
- The
LinkedHashMap
containg theFieldModel
's documentation tag.
-
addDocumentation
Description copied from interface:FieldModel
Adds documentation for theFieldModel
, contributed by the definingAppModule
.- Specified by:
addDocumentation
in interfaceFieldModel
- Parameters:
definingModule
- the string representation of theAppModule
contributing the documentationdocumentation
- the documentation for theFieldModel
-
getDefiningModule
Description copied from interface:ModuleTracker
Returns the name of the nice2 module, where this model element is defined.- Specified by:
getDefiningModule
in interfaceModuleTracker
-
setDefiningModule
- Specified by:
setDefiningModule
in interfaceModuleTracker
-
getLabel
- Specified by:
getLabel
in interfaceFieldModel
- Returns:
- The label of this field.
-
setLabel
- Specified by:
setLabel
in interfaceFieldModel
- Parameters:
display
- the display, non-null- See Also:
-
setLocalized
public void setLocalized(boolean flag) - Specified by:
setLocalized
in interfaceFieldModel
- Parameters:
flag
-true
to make it a multilingual field,false
to not.
-
isLocalized
public boolean isLocalized()Description copied from interface:FieldModel
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.- Specified by:
isLocalized
in interfaceFieldModel
- See Also:
-
setXssFilter
public void setXssFilter(boolean xssFilter) - Specified by:
setXssFilter
in interfaceFieldModel
-
isXssFilter
public boolean isXssFilter()- Specified by:
isXssFilter
in interfaceFieldModel
-
setBaseField
Description copied from interface:FieldModel
Set the base field for synthetic localized fields.- Specified by:
setBaseField
in interfaceFieldModel
-
getBaseField
Description copied from interface:FieldModel
Get 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:
getBaseField
in interfaceFieldModel
- Returns:
- the base field of the localized field.
- See Also:
-
isMandatory
public boolean isMandatory()- Specified by:
isMandatory
in 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:FieldModel
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`.- Specified by:
isBinaryReplacementDisabled
in interfaceFieldModel
-
setBinaryReplacementDisabled
public void setBinaryReplacementDisabled(boolean disabled) - Specified by:
setBinaryReplacementDisabled
in interfaceFieldModel
-
isPrivilegedAccessOnly
public boolean isPrivilegedAccessOnly()- Specified by:
isPrivilegedAccessOnly
in interfaceFieldModel
-
setPrivilegedAccessOnly
public void setPrivilegedAccessOnly(boolean privilegedAccessOnly) - Specified by:
setPrivilegedAccessOnly
in interfaceFieldModel
-