EntityFixer Class

DEPRECATED

com.bea.p13n.content.document.ref.loader
EntityFixer Class

public class EntityFixer

    extends Object

A utility class for replacing standard XML entities with their character values.


Hierarchy
Object
  EntityFixer

Field Summary

protected static final String
defReplaceEntities
Default XML/HTML entities that represent special character sequences.
protected Hashtable
entities
Our character to entity mapping.
protected static com.bea.p13n.content.document.ref.loader.EntityFixer
instance
The singleton EntityFixer.
 

Constructor Summary

EntityFixer()

Constructor.
 

Method Summary

public String
addEntityMapping(String chars, String value)
Add a characters to value mapping (i.e. "%" -> "&pect;")
public String
fixEntities(String in)
public String
getEntityMapping(String chars)
Retrive the a current entity mapping.
public static EntityFixer
getInstance()
Get the singleton instance.
public String
removeEntityMapping(String chars)
Remove an entity mapping.
public static String
replace(String inStr, String find, String replace)
String search and replace method.
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   

Field Detail

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 com.bea.p13n.content.document.ref.loader.EntityFixer instance
The singleton EntityFixer.

 

Constructor Detail

EntityFixer

public EntityFixer()
Constructor.

This will initialize the entity mapping with the default values.

 

Method Detail

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

public static String replace(String inStr, 
                             String find, 
                             String replace)
String search and replace method.