public final class Entity extends Object implements DTDConstants
DTD
Modifier and Type | Field and Description |
---|---|
char[] |
data |
String |
name |
int |
type |
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 and Description |
---|
Entity(String name,
int type,
char[] data)
Creates an entity.
|
Modifier and Type | Method and 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(String nm)
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 Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2024, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.