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.intThe 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, SYSTEMModifier and TypeFieldDescriptionstatic final intThe DTD constant corresponds to ANYstatic final intThe DTD constant corresponds to CDATAstatic final intThe DTD constant corresponds to CONREFstatic final intThe DTD constant corresponds to CURRENTstatic final intThe DTD constant corresponds to DEFAULTstatic final intThe DTD constant corresponds to EMPTYstatic final intThe DTD constant corresponds to ENDTAGstatic final intThe DTD constant corresponds to ENTITIESstatic final intThe DTD constant corresponds to ENTITYstatic final intThe DTD constant corresponds to FIXEDstatic final intThe DTD constant corresponds to GENERALstatic final intThe DTD constant corresponds to IDstatic final intThe DTD constant corresponds to IDREFstatic final intThe DTD constant corresponds to IDREFSstatic final intThe DTD constant corresponds to IMPLIEDstatic final intThe DTD constant corresponds to MDstatic final intThe DTD constant corresponds to MODELstatic final intThe DTD constant corresponds to MSstatic final intThe DTD constant corresponds to NAMEstatic final intThe DTD constant corresponds to NAMESstatic final intThe DTD constant corresponds to NMTOKENstatic final intThe DTD constant corresponds to NMTOKENSstatic final intThe DTD constant corresponds to NOTATIONstatic final intThe DTD constant corresponds to NUMBERstatic final intThe DTD constant corresponds to NUMBERSstatic final intThe DTD constant corresponds to NUTOKENstatic final intThe DTD constant corresponds to NUTOKENSstatic final intThe DTD constant corresponds to PARAMETERstatic final intThe DTD constant corresponds to PIstatic final intThe DTD constant corresponds to PUBLICstatic final intThe DTD constant corresponds to RCDATAstatic final intThe DTD constant corresponds to REQUIREDstatic final intThe DTD constant corresponds to SDATAstatic final intThe DTD constant corresponds to STARTTAGstatic final intThe 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.intgetType()Gets the type of the entity.booleanReturnstrueif it is a general entity.booleanReturnstrueif it is a parameter entity.static intConvertsnmstring to the corresponding entity type.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.toString()Answers a string containing a concise, human-readable description of the receiver.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
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()Returnstrueif it is a parameter entity.- Returns:
trueif it is a parameter entity
-
isGeneral
public boolean isGeneral()Returnstrueif it is a general entity.- Returns:
trueif it is a general entity
-
getData
public char[] getData()Returns thedata.- Returns:
- the
data
-
getString
-
name2type
Convertsnmstring 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
-