|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.lowagie.text.html.simpleparser.HTMLWorker
public class HTMLWorker
| Field Summary | |
|---|---|
private ChainedProperties |
cprops
|
private Paragraph |
currentParagraph
|
private DocListener |
document
|
private FactoryProperties |
factoryProperties
|
private java.util.HashMap |
interfaceProps
|
private boolean |
isPRE
|
private 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 |
|---|
private java.util.ArrayList objectList
private DocListener document
private Paragraph currentParagraph
private ChainedProperties cprops
private java.util.Stack stack
private boolean pendingTR
private boolean pendingTD
private boolean pendingLI
private StyleSheet style
private boolean isPRE
private java.util.Stack tableState
private boolean skipText
private java.util.HashMap interfaceProps
private FactoryProperties factoryProperties
public static final java.lang.String tagsSupportedString
public static final java.util.HashMap tagsSupported
| Constructor Detail |
|---|
public HTMLWorker(DocListener document)
| Method Detail |
|---|
public void setStyleSheet(StyleSheet style)
public StyleSheet getStyleSheet()
public void setInterfaceProps(java.util.HashMap interfaceProps)
public java.util.HashMap getInterfaceProps()
public void parse(java.io.Reader reader)
throws java.io.IOException
java.io.IOException
public static java.util.ArrayList parseToList(java.io.Reader reader,
StyleSheet style)
throws java.io.IOException
java.io.IOException
public static java.util.ArrayList parseToList(java.io.Reader reader,
StyleSheet style,
java.util.HashMap interfaceProps)
throws java.io.IOException
java.io.IOExceptionpublic void endDocument()
SimpleXMLDocHandler
endDocument in interface SimpleXMLDocHandlerpublic void startDocument()
SimpleXMLDocHandler
startDocument in interface SimpleXMLDocHandler
public void startElement(java.lang.String tag,
java.util.HashMap h)
SimpleXMLDocHandler
startElement in interface SimpleXMLDocHandlertag - the tag nameh - the tag's attributespublic void endElement(java.lang.String tag)
SimpleXMLDocHandler
endElement in interface SimpleXMLDocHandlertag - the tag namepublic void text(java.lang.String str)
SimpleXMLDocHandler
text in interface SimpleXMLDocHandlerstr - the text element, probably a fragment.
public boolean add(Element element)
throws DocumentException
ElementListenerElement was added to the Document.
add in interface ElementListenerelement - a high level object
true if the element was added, false if not.
DocumentException - when a document isn't open yet, or has been closedpublic boolean add(Watermark watermark)
DocListenerWatermark was added to the Document.
add in interface DocListenerwatermark - the Watermark object
true if the element was added, false if not.
public void clearTextWrap()
throws DocumentException
DocListener
clearTextWrap in interface DocListenerDocumentExceptionpublic void close()
DocListenerDocument was closed and that no other
Elements will be added.
The outputstream of every writer implementing DocListener will be closed.
close in interface DocListener
public boolean newPage()
throws DocumentException
DocListener
newPage in interface DocListenertrue if the page was added, false if not.
DocumentException - when a document isn't open yet, or has been closedpublic void open()
DocListenerDocument has been opened and that
Elements can be added.
open in interface DocListenerpublic void removeWatermark()
DocListenerWatermark was removed from the Document.
removeWatermark in interface DocListenerpublic void resetFooter()
DocListener
resetFooter in interface DocListenerpublic void resetHeader()
DocListener
resetHeader in interface DocListenerpublic void resetPageCount()
DocListener
resetPageCount in interface DocListenerpublic void setFooter(HeaderFooter footer)
DocListener
setFooter in interface DocListenerfooter - the new footerpublic void setHeader(HeaderFooter header)
DocListener
setHeader in interface DocListenerheader - the new headerpublic boolean setMarginMirroring(boolean marginMirroring)
DocListener
setMarginMirroring in interface DocListener
public boolean setMargins(float marginLeft,
float marginRight,
float marginTop,
float marginBottom)
DocListener
setMargins in interface DocListenermarginLeft - the margin on the leftmarginRight - the margin on the rightmarginTop - the margin on the topmarginBottom - the margin on the bottom
booleanpublic void setPageCount(int pageN)
DocListener
setPageCount in interface DocListenerpageN - the new page numberpublic boolean setPageSize(Rectangle pageSize)
DocListener
setPageSize in interface DocListenerpageSize - the new pagesize
boolean
private static float lengthParse(java.lang.String txt,
int c)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||