Class LocalizedComponentDisplayValue

java.lang.Object
ch.tocco.nice2.model.form.impl.entity.LocalizedComponentDisplayValue
All Implemented Interfaces:
DisplayValue

public class LocalizedComponentDisplayValue extends Object implements DisplayValue
Display value evaluating a label of a localized field for a component depending on configuration parameters in the form xml.
  • Constructor Details

    • LocalizedComponentDisplayValue

      public LocalizedComponentDisplayValue(DisplayValue standardDisplay, DataComponent component)
      Parameters:
      standardDisplay - the standard display value for the localized field. this will return "label_fr" for a field named "label" and language "fr", for example
      component - the "original" component is the component of the default language, this will return "label", for example
  • Method Details

    • getRawData

      public String getRawData()
      Description copied from interface: DisplayValue
      Get the raw-data. This is a string-representation which should indicate what get evaluated. For example in the case of TextResource this would be the key to the resource.
      It should be used for debug and logs only. It should never be used to actually get the value to display.
      Specified by:
      getRawData in interface DisplayValue
      Returns:
      the value, non-null. can be empty
    • evaluate

      public String evaluate()
      Description copied from interface: DisplayValue
      Evaluate the data-in the current-context.
      Specified by:
      evaluate in interface DisplayValue
      Returns:
      the evaluate-result, ready to display
    • canEvaluate

      public boolean canEvaluate()
      Description copied from interface: DisplayValue
      Return if this display-value can be evaluated. If it cannot, the DisplayValue.evaluate()-Method still has to return a string.
      Because this is 'friendly' asking the system if this display value exists, an implementaition may reports this as a value which is optional. For example. The Textresoure-System will add the display-value to the optional-list if this call is made.

      This behind-scenes-notification is not obvious. So maybe this method should be renamed or replaced.
      Specified by:
      canEvaluate in interface DisplayValue
      Returns:
      true/false