Class AtomicValueTranslator

Direct Known Subclasses:
DocumentIDTranslator

public class AtomicValueTranslator extends SingleValueTranslator
  • Constructor Details

    • AtomicValueTranslator

      public AtomicValueTranslator(Class javaClass)
    • AtomicValueTranslator

      public AtomicValueTranslator(AttributeDescriptor attributeDescriptor, Class javaClass)
  • Method Details

    • setLocale

      public void setLocale(Locale locale)
      Sets the locale used for default formats to another one (default is session locale).
      Parameters:
      locale - locale to use for value translation with default formats
    • setDateFormat

      public void setDateFormat(DateFormat format)
      Sets the date format used for date translation. If set to null the default format will be used (see getDefaultDateFormat()).
      Parameters:
      format - date format to use for date translation
    • setDateFormat

      public void setDateFormat(String format)
    • setNumberFormat

      public void setNumberFormat(NumberFormat format)
      Sets the number format used for number translation. If set to null the default format will be used (see getDefaultNumberFormat()).
      Parameters:
      format - number format to use for number translation
    • setNumberFormat

      public void setNumberFormat(String format)
    • getAttributeDescriptor

      protected AttributeDescriptor getAttributeDescriptor()
      Returns the assigned AttributeDescriptor.
      Returns:
      the assigned attributeDescriptor, which could be null!!
    • getDateFormatString

      protected String getDateFormatString(AbstractDescriptor columnDescriptor)
    • getNumberFormatString

      protected String getNumberFormatString(AbstractDescriptor columnDescriptor)
    • getDateFormat

      protected DateFormat getDateFormat()
      Returns the DateFormat or a default one.
      Returns:
      DateFormat
    • getNumberFormat

      protected NumberFormat getNumberFormat()
      Returns the NumberFormat or a default one.
      Returns:
      NumberFormat
    • getDefaultNumberFormat

      public NumberFormat getDefaultNumberFormat()
      Returns a default NumberFormat instance constructed with configured locale or Locale.German as default.
      Returns:
      NumberFormat
    • getDefaultDateFormat

      public DateFormat getDefaultDateFormat()
      Returns a default DateFormat with the default formating and the default locale.
      Returns:
      DateFormat
    • init

      public void init(StandardColumnDescriptor columnDescriptor)
      Description copied from class: AbstractValueTranslator
      Called once per header creation to allow configuring this translator using column modifiers etc.
      Overrides:
      init in class AbstractValueTranslator
      Parameters:
      columnDescriptor - descriptor where the value to translate belongs to
    • validate

      public void validate(StandardColumnDescriptor columnDescriptor) throws HeaderValidationException
      Description copied from class: AbstractValueTranslator
      Validates the value translator once per header creation.
      Overrides:
      validate in class AbstractValueTranslator
      Parameters:
      columnDescriptor - descriptor where the value to translate belongs to
      Throws:
      HeaderValidationException - validation has thrown errors
    • isSupportedClass

      protected boolean isSupportedClass(Class myClass)
    • convertToString

      protected String convertToString(Object value)
      Description copied from class: SingleValueTranslator
      Converts a non-null jalo attribute value into its string representation.
      Specified by:
      convertToString in class SingleValueTranslator
      Parameters:
      value - value to translate
      Returns:
      translated value
    • convertToJalo

      protected Object convertToJalo(String valueExpr, Item forItem)
      Description copied from class: SingleValueTranslator
      Converts a non-null and non-empty string into a jalo attribute value.
      Specified by:
      convertToJalo in class SingleValueTranslator
      Parameters:
      valueExpr - string to translate
      forItem - item instance the translated value will be set to as attribute
      Returns:
      Object translated value
    • holdsUnresolvableItems

      protected boolean holdsUnresolvableItems(Object object)