public class StdCharEntities
extends java.lang.Object
translates the standard character entities defined in the XML standard into the characters the represent. For occasional use call one of the static but synchronized methods. For heavy duty use create an instance but use it only in one thread.
The following replacements are made:
from | to |
---|---|
& | & |
" | " |
' | ' |
< | < |
> | > |
Constructor and Description |
---|
StdCharEntities()
For high throughput non-synchronized use in one thread, get one
instance of this class and reuse it consistently.
|
Modifier and Type | Method and Description |
---|---|
void |
decode(java.lang.StringBuilder text,
int start) |
void |
encode(java.lang.StringBuilder text,
int start) |
static java.lang.String |
toChar(java.lang.CharSequence s)
replaces the standard character entities in
s and
returns the result. |
static void |
toChar(java.lang.StringBuilder text,
int start)
replaces the standard character entities in place.
|
static java.lang.String |
toEntities(java.lang.CharSequence s) |
static void |
toEntities(java.lang.StringBuilder text,
int start) |
public StdCharEntities()
For high throughput non-synchronized use in one thread, get one instance of this class and reuse it consistently. For occasional use which is not critical with regard to performance use one of the static methods.
public void decode(java.lang.StringBuilder text, int start)
public void encode(java.lang.StringBuilder text, int start)
public static void toChar(java.lang.StringBuilder text, int start)
replaces the standard character entities in place.
public static void toEntities(java.lang.StringBuilder text, int start)
public static java.lang.String toChar(java.lang.CharSequence s)
replaces the standard character entities in s
and
returns the result.
public static java.lang.String toEntities(java.lang.CharSequence s)