static class XmlOutput.StringEscaper extends Object implements Cloneable
A StringEscaper starts out as an identity transform in the "mutable"
state. Call defineEscape(char, java.lang.String) as many times as necessary to set up
mappings, and then call makeImmutable() before
actually applying the defined transform. Or,
use one of the global mappings pre-defined here.
| Modifier and Type | Field and Description |
|---|---|
static XmlOutput.StringEscaper |
HTML_ESCAPER |
private String[] |
translationTable |
private ArrayList<String> |
translationVector |
static XmlOutput.StringEscaper |
URL_ARG_ESCAPER |
static XmlOutput.StringEscaper |
URL_ESCAPER |
static XmlOutput.StringEscaper |
XML_ESCAPER |
static XmlOutput.StringEscaper |
XML_NUMERIC_ESCAPER |
| Constructor and Description |
|---|
StringEscaper()
Identity transform
|
| Modifier and Type | Method and Description |
|---|---|
protected XmlOutput.StringEscaper |
clone() |
void |
defineEscape(char from,
String to)
Map character "from" to escape sequence "to"
|
String |
escapeString(String s)
Apply an immutable transformation to the given string.
|
XmlOutput.StringEscaper |
getMutableClone()
Create a mutable escaper from an existing escaper, which may
already be immutable.
|
void |
makeImmutable()
Call this before attempting to escape strings; after this,
defineEscape may not be called again.
|
private String[] translationTable
public static final XmlOutput.StringEscaper XML_ESCAPER
public static final XmlOutput.StringEscaper XML_NUMERIC_ESCAPER
public static final XmlOutput.StringEscaper HTML_ESCAPER
public static final XmlOutput.StringEscaper URL_ARG_ESCAPER
public static final XmlOutput.StringEscaper URL_ESCAPER
public void defineEscape(char from,
String to)
public void makeImmutable()
public String escapeString(String s)
protected XmlOutput.StringEscaper clone()
public XmlOutput.StringEscaper getMutableClone()
Copyright © 2012–2018 The Apache Software Foundation. All rights reserved.