EntityFixer Class
- public class EntityFixer
extends Object
A utility class for replacing standard XML entities with their character
values.
-
Hierarchy
-
Object
EntityFixer
Methods from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
defReplaceEntities
protected static final String
defReplaceEntities
- Default XML/HTML entities that represent special character sequences.
entities
protected Hashtable
entities
- Our character to entity mapping.
instance
protected static EntityFixer
instance
- The singleton EntityFixer.
EntityFixer
public EntityFixer()
- Constructor.
This will initialize the entity mapping with the default values.
addEntityMapping(String, String) Method
public String
addEntityMapping(String
chars,
String
value)
Add a characters to value mapping (i.e. "%" -> "&pect;")
Parameters
-
chars
- the characters ("%").
-
value
- the string to replace chars with ("&pect;").
Returns
- the previous value, or null if none.
fixEntities(String) Method
public String
fixEntities(String
in)
getEntityMapping(String) Method
public String
getEntityMapping(String
chars)
Retrive the a current entity mapping.
getInstance() Method
public static EntityFixer
getInstance()
Get the singleton instance.
removeEntityMapping(String) Method
public String
removeEntityMapping(String
chars)
Remove an entity mapping.
replace(String, String, String) Method
DEPRECATED Use com.bea.p13n.util.StringUtils
public static String
replace(String
inStr,
String
find,
String
replace)
String search and replace method.