javax.swing.text.html.parser
Class TagStack

java.lang.Object
  |
  +--javax.swing.text.html.parser.TagStack
All Implemented Interfaces:
DTDConstants

final class TagStack
extends Object
implements DTDConstants

A stack of tags. Used while parsing an HTML document. It, together with the ContentModelStates, defines the complete state of the parser while reading a document. When a start tag is encountered an element is pushed onto the stack, when an end tag is enountered an element is popped of the stack.

Version:
1.8, 12/03/01
Author:
Arthur van Hoff
See Also:
Parser, DTD, ContentModelState

Field Summary
(package private)  Element elem
           
(package private)  BitSet exclusions
           
(package private)  BitSet inclusions
           
(package private)  boolean net
           
(package private)  TagStack next
           
(package private)  boolean pre
           
(package private)  ContentModelState state
           
(package private)  TagElement tag
           
 
Fields inherited from interface javax.swing.text.html.parser.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
 
Constructor Summary
(package private) TagStack(TagElement tag, TagStack next)
          Construct a stack element.
 
Method Summary
(package private)  boolean advance(Element elem)
          Advance the state by reducing the given element.
 ContentModel contentModel()
          Return the ContentModel that must be satisfied by what comes next in the input stream.
(package private)  boolean excluded(int elemIndex)
          Return true if the element that is contained at the index specified by the parameter is part of the exclusions specified in the DTD for the element currently on the TagStack.
 Element first()
          Return the element that must come next in the input stream.
(package private)  boolean included(Vector elemVec, DTD dtd)
          Update the Vector elemVec with all the elements that are part of the inclusions listed in DTD for the element currently on the TagStack.
(package private)  boolean terminate()
          Return true if the current state can be terminated.
 String toString()
          Convert to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tag

TagElement tag

elem

Element elem

state

ContentModelState state

next

TagStack next

inclusions

BitSet inclusions

exclusions

BitSet exclusions

net

boolean net

pre

boolean pre
Constructor Detail

TagStack

TagStack(TagElement tag,
         TagStack next)
Construct a stack element.

Method Detail

first

public Element first()
Return the element that must come next in the input stream.


contentModel

public ContentModel contentModel()
Return the ContentModel that must be satisfied by what comes next in the input stream.


excluded

boolean excluded(int elemIndex)
Return true if the element that is contained at the index specified by the parameter is part of the exclusions specified in the DTD for the element currently on the TagStack.


included

boolean included(Vector elemVec,
                 DTD dtd)
Update the Vector elemVec with all the elements that are part of the inclusions listed in DTD for the element currently on the TagStack.


advance

boolean advance(Element elem)
Advance the state by reducing the given element. Returns false if the element is not legal and the state is not advanced.


terminate

boolean terminate()
Return true if the current state can be terminated.


toString

public String toString()
Convert to a string.

Overrides:
toString in class Object
Returns:
a string representation of the object.


comments?