Package Summary  Overview Summary

class:DTD [NONE]

  • All Implemented Interfaces:
    DTDConstants

    public class DTD
    extends Object
    implements DTDConstants
    
    The representation of an SGML DTD. DTD describes a document syntax and is used in parsing of HTML documents. It contains a list of elements and their attributes as well as a list of entities defined in the DTD.
    See Also:
    Element, AttributeList, ContentModel, Parser

field:name [NONE]

  • name

    public String name
    the name of the DTD

field:elements [NONE]

  • elements

    public Vector<Element> elements
    The vector of elements

field:elementHash [NONE]

  • elementHash

    public Hashtable<String,Element> elementHash
    The hash table contains the name of element and the corresponding element.

field:entityHash [NONE]

  • entityHash

    public Hashtable<Object,Entity> entityHash
    The hash table contains an Object and the corresponding Entity

field:pcdata [NONE]

  • pcdata

    public final Element pcdata
    The element corresponding to pcdata.

field:html [NONE]

  • html

    public final Element html
    The element corresponding to html.

field:meta [NONE]

  • meta

    public final Element meta
    The element corresponding to meta.

field:base [NONE]

  • base

    public final Element base
    The element corresponding to base.

field:isindex [NONE]

  • isindex

    public final Element isindex
    The element corresponding to isindex.

field:head [NONE]

  • head

    public final Element head
    The element corresponding to head.

field:body [NONE]

  • body

    public final Element body
    The element corresponding to body.

field:applet [NONE]

  • applet

    public final Element applet
    The element corresponding to applet.

field:param [NONE]

  • param

    public final Element param
    The element corresponding to param.

field:p [NONE]

  • p

    public final Element p
    The element corresponding to p.

field:title [NONE]

  • title

    public final Element title
    The element corresponding to title.

field:FILE_VERSION [NONE]

constructor:<init>(java.lang.String) [NONE]

  • DTD

    protected DTD​(String name)
    Creates a new DTD with the specified name.
    Parameters:
    name - the name, as a String of the new DTD

method:getName() [NONE]

  • getName

    public String getName()
    Gets the name of the DTD.
    Returns:
    the name of the DTD

method:getEntity(java.lang.String) [NONE]

  • getEntity

    public Entity getEntity​(String name)
    Gets an entity by name.
    Parameters:
    name - the entity name
    Returns:
    the Entity corresponding to the nameString

method:getEntity(int) [NONE]

  • getEntity

    public Entity getEntity​(int ch)
    Gets a character entity.
    Parameters:
    ch - the character
    Returns:
    the Entity corresponding to the ch character

method:getElement(java.lang.String) [NONE]

  • getElement

    public Element getElement​(String name)
    Gets an element by name. A new element is created if the element doesn't exist.
    Parameters:
    name - the requested String
    Returns:
    the Element corresponding to name, which may be newly created

method:getElement(int) [NONE]

  • getElement

    public Element getElement​(int index)
    Gets an element by index.
    Parameters:
    index - the requested index
    Returns:
    the Element corresponding to index

method:defineEntity(java.lang.String,int,char[]) [NONE]

  • defineEntity

    public Entity defineEntity​(String name,
                               int type,
                               char[] data)
    Defines an entity. If the Entity specified by name, type, and data exists, it is returned; otherwise a new Entity is created and is returned.
    Parameters:
    name - the name of the Entity as a String
    type - the type of the Entity
    data - the Entity's data
    Returns:
    the Entity requested or a new Entity if not found

method:defineElement(java.lang.String,int,boolean,boolean,javax.swing.text.html.parser.ContentModel,java.util.BitSet,java.util.BitSet,javax.swing.text.html.parser.AttributeList) [NONE]

  • defineElement

    public Element defineElement​(String name,
                                 int type,
                                 boolean omitStart,
                                 boolean omitEnd,
                                 ContentModel content,
                                 BitSet exclusions,
                                 BitSet inclusions,
                                 AttributeList atts)
    Returns the Element which matches the specified parameters. If one doesn't exist, a new one is created and returned.
    Parameters:
    name - the name of the Element
    type - the type of the Element
    omitStart - true if start should be omitted
    omitEnd - true if end should be omitted
    content - the ContentModel
    exclusions - the set of elements that must not occur inside the element
    inclusions - the set of elements that can occur inside the element
    atts - the AttributeList specifying the Element
    Returns:
    the Element specified

