- 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 the entity.- See Also:
DTD
-
-
Field Summary
Fields Modifier and Type Field and Description char[]
data
String
name
int
type
-
Fields inherited from interface javax.swing.text.html.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
Constructors Constructor and Description Entity(String name, int type, char[] data)
Creates an entity.
-
Method Summary
Methods Modifier and Type Method and Description char[]
getData()
Returns thedata
.String
getName()
Gets the name of the entity.String
getString()
Returns the data as aString
.int
getType()
Gets the type of the entity.boolean
isGeneral()
Returnstrue
if it is a general entity.boolean
isParameter()
Returnstrue
if it is a parameter entity.static int
name2type(String nm)
Convertsnm
string to the corresponding entity type.
-
-
-
Field Detail
-
name
public String name
-
type
public int type
-
data
public char[] data
-
-
Constructor Detail
-
Entity
public Entity(String name, int type, char[] data)
Creates an entity.- Parameters:
name
- the name of the entitytype
- the type of the entitydata
- the char array of data
-
-
Method Detail
-
getName
public String getName()
Gets the name of the entity.- Returns:
- the name of the entity, as a
String
-
getType
public int getType()
Gets the type of the entity.- Returns:
- the type of the entity
-
isParameter
public boolean isParameter()
Returnstrue
if it is a parameter entity.- Returns:
true
if it is a parameter entity
-
isGeneral
public boolean isGeneral()
Returnstrue
if it is a general entity.- Returns:
true
if it is a general entity
-
getData
public char[] getData()
Returns thedata
.- Returns:
- the
data
-
getString
public String getString()
Returns the data as aString
.- Returns:
- the data as a
String
-
name2type
public static int name2type(String nm)
Convertsnm
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
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/swing/text/html/parser/Entity.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.