Package ch.tocco.nice2.model.entity.impl
Class DataModelImpl
java.lang.Object
ch.tocco.nice2.model.base.spi.base.AbstractModel<NiceModelReceiver>
ch.tocco.nice2.model.entity.impl.DataModelImpl
- All Implemented Interfaces:
ReloadAction
,DataModel
,NiceDataModel
@Component
public final class DataModelImpl
extends AbstractModel<NiceModelReceiver>
implements NiceDataModel, ReloadAction
The actual implementation of the data-model.
-
Field Summary
Fields inherited from class ch.tocco.nice2.model.base.spi.base.AbstractModel
log, modelProviders
-
Constructor Summary
ConstructorDescriptionDataModelImpl
(org.slf4j.Logger log, TypeManager typeManager, ReloadEventEmitter reloadEvent, SchemaModelValidator schemaModelValidator, L10N l10n, ThreadHandlerManager threadHandlerManager) -
Method Summary
Modifier and TypeMethodDescription@Nullable EntityModel
getEntityModel
(String model) boolean
hasRemovedEntity
(String name) A possibility to ask the configuration if something got removed.void
void
onReload()
requireEntityModel
(String model) void
setConceptionModelValidators
(List<NiceModelValidator> validators) void
setFinalModelValidators
(List<NiceModelValidator> validators) void
setValidateModel
(boolean validateModel) Methods inherited from class ch.tocco.nice2.model.base.spi.base.AbstractModel
addListener, fireFinished, removeListener, setModelProviders
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.model.entity.api.NiceDataModel
addListener, removeListener
-
Constructor Details
-
DataModelImpl
public DataModelImpl(org.slf4j.Logger log, TypeManager typeManager, ReloadEventEmitter reloadEvent, @Lazy SchemaModelValidator schemaModelValidator, L10N l10n, ThreadHandlerManager threadHandlerManager)
-
-
Method Details
-
getEntityModels
- Specified by:
getEntityModels
in interfaceDataModel
- Specified by:
getEntityModels
in interfaceNiceDataModel
-
getEntityModel
- Specified by:
getEntityModel
in interfaceDataModel
- Specified by:
getEntityModel
in interfaceNiceDataModel
- Parameters:
model
- the model's name- Returns:
- null if there is no such model
- See Also:
-
requireEntityModel
- Specified by:
requireEntityModel
in interfaceDataModel
- Specified by:
requireEntityModel
in interfaceNiceDataModel
- Parameters:
model
- the model's name- Throws:
ModelException
- If there is no such model.
-
getTypeManager
- Specified by:
getTypeManager
in interfaceDataModel
-
hasRemovedEntity
Description copied from interface:NiceDataModel
A possibility to ask the configuration if something got removed. This is importat to remove dependend stuff.
For example we remove the Field 'username' on an entity. Then the form-system need to know that this it's removed explictly and no spelling-error in the form-configuration. Then the form-system can remove the field aswell which would normally show this entity-field.- Specified by:
hasRemovedEntity
in interfaceNiceDataModel
-
onReload
public void onReload()- Specified by:
onReload
in interfaceNiceDataModel
- Specified by:
onReload
in interfaceReloadAction
- Specified by:
onReload
in classAbstractModel<NiceModelReceiver>
-
setValidateModel
public void setValidateModel(boolean validateModel) -
setConceptionModelValidators
-
setFinalModelValidators
-
initializeService
@PostConstruct public void initializeService()
-