Package com.topologi.diffx.xml.esc
Class XMLEscapeBase
java.lang.Object
com.topologi.diffx.xml.esc.XMLEscapeBase
- All Implemented Interfaces:
XMLEscape
- Direct Known Subclasses:
XMLEscapeASCII,XMLEscapeUTF8
A base implementation for the XML escape classes.
- Version:
- 3 September 2004
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal StringReturns the encoding used.final StringtoAttributeValue(String value) Default implementation calling theXMLEscape.toAttributeValue(char[], int, int).final StringtoElementText(String value) Default implementation calling theXMLEscape.toAttributeValue(char[], int, int).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.topologi.diffx.xml.esc.XMLEscape
toAttributeValue, toElementText
-
Field Details
-
encoding
The encoding for the implementation.
-
-
Constructor Details
-
XMLEscapeBase
XMLEscapeBase(String encoding) Creates a new XML Escape.- Parameters:
encoding- The encoding used.
-
-
Method Details
-
toAttributeValue
Default implementation calling theXMLEscape.toAttributeValue(char[], int, int). Returns a well-formed attribute value.Method provided for convenience, using the same specifications as
XMLEscape.toAttributeValue(char[], int, int).This method should return
nullif the given value isnull.- Specified by:
toAttributeValuein interfaceXMLEscape- Parameters:
value- The value that needs to be attribute-escaped.- Returns:
- A well-formed value for the attribute.
-
toElementText
Default implementation calling theXMLEscape.toAttributeValue(char[], int, int). Returns a well-formed text value for the element.Method provided for convenience, using the same specifications as
XMLEscape.toElementText(char[], int, int).This method should return
nullif the given value isnull.- Specified by:
toElementTextin interfaceXMLEscape- Parameters:
value- The value that needs to be text-escaped.- Returns:
- A well-formed value for the text node.
-
getEncoding
Returns the encoding used. Returns the encoding used by the implementing class.- Specified by:
getEncodingin interfaceXMLEscape- Returns:
- The encoding used by the implementing class.
-