- java.lang.Object
- 
- javax.swing.text.html.parser.Entity
 
- 
- All Implemented Interfaces:
- DTDConstants
 
 public final class Entity extends Object implements DTDConstants An entity is described in a DTD using the ENTITY construct. It defines the type and value of the entity.- See Also:
- DTD
 
- 
- 
Field SummaryFields Modifier and Type Field Description char[]dataThe char array of data.StringnameThe name of the entity.inttypeThe type of the entity.- 
Fields declared in interface javax.swing.text.html.parser.DTDConstantsANY, 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
 
- 
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description char[]getData()Returns thedata.StringgetName()Gets the name of the entity.StringgetString()Returns the data as aString.intgetType()Gets the type of the entity.booleanisGeneral()Returnstrueif it is a general entity.booleanisParameter()Returnstrueif it is a parameter entity.static intname2type(String nm)Convertsnmstring to the corresponding entity type.
 
- 
- 
- 
Field Detail- 
namepublic String name The name of the entity.
 - 
typepublic int type The type of the entity.
 - 
datapublic char[] data The char array of data.
 
- 
 - 
Constructor Detail- 
Entitypublic Entity(String name, int type, char[] data) Creates an entity.- Parameters:
- name- the name of the entity
- type- the type of the entity
- data- the char array of data
 
 
- 
 - 
Method Detail- 
getNamepublic String getName() Gets the name of the entity.- Returns:
- the name of the entity, as a String
 
 - 
getTypepublic int getType() Gets the type of the entity.- Returns:
- the type of the entity
 
 - 
isParameterpublic boolean isParameter() Returnstrueif it is a parameter entity.- Returns:
- trueif it is a parameter entity
 
 - 
isGeneralpublic boolean isGeneral() Returnstrueif it is a general entity.- Returns:
- trueif it is a general entity
 
 - 
getDatapublic char[] getData() Returns thedata.- Returns:
- the data
 
 - 
getStringpublic String getString() Returns the data as aString.- Returns:
- the data as a String
 
 - 
name2typepublic static int name2type(String nm) Convertsnmstring 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".- Parameters:
- nm- the string to be converted
- Returns:
- the corresponding entity type, or the type corresponding to "CDATA", if none exists
 
 
- 
 
-