Klasse AbstractParameterFormatter<T>

Object
de.sayayi.lib.message.formatter.AbstractParameterFormatter<T>
Typparameter:
T - parameter type
Alle implementierten Schnittstellen:
ParameterFormatter
Bekannte direkte Unterklassen:
AbstractListFormatter, AbstractMultiSelectFormatter, AbstractSingleTypeParameterFormatter, BitsFormatter, ClipFormatter, FileSizeFormatter, GeoFormatter, NodeFormatter, NumberFormatter, TemporalFormatter

public abstract class AbstractParameterFormatter<T> extends Object implements ParameterFormatter
This class provides a basic formatter implementation that handles empty and null values and is suitable for most parameter formatters.

Method format(FormatterContext, Object) takes care of mapping null and empty values. It does so for both the value to be formatted and the formatted text returned by formatValue(FormatterContext, Object).

If a null or empty value is matched in the parameter configuration (e.g. %{val,null:'no text',empty:'empty text'} ) the associated message is returned. If no match was found for null then nullText() is returned.

Non-null values are delegated to formatValue(FormatterContext, Object). The returned text will be matched against null and empty parameter configuration entries and is replaced by the best matching message found.

Seit:
0.3.1
  • Konstruktordetails

    • AbstractParameterFormatter

      public AbstractParameterFormatter()
  • Methodendetails