Class DefaultDisplayServiceImpl
java.lang.Object
ch.tocco.nice2.persist.entity.impl.defaultdisplay.DefaultDisplayServiceImpl
- All Implemented Interfaces:
DefaultDisplayService
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionevaluateDefaultDisplay
(Entity entity) evaluateDisplay
(Entity entity, DefaultDisplay.Options baseOptions, DefaultDisplay.Options... fallbackOptions) evaluate display for the first available option from the provided options.evaluateDisplay
(Entity entity, String... types) evaluate display for the first available type from the provided types.evaluateDisplayForOption
(Entity entity, DefaultDisplay.Options option) evaluates the display for the given optionsgetDefaultDisplay
(EntityModel model) 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.persist.entity.api.defaultdisplay.DefaultDisplayService
evaluateDefaultDisplay
-
Constructor Details
-
DefaultDisplayServiceImpl
public DefaultDisplayServiceImpl()
-
-
Method Details
-
evaluateDefaultDisplay
- Specified by:
evaluateDefaultDisplay
in interfaceDefaultDisplayService
-
evaluateDisplay
Description copied from interface:DefaultDisplayService
evaluate display for the first available type from the provided types. If none of the types are available for the provided entity, the default display is evaluated.- Specified by:
evaluateDisplay
in interfaceDefaultDisplayService
- Parameters:
entity
- the entity to evaluate the display fortypes
- the list of types to try- Returns:
- the evaluated display
-
evaluateDisplay
public String evaluateDisplay(Entity entity, DefaultDisplay.Options baseOptions, DefaultDisplay.Options... fallbackOptions) Description copied from interface:DefaultDisplayService
evaluate display for the first available option from the provided options. If none of the options match a display, the default display is evaluated withbaseOptions
.- Specified by:
evaluateDisplay
in interfaceDefaultDisplayService
- Parameters:
entity
- the entity to evaluate the display forbaseOptions
- the options to try first and to use for the default display if no type is providedfallbackOptions
- the options to try ifbaseOptions
did not provide a display- Returns:
- the evaluated display
-
evaluateDisplayForOption
Description copied from interface:DefaultDisplayService
evaluates the display for the given options- Specified by:
evaluateDisplayForOption
in interfaceDefaultDisplayService
- Parameters:
entity
- the entity to evaluate the display foroption
- the options used to find and evaluate the display- Returns:
- the evaluated display or null if none could be found for type in options
-
getDefaultDisplay
- Specified by:
getDefaultDisplay
in interfaceDefaultDisplayService
-