Forward Computing and Control Pty. Ltd.
WebStringTemplate V1.5.0

2004/1/7

au.com.forward.webstringtemplate.filters
Class WSTXmlFilter

java.lang.Object
  extended byau.com.forward.webstringtemplate.filters.WSTPlainFilter
      extended byau.com.forward.webstringtemplate.filters.WSTXmlFilter
All Implemented Interfaces:
IWSTFilter

public class WSTXmlFilter
extends WSTPlainFilter

This filter escapes < > & and "

Author:
matthew ford

Field Summary
static java.util.logging.Logger logger
          The Java logger for this class
 
Constructor Summary
WSTXmlFilter()
          Default constructor for the WSTXmlFilter object
WSTXmlFilter(java.lang.Object obj)
          Constructor for the WSTXmlFilter object
WSTXmlFilter(java.lang.Object[] obj)
          Constructor for the WSTXmlFilter object
 
Method Summary
 IWSTFilter newInstance()
          Returns a new instance of this filter.
 java.lang.String toString()
          Escapes < > and & and ' " for html/xml use.
 
Methods inherited from class au.com.forward.webstringtemplate.filters.WSTPlainFilter
convertToString, getObject, getPath, setObject, setPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

public static final java.util.logging.Logger logger
The Java logger for this class

Constructor Detail

WSTXmlFilter

public WSTXmlFilter()
Default constructor for the WSTXmlFilter object


WSTXmlFilter

public WSTXmlFilter(java.lang.Object obj)
Constructor for the WSTXmlFilter object

Parameters:
obj - the object to filter, can be null

WSTXmlFilter

public WSTXmlFilter(java.lang.Object[] obj)
Constructor for the WSTXmlFilter object

Parameters:
obj - the object to filter, can be null
Method Detail

newInstance

public IWSTFilter newInstance()
Returns a new instance of this filter.
The object and path themselves are not copied. This usually correct as the object will be reset and the path. Any other other objects in the filter are need to be copied across in the over of this method.

Specified by:
newInstance in interface IWSTFilter
Overrides:
newInstance in class WSTPlainFilter
Returns:
a new instance of this filter

toString

public java.lang.String toString()
Escapes < > and & and ' " for html/xml use.
Handles null input.
If an error occures calling obj.toString(), return the error message as the string.

Specified by:
toString in interface IWSTFilter
Overrides:
toString in class WSTPlainFilter
Returns:
the escaped string, or "" (empty string) if input was null. If obj.toString() throws an exception, then the exception message is returned.

Forward Computing and Control Pty. Ltd.
WebStringTemplate V1.5.0

2004/1/7

Copyright ©2003, Forward Computing and Control Pty. Ltd
ACN 003 669 994   NSW Australia,   All Rights Reserved.
WebStringTemplate and associated code is released under licence. See the source.
WebStringTemplate uses code from StringTemplates and Antlr, under licence.
See the WebStringTemplate licence file for details.