Class Entity
java.lang.Object
javax.swing.text.html.parser.Entity
- All Implemented Interfaces:
DTDConstants
An entity is described in a DTD using the ENTITY construct.
It defines the type and value of the entity.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionchar[]
The char array of data.The name of the entity.int
The type of the entity.Fields declared in interface 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
Modifier and TypeFieldDescriptionstatic final int
The DTD constant corresponds to ANYstatic final int
The DTD constant corresponds to CDATAstatic final int
The DTD constant corresponds to CONREFstatic final int
The DTD constant corresponds to CURRENTstatic final int
The DTD constant corresponds to DEFAULTstatic final int
The DTD constant corresponds to EMPTYstatic final int
The DTD constant corresponds to ENDTAGstatic final int
The DTD constant corresponds to ENTITIESstatic final int
The DTD constant corresponds to ENTITYstatic final int
The DTD constant corresponds to FIXEDstatic final int
The DTD constant corresponds to GENERALstatic final int
The DTD constant corresponds to IDstatic final int
The DTD constant corresponds to IDREFstatic final int
The DTD constant corresponds to IDREFSstatic final int
The DTD constant corresponds to IMPLIEDstatic final int
The DTD constant corresponds to MDstatic final int
The DTD constant corresponds to MODELstatic final int
The DTD constant corresponds to MSstatic final int
The DTD constant corresponds to NAMEstatic final int
The DTD constant corresponds to NAMESstatic final int
The DTD constant corresponds to NMTOKENstatic final int
The DTD constant corresponds to NMTOKENSstatic final int
The DTD constant corresponds to NOTATIONstatic final int
The DTD constant corresponds to NUMBERstatic final int
The DTD constant corresponds to NUMBERSstatic final int
The DTD constant corresponds to NUTOKENstatic final int
The DTD constant corresponds to NUTOKENSstatic final int
The DTD constant corresponds to PARAMETERstatic final int
The DTD constant corresponds to PIstatic final int
The DTD constant corresponds to PUBLICstatic final int
The DTD constant corresponds to RCDATAstatic final int
The DTD constant corresponds to REQUIREDstatic final int
The DTD constant corresponds to SDATAstatic final int
The DTD constant corresponds to STARTTAGstatic final int
The DTD constant corresponds to SYSTEM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionchar[]
getData()
Returns thedata
.getName()
Gets the name of the entity.Returns the data as aString
.int
getType()
Gets the type of the entity.boolean
Returnstrue
if it is a general entity.boolean
Returnstrue
if it is a parameter entity.static int
Convertsnm
string to the corresponding entity type.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Modifier and TypeMethodDescriptionprotected Object
clone()
Creates and returns a copy of this object.boolean
Indicates whether some other object is "equal to" this one.protected void
finalize()
Deprecated, for removal: This API element is subject to removal in a future version.Finalization is deprecated and subject to removal in a future release.final Class
<?> getClass()
Returns the runtime class of thisObject
.int
hashCode()
Returns a hash code value for this object.final void
notify()
Wakes up a single thread that is waiting on this object's monitor.final void
Wakes up all threads that are waiting on this object's monitor.toString()
Returns a string representation of the object.final void
wait()
Causes the current thread to wait until it is awakened, typically by being notified or interrupted.final void
wait
(long timeoutMillis) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.final void
wait
(long timeoutMillis, int nanos) Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.
-
Field Details
-
name
The name of the entity. -
type
public int typeThe type of the entity. -
data
public char[] dataThe char array of data.
-
-
Constructor Details
-
Entity
Creates an entity.- Parameters:
name
- the name of the entitytype
- the type of the entitydata
- the char array of data
-
-
Method Details
-
getName
-
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
-
name2type
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
-