public final class

Entity

extends Object
implements DTDConstants
java.lang.Object
   ↳ javax.swing.text.html.parser.Entity

Class Overview

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

See Also

Summary

[Expand]
Inherited Constants
From interface javax.swing.text.html.parser.DTDConstants
Fields
public char[] data
public String name
public int type
Public Constructors
Entity(String name, int type, char[] data)
Creates an entity.
Public Methods
char[] getData()
Returns the data.
String getName()
Gets the name of the entity.
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(String nm)
Converts nm string to the corresponding entity type.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public char[] data

public String name

public int type

Public Constructors

public 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

Public Methods

public char[] getData ()

Returns the data.

Returns
  • the data

public String getName ()

Gets the name of the entity.

Returns
  • the name of the entity, as a String

public String getString ()

Returns the data as a String.

Returns
  • the data as a String

public int getType ()

Gets the type of the entity.

Returns
  • the type of the entity

public boolean isGeneral ()

Returns true if it is a general entity.

Returns
  • true if it is a general entity

public boolean isParameter ()

Returns true if it is a parameter entity.

Returns
  • true if it is a parameter entity

public static int name2type (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".

Parameters
nm the string to be converted
Returns
  • the corresponding entity type, or the type corresponding to "CDATA", if none exists