## com.lowagie.text.html.simpleparser
Class HTMLWorker

    java.lang.Object
      com.lowagie.text.html.simpleparser.HTMLWorker

All Implemented Interfaces:
  DocListener, ElementListener, SimpleXMLDocHandler, java.util.EventListener

    public class HTMLWorker

extends java.lang.Object
implements SimpleXMLDocHandler, DocListener

Field Summary
`private ChainedProperties` `cprops`
`private Paragraph` `currentParagraph`
`protected DocListener` `document`
`private FactoryProperties` `factoryProperties`
`private java.util.HashMap` `interfaceProps`
`private boolean` `isPRE`
`protected java.util.ArrayList` `objectList`
`private boolean` `pendingLI`
`private boolean` `pendingTD`
`private boolean` `pendingTR`
`private boolean` `skipText`
`private java.util.Stack` `stack`
`private StyleSheet` `style`
`private java.util.Stack` `tableState`
`static java.util.HashMap` `tagsSupported`
`static java.lang.String` `tagsSupportedString`

Constructor Summary
`HTMLWorker(DocListener document)` Creates a new instance of HTMLWorker

Method Summary
`boolean` `add(Element element)` Signals that an `Element` was added to the `Document`.
`boolean` `add(Watermark watermark)` Signals that a `Watermark` was added to the `Document`.
`void` `clearTextWrap()` Clears text wrapping around images (if applicable).
`void` `close()` Signals that the `Document` was closed and that no other `Elements` will be added.
`void` `endDocument()` Called after the document is parsed.
`void` `endElement(java.lang.String tag)` Called when an end tag is found.
`java.util.HashMap` `getInterfaceProps()`
`StyleSheet` `getStyleSheet()`
`private static float` `lengthParse(java.lang.String txt, int c)`
`boolean` `newPage()` Signals that an new page has to be started.
`void` `open()` Signals that the `Document` has been opened and that `Elements` can be added.
`void` `parse(java.io.Reader reader)`
`static java.util.ArrayList` `parseToList(java.io.Reader reader, StyleSheet style)`
`static java.util.ArrayList` `parseToList(java.io.Reader reader, StyleSheet style, java.util.HashMap interfaceProps)`
`void` `removeWatermark()` Signals that a `Watermark` was removed from the `Document`.
`void` `resetFooter()` Resets the footer of this document.
`void` `resetHeader()` Resets the header of this document.
`void` `resetPageCount()` Sets the page number to 0.
`void` `setFooter(HeaderFooter footer)` Changes the footer of this document.
`void` `setHeader(HeaderFooter header)` Changes the header of this document.
`void` `setInterfaceProps(java.util.HashMap interfaceProps)`
`boolean` `setMarginMirroring(boolean marginMirroring)` Parameter that allows you to do margin mirroring (odd/even pages)
`boolean` `setMargins(float marginLeft, float marginRight, float marginTop, float marginBottom)` Sets the margins.
`void` `setPageCount(int pageN)` Sets the page number.
`boolean` `setPageSize(Rectangle pageSize)` Sets the pagesize.
`void` `setStyleSheet(StyleSheet style)`
`void` `startDocument()` Called when the document starts to be parsed.
`void` `startElement(java.lang.String tag, java.util.HashMap h)` Called when a start tag is found.
`void` `text(java.lang.String str)` Called when a text element is found.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### objectList

    protected java.util.ArrayList objectList

### document

    protected DocListener document

### currentParagraph

    private Paragraph currentParagraph

### cprops

    private ChainedProperties cprops

### stack

    private java.util.Stack stack

### pendingTR

    private boolean pendingTR

### pendingTD

    private boolean pendingTD

### pendingLI

    private boolean pendingLI

### style

    private StyleSheet style

### isPRE

    private boolean isPRE

### tableState

    private java.util.Stack tableState

### skipText

    private boolean skipText

### interfaceProps

    private java.util.HashMap interfaceProps

### factoryProperties

    private FactoryProperties factoryProperties

### tagsSupportedString

    public static final java.lang.String tagsSupportedString

See Also:
  Constant Field Values

### tagsSupported

    public static final java.util.HashMap tagsSupported

Constructor Detail

### HTMLWorker

    public HTMLWorker(DocListener document)

  Creates a new instance of HTMLWorker

Method Detail

### setStyleSheet

    public void setStyleSheet(StyleSheet style)

### getStyleSheet

    public StyleSheet getStyleSheet()

### setInterfaceProps

    public void setInterfaceProps(java.util.HashMap interfaceProps)

### getInterfaceProps

    public java.util.HashMap getInterfaceProps()

### parse

    public void parse(java.io.Reader reader)
               throws java.io.IOException

  Throws:
    `java.io.IOException`

### parseToList

    public static java.util.ArrayList parseToList(java.io.Reader reader,
                                                  StyleSheet style)
                                           throws java.io.IOException

  Throws:
    `java.io.IOException`

### parseToList

    public static java.util.ArrayList parseToList(java.io.Reader reader,
                                                  StyleSheet style,
                                                  java.util.HashMap interfaceProps)
                                           throws java.io.IOException

  Throws:
    `java.io.IOException`

### endDocument

    public void endDocument()

  Description copied from interface: `SimpleXMLDocHandler`
  Called after the document is parsed.

  Specified by:
    `endDocument` in interface `SimpleXMLDocHandler`

