Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.hexidec.ekit.component.parser
Class Entity  view Entity download Entity.java

java.lang.Object
  extended bycom.hexidec.ekit.component.parser.Entity
All Implemented Interfaces:
DTDConstants

public final class Entity
extends java.lang.Object
implements DTDConstants

An entity is described in a DTD using the ENTITY construct. It defines the type and value of the the entity.

Version:
1.8, 12/03/01

Field Summary
 char[] data
           
(package private) static java.util.Hashtable entityTypes
           
 java.lang.String name
           
 int type
           
 
Fields inherited from interface com.hexidec.ekit.component.parser.DTDConstants
ANY, CDATA, CONREF, CURRENT, DEFAULT, EMPTY, ENDTAG, ENTITIES, ENTITY, FIXED, GENERAL, ID, IDREF, IDREFS, IMPLIED, MD, MODEL, MS, NAME, NAMES, NMTOKEN, NMTOKENS, NOTATION, NUMBER, NUMBERS, NUTOKEN, NUTOKENS, PARAMETER, PI, PUBLIC, RCDATA, REQUIRED, SDATA, STARTTAG, SYSTEM
 
Constructor Summary
Entity(java.lang.String name, int type, char[] data)
          Creates an entity.
 
Method Summary
 char[] getData()
          Returns the data.
 java.lang.String getName()
          Gets the name of the entity.
 java.lang.String getString()
          Returns the data as a String.
 int getType()
          Gets the type of the entity.
 boolean isGeneral()
          Returns true if it is a general entity.
 boolean isParameter()
          Returns true if it is a parameter entity.
static int name2type(java.lang.String nm)
          Converts nm string to the corresponding entity type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

public java.lang.String name

type

public int type

data

public char[] data

entityTypes

static java.util.Hashtable entityTypes
Constructor Detail

Entity

public Entity(java.lang.String name,
              int type,
              char[] data)
Creates an entity.

Method Detail

getName

public java.lang.String getName()
Gets the name of the entity.


getType

public int getType()
Gets the type of the entity.


isParameter

public boolean isParameter()
Returns true if it is a parameter entity.


isGeneral

public boolean isGeneral()
Returns true if it is a general entity.


getData

public char[] getData()
Returns the data.


getString

public java.lang.String getString()
Returns the data as a String.


name2type

public static int name2type(java.lang.String nm)
Converts nm string to the corresponding entity type. If the string does not have a corresponding entity type, returns the type corresponding to "CDATA". Valid entity types are: "PUBLIC", "CDATA", "SDATA", "PI", "STARTTAG", "ENDTAG", "MS", "MD", "SYSTEM".