API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing.text.html. HTMLDocument.HTMLReader View Source
Author(s)
Since
Version
Serial
Hierarchy
 Object
      HTMLEditorKit.ParserCallback
          HTMLDocument.HTMLReader
Implements
Subclasses
Description
public class HTMLDocument.HTMLReader
  An HTML reader to load an HTML document with an HTML element structure.
See also:   
Constructors
public HTMLDocument.HTMLReader (int offset)
public HTMLDocument.HTMLReader (int offset, int popDepth, int pushDepth, Tag insertTag)
pack-private HTMLDocument.HTMLReader (int offset, int popDepth, int pushDepth, Tag insertTag, boolean insertInsertTag, boolean insertAfterImplied, boolean wantsTrailingNewline)
Generates a RuntimeException (will eventually generate a BadLocationException when API changes are alloced) if inserting into non empty document, insertTag is non-null, and offset is not in the body.
Methods
Hide/Show inherited methods
protected void addContent (char[] data, int offs, int length)
  Adds some text with the current character attributes.
protected void addContent (char[] data, int offs, int length, boolean generateImpliedPIfNecessary)
  Adds some text with the current character attributes.
pack-private void addCSSRules (String rules)
Adds the CSS rules in rules.
protected void addSpecialElement (Tag t, MutableAttributeSet a)
Adds content that is basically specified entirely in the attribute set.
protected void blockClose (Tag t)
Adds an instruction to the parse buffer to close out a block element of the given type.
protected void blockOpen (Tag t, MutableAttributeSet attr)
Adds an instruction to the parse buffer to create a block element with the given attributes.
public void flush () throws BadLocationException [Overrides HTMLEditorKit.ParserCallback]
  The last method called on the reader.
pack-private void flushBuffer (boolean endOfStream) throws BadLocationException
  Flushes the current parse buffer into the document.
public void handleComment (char[] data, int pos) [Overrides HTMLEditorKit.ParserCallback]
public void handleEndOfLineString (String eol) [Overrides HTMLEditorKit.ParserCallback]
  This is invoked after the stream has been parsed, but before flush.
public void handleEndTag (Tag t, int pos) [Overrides HTMLEditorKit.ParserCallback]
  Callback from the parser.
public void handleError (String errorMsg, int pos) [Inherited From HTMLEditorKit.ParserCallback]
public void handleSimpleTag (Tag t, MutableAttributeSet a, int pos) [Overrides HTMLEditorKit.ParserCallback]
  Callback from the parser.
public void handleStartTag (Tag t, MutableAttributeSet a, int pos) [Overrides HTMLEditorKit.ParserCallback]
  Callback from the parser.
public void handleText (char[] data, int pos) [Overrides HTMLEditorKit.ParserCallback]
Called by the parser to indicate a block of text was encountered.
pack-private void linkCSSStyleSheet (String href)
Adds the CSS stylesheet at href to the known list of stylesheets.
protected void popCharacterStyle ()
Pops a previously pushed character style off the stack to return to a previous style.
protected void preContent (char[] data)
  Adds the given content that was encountered in a PRE element.
protected void pushCharacterStyle ()
Pushes the current character style on a stack in preparation for forming a new nested character style.
protected void registerTag (Tag t, TagAction a)
  Registers a handler for the given tag.
protected void textAreaContent (char[] data)
  Adds the given content to the textarea document.
Fields
Hide/Show inherited fields
protected MutableAttributeSet charAttr
pack-private Stack charAttrStack
pack-private String defaultStyle
  Name of style to use.
pack-private boolean emptyAnchor
pack-private boolean emptyDocument
True if inserting into an empty document.
pack-private boolean foundInsertTag
Set to true when insertTag has been found.
publicfinalstatic Object IMPLIED [Inherited From HTMLEditorKit.ParserCallback]
  This is passed as an attribute in the attributeset to indicate the element is implied eg, the string '<>foo<\t>' contains an implied html element and an implied body element.
pack-private boolean impliedP
pack-private int inBlock
pack-private boolean inBody
True when the body has been encountered.
pack-private boolean inHead
True if inside the head tag.
pack-private boolean inParagraph
pack-private boolean inPre
pack-private boolean insertInsertTag
If true, the insertTag is inserted, otherwise elements after the insertTag is found are inserted.
pack-private Tag insertTag
If non null, gives parent Tag that insert is to happen at.
pack-private int insertTagDepthDelta
  When foundInsertTag is set to true, this will be updated to reflect the delta between the two structures.
pack-private boolean inStyle
Set to true when a style element is encountered.
pack-private boolean inTextArea
pack-private boolean inTitle
pack-private boolean isStyleCSS
  Set to true if the style language is text/css.
pack-private Map lastMap
Last Map that was encountered.
pack-private boolean lastWasNewline
pack-private boolean midInsert
True if (!emptyDocument && insertTag == null), this is used so much it is cached.
pack-private int offset
pack-private Option option
Current option, if in an option element (needed to load the label.
protected Vector<ElementSpec> parseBuffer
pack-private int popDepth
How many parents to ascend before insert new elements.
pack-private int pushDepth
How many parents to descend (relative to popDepth) before inserting.
pack-private AttributeSet styleAttributes
Attributes from a style Attribute.
pack-private Vector styles
  Vector describing styles that should be include.
pack-private Hashtable tagMap
pack-private TextAreaDocument textAreaDocument
pack-private int threshold
Nested Classes
  HTMLDocument.HTMLReader.TagAction
An action to be performed in response to parsing a tag.
  HTMLDocument.HTMLReader.BlockAction
  HTMLDocument.HTMLReader.ParagraphAction
  HTMLDocument.HTMLReader.SpecialAction
  HTMLDocument.HTMLReader.IsindexAction
  HTMLDocument.HTMLReader.HiddenAction
  HTMLDocument.HTMLReader.MetaAction
Subclass of HiddenAction to set the content type for style sheets, and to set the name of the default style sheet.
  HTMLDocument.HTMLReader.HeadAction
End if overridden to create the necessary stylesheets that are referenced via the link tag.
  HTMLDocument.HTMLReader.LinkAction
A subclass to add the AttributeSet to styles if the attributes contains an attribute for 'rel' with value 'stylesheet' or 'alternate stylesheet'.
  HTMLDocument.HTMLReader.MapAction
  HTMLDocument.HTMLReader.AreaAction
  HTMLDocument.HTMLReader.StyleAction
  HTMLDocument.HTMLReader.PreAction
  HTMLDocument.HTMLReader.CharacterAction
  HTMLDocument.HTMLReader.ConvertAction
Provides conversion of HTML tag/attribute mappings that have a corresponding StyleConstants and CSS mapping.
  HTMLDocument.HTMLReader.AnchorAction
  HTMLDocument.HTMLReader.TitleAction
  HTMLDocument.HTMLReader.BaseAction
  HTMLDocument.HTMLReader.ObjectAction
  HTMLDocument.HTMLReader.FormAction
Action to support forms by building all of the elements used to represent form controls.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar