Module java.desktop

Class Entity

  • All Implemented Interfaces:

    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 entity.
    See Also:
    • Field Detail

      • name

        public String name
        The name of the entity.
      • type

        public int type
        The type of the entity.
      • data

        public char[] data
        The char array of data.
    • Constructor Detail

      • Entity

        public Entity​(String name,
                      int type,
                      char[] data)
        Creates an entity.
        name - the name of the entity
        type - the type of the entity
        data - the char array of data
    • Method Detail

      • getName

        public String getName()
        Gets the name of the entity.
        the name of the entity, as a String
      • getType

        public int getType()
        Gets the type of the entity.
        the type of the entity
      • isParameter

        public boolean isParameter()
        Returns true if it is a parameter entity.
        true if it is a parameter entity
      • isGeneral

        public boolean isGeneral()
        Returns true if it is a general entity.
        true if it is a general entity
      • getData

        public char[] getData()
        Returns the data.
        the data
      • getString

        public String getString()
        Returns the data as a String.
        the data as a String
      • name2type

        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
        the corresponding entity type, or the type corresponding to "CDATA", if none exists