DTDConstants
public final class Entity extends Object implements DTDConstants
Modifier and Type | Field | Description |
---|---|---|
char[] |
data |
The char array of data. |
String |
name |
The name of the entity. |
int |
type |
The type of the entity. |
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 | Description |
---|---|
Entity |
Creates an entity. |
Modifier and Type | Method | Description |
---|---|---|
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 |
Converts nm string to the corresponding entity type. |
public String name
public int type
public char[] data
public Entity(String name, int type, char[] data)
name
- the name of the entitytype
- the type of the entitydata
- the char array of datapublic String getName()
String
public int getType()
public boolean isParameter()
true
if it is a parameter entity.true
if it is a parameter entitypublic boolean isGeneral()
true
if it is a general entity.true
if it is a general entitypublic char[] getData()
data
.data
public String getString()
String
.String
public static int name2type(String nm)
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".nm
- the string to be converted
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/text/html/parser/Entity.html