Interface IValueFormatter

All Superinterfaces:
Serializable
All Known Implementing Classes:
ValueFormatter, XssSafeValueFormatter

public interface IValueFormatter extends Serializable
Interface for objects that can format an internal value to a string representation and parse the string representation back to a value.
Since:
5.1
Author:
O. Kerpershoek
  • Method Summary

    Modifier and Type
    Method
    Description
    format(IPrimitiveValue valueObject)
    This method formats the to a string representation.
    parse(String text, DataType type)
    This method parses the text to a IPrimitiveValue of the type specified by the data type argument.
  • Method Details

    • format

      String format(IPrimitiveValue valueObject)
      This method formats the to a string representation.
      Parameters:
      valueObject - The primitive value whose string representation is requested.
      Returns:
      String representation of the primitive value.
    • parse

      IPrimitiveValue parse(String text, DataType type)
      This method parses the text to a IPrimitiveValue of the type specified by the data type argument.
      Parameters:
      text - The input text which should be parsed. Preferably String. However some primitive object handling is included.
      type - The data type to which the string should be converted.
      Returns:
      The primitive value for the specified data type and text.
      Throws:
      ConversionException - When the text object could not be converted to a value.