NASA World Wind

gov.nasa.worldwind.util
Class EntityMap

java.lang.Object
  extended by gov.nasa.worldwind.util.EntityMap

public class EntityMap
extends Object

Maps HTML entities and named character references to their Java equivalent.


Field Summary
protected static String[] entityKeys
           
protected static String[] entityReplacements
           
protected static HashMap<String,String> map
           
protected static List<Pattern> patterns
           
 
Constructor Summary
EntityMap()
           
 
Method Summary
static String get(String key)
          Returns tne Java equivalent of an entity or a named character reference.
protected static String getNextEntity(String source, int regionStart)
          Search a string for the next occurrence of an entity.
static String replaceAll(String source)
          Replaces all entities and character references in a specified string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entityKeys

protected static String[] entityKeys

entityReplacements

protected static final String[] entityReplacements

map

protected static final HashMap<String,String> map

patterns

protected static final List<Pattern> patterns
Constructor Detail

EntityMap

public EntityMap()
Method Detail

get

public static String get(String key)
Returns tne Java equivalent of an entity or a named character reference.

Parameters:
key - the entity or character reference.
Returns:
the Java equivalent of the input, or null if the input string does not identify a known entity or character reference.

getNextEntity

protected static String getNextEntity(String source,
                                      int regionStart)
Search a string for the next occurrence of an entity.

Parameters:
source - String to search.
regionStart - Position in the string at which to start searching.
Returns:
The entity that was matched, or null if no entity could be matched.

replaceAll

public static String replaceAll(String source)
Replaces all entities and character references in a specified string.

Parameters:
source - the input string.
Returns:
the input string with all entities and references resolved. The input string is returned as-is if it contains no entities or references.

NASA World Wind