Generated by
JDiff

javax.swing.text.html.parser Documentation Differences

This file contains all the changes in documentation in the package javax.swing.text.html.parser as colored differences. Deletions are shown like this, and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a <code> tag will cause all subsequent paragraphs to be displayed differently.

Class AttributeList

This class defines the attributes of an SGML element as described in a DTD using the ATTLIST construct. An AttributeList can be obtained from the Element class using the getAttributes() method.

It is actually an element in a linked list. Use the getNext() method repeatedly to enumerate all the attributes of an element. @see Element @author Arthur Van Hoff @version 1.4 086 02/2602/9800


Class ContentModel

A representation of a content model. A content model is basically a restricted BNF expression. It is restricted in the sense that it must be deterministic. This means that you don't have to represent it as a finite state automata.

See Annex H on page 556 of the SGML handbook for more information. @author Arthur van Hoff @version 1.4 086 02/2602/9800


Class DTD

The representation of an SGML DTD. This is produced by the DTDParser. The resulting DTD object describes a document syntax and is needed to parser HTML documents using the Parser. It contains a list of elements and their attributes as well as a list of entities defined in the DTD. @see Element @see AttributeList @see ContentModel @see DTDParser @see Parser @author Arthur van Hoff @version 1.9 0410 02/2202/9900

Class DTDConstants

SGML constants used in a DTD. The names of the constants correspond the the equivalent SGML constructs as described in "The SGML Handbook" by Charles F. Goldfarb. @see DTD @see Element @see Attributes @version 1.4 087 02/2602/9800 @author Arthur van Hoff

Class DocumentParser

A Parser for HTML Documents (actually you can specify a DTD but you should really only use this class with the html dtd in swing). ReadReads an InputStream of HTML and invokeinvokes the appropriate methods in the ParserCallback class. This is the default parser used by HTMLEditorKit to parse HTML url's.

This will message the callback for all valid tags as well as tags that are implied but not explicitly specified. For example the html string (<p>blah) only has a p tag defined. The callback will see the following methods:

  1. handleStartTag(html ...)
  2. handleStartTag(head ...)
  3. handleEndTag(head)
  4. handleStartTag(body ...)
  5. handleStartTag(p ...)
  6. handleText(...)
  7. handleEndTag(p)
  8. handleEndTag(body)
  9. handleEndTag(html)
The items in italic are implied that is although they were not explicitly specified to be correct html they should have been present (head isn't necessary but it is still generated). For tags that are implied the AttributeSet argument will have a value of Boolean.TRUE for the key HTMLEditorKit.ParserCallback.IMPLIED.

HTML.Attributes defines a type safe enumeration of html attributes. If an attribute key of a tag is defined in HTML.Attribute the HTML.Attribute will be used as the key otherwise a String will be used. For example <p foo=bar class=neat> has two attributes. foo is not defined in HTML.Attribute where as class is therefore the AttributeSet will have two values in it HTML.Attribute.CLASS with a String value of 'neat' and the String key 'foo' with a String value of 'bar'.

The position argument will indicate the start of the tag comment or text. Similiar to arrays the first character in the stream has a position of 0. For tags that are implied the position will indicate the location of the next encountered tag. In the first example the implied start body and html tags will have the same position as the p tag and the implied end p html and body tags will all have the same position.

As html skips whitespace the position for text will be the position of the first valid character eg in the string '\n\n\nblah' the text 'blah' will have a position of 3 the newlines are skipped.

For attributes that do not have a value eg in the html string <foo blah> the attribute blah does not have a value there are two possible values that will be placed in the AttributeSet's value:

Once the stream has been parsed the callback is notified of the most likely end of line string. The end of line string will be one of \n \r or \r\n which ever is encountered the most in parsing the stream. @version 1.15 1122 02/0602/9800 @author Sunita Mani


Class Element

An element as described in a DTD using the ELEMENT construct. This is essentiall the description of a tag. It describes the type content model attributes attribute types etc. It is used to correctly parse a document by the Parser. @see DTD @see AttributeList @version 1.4 086 02/2602/9800 @author Arthur van Hoff

Class Entity

An entity in as described in a DTD using the ENTITY construct. It defines the type and value of the the entity. @see DTD @version 1.4 086 02/2602/9800 @author Arthur van Hoff

Class Parser

A simple DTD-driven HTML parser. The parser reads an HTML file from an InputStream and calls various methods (which should be overridden in a subclass) when tags and data are encountered.

Unfortunately there are many badly implemented HTML parsers out there and as a result there are many badly formatted HTML files. This parser attempts to parse most HTML files. This means that the implementation sometimes deviates from the SGML specification in favor of HTML.

The parser treats \r and \r\n as \n. Newlines after starttags and before end tags are ignored just as specified in the SGML/HTML specification. @see DTD @see TagTagElement @see SimpleAttributeSet @version 1.1724 1102/0602/9800 @author Arthur van Hoff @author Sunita Mani


Class ParserDelegator

Responsible for starting up a new DocumentParser each time its parse method is invoked. Stores a reference to the dtd. @author Sunita Mani @version 1.6 048 02/2202/9900

Class TagElement

A generic HTML TagElement class. The methods define how white space is interpreted around the tag. @version 1.6 088 02/2602/9800 @author Sunita Mani