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 DefaultDisplay
DefaultDisplay.Options -
Constructor Summary
ConstructorsConstructorDescriptionDefaultDisplayImpl(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 DisplayExpressionReturns the expression as StringvoidsetExpression(String expression, @Nullable String language)
-
Constructor Details
-
DefaultDisplayImpl
public DefaultDisplayImpl(DisplayFactory displayFactory, RunEnvironmentService runEnvironmentService)
-
-
Method Details
-
getExpression
Description copied from interface:DefaultDisplayReturns the expression as String- Specified by:
getExpressionin interfaceDefaultDisplay- Returns:
- expression
-
setExpression
-
evaluate
Description copied from interface:DefaultDisplayEvaluate 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:
evaluatein 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:
evaluatein interfaceDefaultDisplay
-
evaluateOrThrow
-
evaluateOrLog
public String evaluateOrLog(EntityReference entity, String fallbackString, DefaultDisplay.Options options) -
evaluateOrLog
-