DLESE Tools
v1.6.0

org.dlese.dpc.xml
Class SimpleXMLFormatConverter

java.lang.Object
  extended by 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:
XMLConversionService

Constructor Summary
SimpleXMLFormatConverter()
           
 
Method Summary
 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.
 String getFromFormat()
          This converter can convert from any format.
 String getToFormat()
          This converter can convert to any format.
 long lastModified(ServletContext context)
          Gets the time this converter code was last modified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleXMLFormatConverter

public SimpleXMLFormatConverter()
Method Detail

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.

DLESE Tools
v1.6.0