Class DisplayValueFactoryImpl

java.lang.Object
ch.tocco.nice2.model.base.impl.display.DisplayValueFactoryImpl
All Implemented Interfaces:
DisplayValueFactory

@Component public class DisplayValueFactoryImpl extends Object implements DisplayValueFactory
  • Constructor Details

    • DisplayValueFactoryImpl

      public DisplayValueFactoryImpl()
  • Method Details

    • createByPrefix

      public DisplayValue createByPrefix(String string)
      Description copied from interface: DisplayValueFactory
      Creates a DisplayValue 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 interface DisplayValueFactory
      Parameters:
      string - The label.
      Returns:
      Created display value ready to evaluate.
    • create

      public DisplayValue create(String type, String string)
      Description copied from interface: DisplayValueFactory
      Creates a DisplayValue 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 in DisplayValueFactory.createByPrefix(String) you can just pass the String and the prefix is extracted out of it.

      Specified by:
      create in interface DisplayValueFactory
      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

      @Autowired public void setEvaluatorsContribution(List<EvaluatorContribution> contributions)