Class XHTMLFormatter

java.lang.Object
org.cdlib.mrt.formatter.FormatterAbs
org.cdlib.mrt.formatter.XHTMLFormatter
All Implemented Interfaces:
FormatterInf

public class XHTMLFormatter extends FormatterAbs implements FormatterInf
XML output display formatter
Author:
dloy
  • Field Details

  • Constructor Details

  • Method Details

    • format

      public void format(StateInf stateFile, PrintStream stream) throws TException
      Description copied from interface: FormatterInf
      Create ouput format. Using the StateInf object, create a formatted output to this print stream
      Specified by:
      format in interface FormatterInf
      Overrides:
      format in class FormatterAbs
      Parameters:
      stateFile - object to be formatted
      stream - output for formatted data
      Throws:
      TException
    • writeStream

      protected void writeStream(File formatFile, PrintStream stream) throws TException
      Throws:
      TException
    • transform

      protected File transform(File xmlFile) throws TException
      Throws:
      TException
    • printBegin

      protected int printBegin(StateInf state, PrintStream stream) throws TException
      Description copied from class: FormatterAbs
      Beginning of formatting
      Specified by:
      printBegin in class FormatterAbs
      stream - print output stream
      Returns:
      starting level (used for indentation - typically 1)
      Throws:
      TException
    • printEnd

      protected void printEnd(PrintStream stream) throws TException
      Description copied from class: FormatterAbs
      End of formatting
      Specified by:
      printEnd in class FormatterAbs
      Parameters:
      stream - output stream
      Throws:
      TException
    • printStart

      protected void printStart(String name, boolean isFirst, int lvl, PrintStream stream) throws TException
      Description copied from class: FormatterAbs
      Beginning element entry. An example would be the element name in XML
      Specified by:
      printStart in class FormatterAbs
      Parameters:
      name - element name
      isFirst - true=is first element of a list, false=subsequent element of list
      lvl - indentation level
      stream - print output stream
      Throws:
      TException
    • printClose

      protected void printClose(String name, int lvl, PrintStream stream) throws TException
      Description copied from class: FormatterAbs
      Closing element entry. Example is closeing element in XML
      Specified by:
      printClose in class FormatterAbs
      Parameters:
      name - element name
      lvl - indentation level
      stream - print output stream
      Throws:
      TException
    • print

      protected void print(String name, String value, boolean isFirst, boolean isNumeric, int lvl, PrintStream stream) throws TException
      Description copied from class: FormatterAbs
      Formatted entry value
      Specified by:
      print in class FormatterAbs
      Parameters:
      name - name of entry
      value - entry value
      isFirst - true=is first element of a list, false=subsequent element of list
      isNumeric - is the element numeric or boolean. Some formats require quotes around value unless it is numeric
      lvl - indentation level
      stream - print output stream
      Throws:
      TException