method:defineAttributes(java.lang.String,javax.swing.text.html.parser.AttributeList) [NONE]

  • defineAttributes

    public void defineAttributes​(String name,
                                 AttributeList atts)
    Defines attributes for an Element.
    Parameters:
    name - the name of the Element
    atts - the AttributeList specifying the Element

method:defEntity(java.lang.String,int,int) [NONE]

  • defEntity

    public Entity defEntity​(String name,
                            int type,
                            int ch)
    Creates and returns a character Entity.
    Parameters:
    name - the entity's name
    type - the entity's type
    ch - the entity's value (character)
    Returns:
    the new character Entity

method:defEntity(java.lang.String,int,java.lang.String) [NONE]

  • defEntity

    protected Entity defEntity​(String name,
                               int type,
                               String str)
    Creates and returns an Entity.
    Parameters:
    name - the entity's name
    type - the entity's type
    str - the entity's data section
    Returns:
    the new Entity

method:defElement(java.lang.String,int,boolean,boolean,javax.swing.text.html.parser.ContentModel,java.lang.String[],java.lang.String[],javax.swing.text.html.parser.AttributeList) [NONE]

  • defElement

    protected Element defElement​(String name,
                                 int type,
                                 boolean omitStart,
                                 boolean omitEnd,
                                 ContentModel content,
                                 String[] exclusions,
                                 String[] inclusions,
                                 AttributeList atts)
    Creates and returns an Element.
    Parameters:
    name - the element's name
    type - the element's type
    omitStart - true if the element needs no starting tag
    omitEnd - true if the element needs no closing tag
    content - the element's content
    exclusions - the elements that must be excluded from the content of the element
    inclusions - the elements that can be included as the content of the element
    atts - the attributes of the element
    Returns:
    the new Element

method:defAttributeList(java.lang.String,int,int,java.lang.String,java.lang.String,javax.swing.text.html.parser.AttributeList) [NONE]

  • defAttributeList

    protected AttributeList defAttributeList​(String name,
                                             int type,
                                             int modifier,
                                             String value,
                                             String values,
                                             AttributeList atts)
    Creates and returns an AttributeList responding to a new attribute.
    Parameters:
    name - the attribute's name
    type - the attribute's type
    modifier - the attribute's modifier
    value - the default value of the attribute
    values - the allowed values for the attribute (multiple values could be separated by '|')
    atts - the previous attribute of the element; to be placed to AttributeList.next, creating a linked list
    Returns:
    the new AttributeList

method:defContentModel(int,java.lang.Object,javax.swing.text.html.parser.ContentModel) [NONE]

  • defContentModel

    protected ContentModel defContentModel​(int type,
                                           Object obj,
                                           ContentModel next)
    Creates and returns a new content model.
    Parameters:
    type - the type of the new content model
    obj - the content of the content model
    next - pointer to the next content model
    Returns:
    the new ContentModel

method:toString() [NONE]

  • toString

    public String toString()
    Returns a string representation of this DTD.
    Overrides:
    toString in class Object
    Returns:
    the string representation of this DTD

method:putDTDHash(java.lang.String,javax.swing.text.html.parser.DTD) [NONE]

  • putDTDHash

    public static void putDTDHash​(String name,
                                  DTD dtd)
    Put a name and appropriate DTD to hashtable.
    Parameters:
    name - the name of the DTD
    dtd - the DTD

method:getDTD(java.lang.String) [NONE]

  • getDTD

    public static DTD getDTD​(String name)
                      throws IOException
    
    Returns a DTD with the specified name. If a DTD with that name doesn't exist, one is created and returned. Any uppercase characters in the name are converted to lowercase.
    Parameters:
    name - the name of the DTD
    Returns:
    the DTD which corresponds to name
    Throws:
    IOException - if an I/O error occurs

method:read(java.io.DataInputStream) [NONE]

  • read

    public void read​(DataInputStream in)
              throws IOException
    
    Recreates a DTD from an archived format.
    Parameters:
    in - the DataInputStream to read from
    Throws:
    IOException - if an I/O error occurs

© 2019 Oracle Corporation and/or its affiliates