BEA Systems, Inc.

WebLogic Server 6.1 API Reference

weblogic.apache.xalan.serialize
Class CharInfo

java.lang.Object
  |
  +--weblogic.apache.xalan.serialize.CharInfo

public class CharInfo
extends java.lang.Object

This class provides services that tell if a character should have special treatement, such as entity reference substitution or normalization of a newline character. It also provides character to entity reference lookup.

This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.


Field Summary
static java.lang.String HTML_ENTITIES_RESOURCE
          The name of the HTML entities file.
static char S_CARRIAGERETURN
          The carriage return character, which the parser should always normalize.
static char S_LINEFEED
          The linefeed character, which the parser should always normalize.
static java.lang.String XML_ENTITIES_RESOURCE
          The name of the XML entities file.
 
Constructor Summary
CharInfo(java.lang.String entitiesResource)
          Constructor that reads in a resource file that describes the mapping of characters to entity references.
 
Method Summary
protected  void defineEntity(java.lang.String name, char value)
          Defines a new character reference.
 java.lang.String getEntityNameForChar(char value)
          Resolve a character to an entity reference name.
 boolean isSpecial(char value)
          Tell if the character argument should have special treatment.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HTML_ENTITIES_RESOURCE

public static java.lang.String HTML_ENTITIES_RESOURCE
The name of the HTML entities file. If specified, the file will be resource loaded with the default class loader.

XML_ENTITIES_RESOURCE

public static java.lang.String XML_ENTITIES_RESOURCE
The name of the XML entities file. If specified, the file will be resource loaded with the default class loader.

S_LINEFEED

public static char S_LINEFEED
The linefeed character, which the parser should always normalize.

S_CARRIAGERETURN

public static char S_CARRIAGERETURN
The carriage return character, which the parser should always normalize.
Constructor Detail

CharInfo

public CharInfo(java.lang.String entitiesResource)
Constructor that reads in a resource file that describes the mapping of characters to entity references.

Parameters:
entitiesResource - Name of entities resource file that should be loaded, which describes that mapping of characters to entity references.
Method Detail

defineEntity

protected void defineEntity(java.lang.String name,
                            char value)
Defines a new character reference. The reference's name and value are supplied. Nothing happens if the character reference is already defined.

Unlike internal entities, character references are a string to single character mapping. They are used to map non-ASCII characters both on parsing and printing, primarily for HTML documents. '<amp;' is an example of a character reference.

Parameters:
name - The entity's name
value - The entity's value

getEntityNameForChar

public java.lang.String getEntityNameForChar(char value)
Resolve a character to an entity reference name.

Parameters:
value - character value that should be resolved to a name.
Returns:
name of character entity, or null if not found.

isSpecial

public boolean isSpecial(char value)
Tell if the character argument should have special treatment.

Parameters:
value - character value.
Returns:
true if the character should have any special treatment.

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs61

WebLogic classes and methods that do not appear in this reference are not public and are not supported.