Class XMLFormatter

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

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

    • mapper

      protected XMLMapper mapper
    • mapperName

      protected String mapperName
  • Constructor Details

  • Method Details

    • 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