Interface Formatter<DataType,InternalType>

All Known Implementing Classes:
ImageFormatter, PlainTextFormatter, RawFormatter, XhtmlFormatter

public interface Formatter<DataType,InternalType>
Formats raw data according to the information that's provided by a Content instance. The raw data will be loaded, optionally transformed and eventually returned.
Since:
1.0
  • Method Summary

    Modifier and Type
    Method
    Description
    Formats raw data and returns it in a DataType that's supported by the back-end stores.
  • Method Details

    • format

      DataType format(Content content, ContentTransformer<InternalType> transformer) throws FormatException
      Formats raw data and returns it in a DataType that's supported by the back-end stores.
      Parameters:
      content - a Content instance that contains the raw data with additional information that describes the storage and formatting of the processed data
      transformer - a transformer that will be used to modify raw data after it has been loaded; or

      null if the data shouldn't be transformed

      Returns:
      the result of the formatting of the raw data
      Throws:
      FormatException
      Since:
      1.0