APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.text.html.parser

public final Class Entity

extends Object
implements DTDConstants
Class Inheritance
All Implemented Interfaces
javax.swing.text.html.parser.DTDConstants
Imports
java.util.Map

An entity is described in a DTD using the ENTITY construct. It defines the type and value of the entity.
Author
Arthur van Hoff
See Also
DTD

Field Summary

Modifier and TypeField and Description
public char[]
data

The char array of data.

private static final Map<String, Integer>
public String
name

The name of the entity.

public int
type

The type of the entity.

Constructor Summary

AccessConstructor and Description
public
Entity(String
the name of the entity
name
,
int
the type of the entity
type
,
char[]
the char array of data
data
)

Creates an entity.

Method Summary

Modifier and TypeMethod and Description
public char[]

Returns:

the data
getData
()

Returns the data.

public String

Returns:

the name of the entity, as a String
getName
()

Gets the name of the entity.

public String

Returns:

the data as a String
getString
()

Returns the data as a String.

public int

Returns:

the type of the entity
getType
()

Gets the type of the entity.

public boolean

Returns:

true if it is a general entity
isGeneral
()

Returns true if it is a general entity.

public boolean

Returns:

true if it is a parameter entity
isParameter
()

Returns true if it is a parameter entity.

public static int

Returns:

the corresponding entity type, or the type corresponding to "CDATA", if none exists
name2type
(String
the string to be converted
nm
)

Converts nm string to the corresponding entity type.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
public char[] data

The char array of data.

entityTypesback to summary
private static final Map<String, Integer> entityTypes
nameback to summary
public String name

The name of the entity.

typeback to summary
public int type

The type of the entity.

Constructor Detail

Entityback to summary
public Entity(String name, int type, char[] data)

Creates an entity.

Parameters
name:String

the name of the entity

type:int

the type of the entity

data:char[]

the char array of data

Method Detail

getDataback to summary
public char[] getData()

Returns the data.

Returns:char[]

the data

getNameback to summary
public String getName()

Gets the name of the entity.

Returns:String

the name of the entity, as a String

getStringback to summary
public String getString()

Returns the data as a String.

Returns:String

the data as a String

getTypeback to summary
public int getType()

Gets the type of the entity.

Returns:int

the type of the entity

isGeneralback to summary
public boolean isGeneral()

Returns true if it is a general entity.

Returns:boolean

true if it is a general entity

isParameterback to summary
public boolean isParameter()

Returns true if it is a parameter entity.

Returns:boolean

true if it is a parameter entity

name2typeback to summary
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:String

the string to be converted

Returns:int

the corresponding entity type, or the type corresponding to "CDATA", if none exists