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.
DTD
public String name
public int type
public char[] data
public Entity(String name, int type, char[] data)
Creates an entity.
name
- the name of the entitytype
- the type of the entitydata
- the char array of datapublic String getName()
Gets the name of the entity.
String
public int getType()
Gets the type of the entity.
public boolean isParameter()
Returns true
if it is a parameter entity.
true
if it is a parameter entitypublic boolean isGeneral()
Returns true
if it is a general entity.
true
if it is a general entitypublic char[] getData()
Returns the data
.
data
public String getString()
Returns the data as a String
.
String
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".
nm
- the string to be converted
© 1993–2017, 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.