Class DisplayValueFactoryImpl
java.lang.Object
ch.tocco.nice2.model.base.impl.display.DisplayValueFactoryImpl
- All Implemented Interfaces:
DisplayValueFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates aDisplayValue
from a string and type.createByPrefix
(String string) Creates aDisplayValue
from a string.void
setEvaluatorsContribution
(List<EvaluatorContribution> contributions)
-
Constructor Details
-
DisplayValueFactoryImpl
public DisplayValueFactoryImpl()
-
-
Method Details
-
createByPrefix
Description copied from interface:DisplayValueFactory
Creates aDisplayValue
from a string. The prefix is used to determine what kind of display-value is returned.Use this method when you don't know the prefix or you don't want to extract it from the String by yourself. Falls back to the default evaluator when there are
- a) no evaluators
- b) or the string has a prefix which can't be handled
- c) or the string isn't prefixed at all
When you know the type, please use
DisplayValueFactory.create(String, String)
- Specified by:
createByPrefix
in interfaceDisplayValueFactory
- Parameters:
string
- The label.- Returns:
- Created display value ready to evaluate.
-
create
Description copied from interface:DisplayValueFactory
Creates aDisplayValue
from a string and type.Checks for available evaluator for type and returns new
DisplayValue
based on it. Has no fallback to the default evaluator.The difference between this method and
DisplayValueFactory.createByPrefix(String)
is simply, that for this method you have to know the prefix before whereas inDisplayValueFactory.createByPrefix(String)
you can just pass the String and the prefix is extracted out of it.- Specified by:
create
in interfaceDisplayValueFactory
- Parameters:
type
- Type of the evalutator (entity, constant, textresource...).string
- The label to evaluate.- Returns:
- Display value which can be evaluated against the evaluator found by type.
-
setEvaluatorsContribution
-