Class DefaultDisplayImpl
java.lang.Object
ch.tocco.nice2.model.entity.api.entity.defaultdisplay.DefaultDisplayImpl
- All Implemented Interfaces:
DefaultDisplay
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.tocco.nice2.model.entity.api.defaultdisplay.DefaultDisplay
DefaultDisplay.Options
-
Constructor Summary
ConstructorDescriptionDefaultDisplayImpl
(DisplayFactory displayFactory, RunEnvironmentService runEnvironmentService) -
Method Summary
Modifier and TypeMethodDescriptionevaluate
(EntityReference entity) Evaluate the value against an entity.evaluate
(EntityReference entity, DefaultDisplay.Options options) Failure behavior: in development mode it throws, in production mode it logs.evaluateOrLog
(EntityReference entity, DefaultDisplay.Options options) evaluateOrLog
(EntityReference entity, String fallbackString, DefaultDisplay.Options options) evaluateOrThrow
(EntityReference entity, DefaultDisplay.Options options) @Nullable DisplayExpression
Returns the expression as Stringvoid
setExpression
(String expression, @Nullable String language)
-
Constructor Details
-
DefaultDisplayImpl
public DefaultDisplayImpl(DisplayFactory displayFactory, RunEnvironmentService runEnvironmentService)
-
-
Method Details
-
getExpression
Description copied from interface:DefaultDisplay
Returns the expression as String- Specified by:
getExpression
in interfaceDefaultDisplay
- Returns:
- expression
-
setExpression
-
evaluate
Description copied from interface:DefaultDisplay
Evaluate the value against an entity. This is somewhat similar to an object's toString() method. Often it takes the current user (and his locale) into account. On evaluation failure an exception is thrown (development) or logged (production) (depending on run-env).- Specified by:
evaluate
in interfaceDefaultDisplay
- Parameters:
entity
- the entity- Returns:
- the value as string
-
evaluate
Failure behavior: in development mode it throws, in production mode it logs.- Specified by:
evaluate
in interfaceDefaultDisplay
-
evaluateOrThrow
-
evaluateOrLog
public String evaluateOrLog(EntityReference entity, String fallbackString, DefaultDisplay.Options options) -
evaluateOrLog
-