### startDocument

    public void startDocument()

  Description copied from interface: `SimpleXMLDocHandler`
  Called when the document starts to be parsed.

  Specified by:
    `startDocument` in interface `SimpleXMLDocHandler`

### startElement

    public void startElement(java.lang.String tag,
                             java.util.HashMap h)

  Description copied from interface: `SimpleXMLDocHandler`
  Called when a start tag is found.

  Specified by:
    `startElement` in interface `SimpleXMLDocHandler`
  Parameters:
    `tag` - the tag name
    `h` - the tag's attributes

### endElement

    public void endElement(java.lang.String tag)

  Description copied from interface: `SimpleXMLDocHandler`
  Called when an end tag is found.

  Specified by:
    `endElement` in interface `SimpleXMLDocHandler`
  Parameters:
    `tag` - the tag name

### text

    public void text(java.lang.String str)

  Description copied from interface: `SimpleXMLDocHandler`
  Called when a text element is found.

  Specified by:
    `text` in interface `SimpleXMLDocHandler`
  Parameters:
    `str` - the text element, probably a fragment.

### add

    public boolean add(Element element)
                throws DocumentException

  Description copied from interface: `ElementListener`
  Signals that an `Element` was added to the `Document`.

  Specified by:
    `add` in interface `ElementListener`
  Parameters:
    `element` - a high level object
  Returns:
    `true` if the element was added, `false` if not.
  Throws:
    `DocumentException` - when a document isn't open yet, or has been closed

### add

    public boolean add(Watermark watermark)

  Description copied from interface: `DocListener`
  Signals that a `Watermark` was added to the `Document`.

  Specified by:
    `add` in interface `DocListener`
  Parameters:
    `watermark` - the Watermark object
  Returns:
    `true` if the element was added, `false` if not.

### clearTextWrap

    public void clearTextWrap()
                       throws DocumentException

  Description copied from interface: `DocListener`
  Clears text wrapping around images (if applicable). Method suggested by Pelikan Stephan

  Specified by:
    `clearTextWrap` in interface `DocListener`
  Throws:
    `DocumentException`

### close

    public void close()

  Description copied from interface: `DocListener`
  Signals that the `Document` was closed and that no other `Elements` will be added.

  The outputstream of every writer implementing `DocListener` will be closed.

  Specified by:
    `close` in interface `DocListener`

### newPage

    public boolean newPage()
                    throws DocumentException

  Description copied from interface: `DocListener`
  Signals that an new page has to be started.

  Specified by:
    `newPage` in interface `DocListener`
  Returns:
    `true` if the page was added, `false` if not.
  Throws:
    `DocumentException` - when a document isn't open yet, or has been closed

### open

    public void open()

  Description copied from interface: `DocListener`
  Signals that the `Document` has been opened and that `Elements` can be added.

  Specified by:
    `open` in interface `DocListener`

### removeWatermark

    public void removeWatermark()

  Description copied from interface: `DocListener`
  Signals that a `Watermark` was removed from the `Document`.

  Specified by:
    `removeWatermark` in interface `DocListener`

### resetFooter

    public void resetFooter()

  Description copied from interface: `DocListener`
  Resets the footer of this document.

  Specified by:
    `resetFooter` in interface `DocListener`

### resetHeader

    public void resetHeader()

  Description copied from interface: `DocListener`
  Resets the header of this document.

  Specified by:
    `resetHeader` in interface `DocListener`

### resetPageCount

    public void resetPageCount()

  Description copied from interface: `DocListener`
  Sets the page number to 0.

  Specified by:
    `resetPageCount` in interface `DocListener`

### setFooter

    public void setFooter(HeaderFooter footer)

  Description copied from interface: `DocListener`
  Changes the footer of this document.

  Specified by:
    `setFooter` in interface `DocListener`
  Parameters:
    `footer` - the new footer

### setHeader

    public void setHeader(HeaderFooter header)

  Description copied from interface: `DocListener`
  Changes the header of this document.

  Specified by:
    `setHeader` in interface `DocListener`
  Parameters:
    `header` - the new header

### setMarginMirroring

    public boolean setMarginMirroring(boolean marginMirroring)

  Description copied from interface: `DocListener`
  Parameter that allows you to do margin mirroring (odd/even pages)

  Specified by:
    `setMarginMirroring` in interface `DocListener`
  Returns:
    true if succesfull

### setMargins

    public boolean setMargins(float marginLeft,
                              float marginRight,
                              float marginTop,
                              float marginBottom)

  Description copied from interface: `DocListener`
  Sets the margins.

  Specified by:
    `setMargins` in interface `DocListener`
  Parameters:
    `marginLeft` - the margin on the left
    `marginRight` - the margin on the right
    `marginTop` - the margin on the top
    `marginBottom` - the margin on the bottom
  Returns:
    a `boolean`

### setPageCount

    public void setPageCount(int pageN)

  Description copied from interface: `DocListener`
  Sets the page number.

  Specified by:
    `setPageCount` in interface `DocListener`
  Parameters:
    `pageN` - the new page number

### setPageSize

    public boolean setPageSize(Rectangle pageSize)

  Description copied from interface: `DocListener`
  Sets the pagesize.

  Specified by:
    `setPageSize` in interface `DocListener`
  Parameters:
    `pageSize` - the new pagesize
  Returns:
    a `boolean`

### lengthParse

    private static float lengthParse(java.lang.String txt,
                                     int c)