Class SimpleXMLFormatConverter

java.lang.Object
org.dlese.dpc.xml.SimpleXMLFormatConverter
All Implemented Interfaces:
XMLFormatConverter

public class SimpleXMLFormatConverter extends Object implements XMLFormatConverter
A simple demonstraion implementation of the XMLFormatConverter interface. Just appends a comment to the end of the XML content. Can be used on any XML format for demonstration and testing.
Author:
John Weatherley
See Also:
  • Constructor Details

    • SimpleXMLFormatConverter

      public SimpleXMLFormatConverter()
  • Method Details

    • getFromFormat

      public String getFromFormat()
      This converter can convert from any format.
      Specified by:
      getFromFormat in interface XMLFormatConverter
      Returns:
      An empty string, since there is no format association.
    • getToFormat

      public String getToFormat()
      This converter can convert to any format.
      Specified by:
      getToFormat in interface XMLFormatConverter
      Returns:
      An empty string, since there is no format association.
    • lastModified

      public long lastModified(ServletContext context)
      Gets the time this converter code was last modified. If unknown, this method should return -1.
      Specified by:
      lastModified in interface XMLFormatConverter
      Parameters:
      context - The context in which this is running.
      Returns:
      The time this converter code was last modified.
    • convertXML

      public String convertXML(String xml, ServletContext context)
      Performs XML conversion from the input format to the output format by simply adding a coment to the end of the input XML record.
      Specified by:
      convertXML in interface XMLFormatConverter
      Parameters:
      xml - XML input in the 'from' format.
      context - The context in which this is running.
      Returns:
      XML in the converted 'to' format.