com.cc.framework.util.parser
Class EntityMapper

java.lang.Object
  extended bycom.cc.framework.util.parser.EntityMapper

public class EntityMapper
extends java.lang.Object

Utility class to map entities to character codes

Author:
Harald Schulz

Field Summary
private static java.util.Map ENTITIES_BY_CODE
          HTML Entities accessible by character code Map<Character, String>
private static java.util.Map ENTITIES_BY_NAME
          HTML Entities accessible by entity name Map<String, Character>
 
Constructor Summary
EntityMapper()
           
 
Method Summary
 java.lang.String getByCode(char code)
          Maps a character to the entity
 char getByName(java.lang.String entity)
          Maps an entity to the corresponding entity
private static void register(java.lang.String entity, int code)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTITIES_BY_NAME

private static java.util.Map ENTITIES_BY_NAME
HTML Entities accessible by entity name Map<String, Character>


ENTITIES_BY_CODE

private static java.util.Map ENTITIES_BY_CODE
HTML Entities accessible by character code Map<Character, String>

Constructor Detail

EntityMapper

public EntityMapper()
Method Detail

register

private static void register(java.lang.String entity,
                             int code)

getByCode

public java.lang.String getByCode(char code)
Maps a character to the entity

Parameters:
code - the character code to map
Returns:
entity or null

getByName

public char getByName(java.lang.String entity)
Maps an entity to the corresponding entity

Parameters:
entity - the entity to map
Returns:
character or 0


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.