com.evanmclean.evlib.escape
Class EscXml

java.lang.Object
  extended by com.evanmclean.evlib.escape.EscXml

public final class EscXml
extends Object

Escapes character escaping suitable for XML output.

Author:
Evan McLean McLean Computer Services (see the overview for copyright and licensing.)

Field Summary
static String CDATA_END
          The end of an XML CDATA element: "]]>"
static String CDATA_START
          The start of an XML CDATA element: "<![CDATA["
 
Method Summary
 String attr(Object obj)
          Performs escaping for an XML attribute.
 String cdata(Object obj)
          Performs escaping for text inside an XML CDATA element.
 String comment(Object obj)
          Performs escaping for text inside an XML comment.
 String text(Object obj)
          Performs escaping for text inside an XML text element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CDATA_START

public static final String CDATA_START
The start of an XML CDATA element: "<![CDATA["

See Also:
Constant Field Values

CDATA_END

public static final String CDATA_END
The end of an XML CDATA element: "]]>"

See Also:
Constant Field Values
Method Detail

attr

public String attr(Object obj)
Performs escaping for an XML attribute.

Parameters:
obj -
Returns:
The substituted string, or null if obj was null.

cdata

public String cdata(Object obj)
Performs escaping for text inside an XML CDATA element.

Parameters:
obj -
Returns:
The substituted string, or null if obj was null.

comment

public String comment(Object obj)
Performs escaping for text inside an XML comment.

Parameters:
obj -
Returns:
The substituted string, or null if obj was null.

text

public String text(Object obj)
Performs escaping for text inside an XML text element.

Parameters:
obj -
Returns:
The substituted string, or null if obj was null.