|
![]() |
||||||||
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
|
protected DocListener |
document
|
private FactoryProperties |
factoryProperties
|
private HashMap |
interfaceProps
|
private boolean |
isPRE
|
protected ArrayList |
objectList
|
private boolean |
pendingLI
|
private boolean |
pendingTD
|
private boolean |
pendingTR
|
private boolean |
skipText
|
private Stack |
stack
|
private StyleSheet |
style
|
private Stack |
tableState
|
static HashMap |
tagsSupported
|
static 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 . |
void |
clearTextWrap()
|
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(String tag)
Called when an end tag is found. |
HashMap |
getInterfaceProps()
|
StyleSheet |
getStyleSheet()
|
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(Reader reader)
|
static ArrayList |
parseToList(Reader reader,
StyleSheet style)
|
static ArrayList |
parseToList(Reader reader,
StyleSheet style,
HashMap interfaceProps)
|
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(HashMap interfaceProps)
|
boolean |
setMarginMirroring(boolean marginMirroring)
Parameter that allows you to do left/right margin mirroring (odd/even pages) |
boolean |
setMarginMirroringTopBottom(boolean marginMirroring)
Parameter that allows you to do top/bottom 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(String tag,
HashMap h)
Called when a start tag is found. |
void |
text(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 |
---|
protected ArrayList objectList
protected DocListener document
private Paragraph currentParagraph
private ChainedProperties cprops
private Stack stack
private boolean pendingTR
private boolean pendingTD
private boolean pendingLI
private StyleSheet style
private boolean isPRE
private Stack tableState
private boolean skipText
private HashMap interfaceProps
private FactoryProperties factoryProperties
public static final String tagsSupportedString
public static final HashMap tagsSupported
Constructor Detail |
---|
public HTMLWorker(DocListener document)
document
- A class that implements DocListener
Method Detail |
---|
public void setStyleSheet(StyleSheet style)
public StyleSheet getStyleSheet()
public void setInterfaceProps(HashMap interfaceProps)
public HashMap getInterfaceProps()
public void parse(Reader reader) throws IOException
IOException
public static ArrayList parseToList(Reader reader, StyleSheet style) throws IOException
IOException
public static ArrayList parseToList(Reader reader, StyleSheet style, HashMap interfaceProps) throws IOException
IOException
public void endDocument()
SimpleXMLDocHandler
endDocument
in interface SimpleXMLDocHandler
public void startDocument()
SimpleXMLDocHandler
startDocument
in interface SimpleXMLDocHandler
public void startElement(String tag, HashMap h)
SimpleXMLDocHandler
startElement
in interface SimpleXMLDocHandler
tag
- the tag nameh
- the tag's attributespublic void endElement(String tag)
SimpleXMLDocHandler
endElement
in interface SimpleXMLDocHandler
tag
- the tag namepublic void text(String str)
SimpleXMLDocHandler
text
in interface SimpleXMLDocHandler
str
- the text element, probably a fragment.public boolean add(Element element) throws DocumentException
ElementListener
Element
was added to the Document
.
add
in interface ElementListener
element
- 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 void clearTextWrap() throws DocumentException
DocumentException
public void close()
DocListener
Document
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()
DocListener
newPage
in interface DocListener
true
if the page was added, false
if not.public void open()
DocListener
Document
has been opened and that
Elements
can be added.
open
in interface DocListener
public void resetFooter()
DocListener
resetFooter
in interface DocListener
public void resetHeader()
DocListener
resetHeader
in interface DocListener
public void resetPageCount()
DocListener
resetPageCount
in interface DocListener
public void setFooter(HeaderFooter footer)
DocListener
setFooter
in interface DocListener
footer
- the new footerpublic void setHeader(HeaderFooter header)
DocListener
setHeader
in interface DocListener
header
- the new headerpublic boolean setMarginMirroring(boolean marginMirroring)
DocListener
setMarginMirroring
in interface DocListener
public boolean setMarginMirroringTopBottom(boolean marginMirroring)
DocListener
setMarginMirroringTopBottom
in interface DocListener
DocListener.setMarginMirroring(boolean)
public boolean setMargins(float marginLeft, float marginRight, float marginTop, float marginBottom)
DocListener
setMargins
in interface DocListener
marginLeft
- the margin on the leftmarginRight
- the margin on the rightmarginTop
- the margin on the topmarginBottom
- the margin on the bottom
boolean
public void setPageCount(int pageN)
DocListener
setPageCount
in interface DocListener
pageN
- the new page numberpublic boolean setPageSize(Rectangle pageSize)
DocListener
setPageSize
in interface DocListener
pageSize
- the new pagesize
boolean
|
Hosted by Hostbasket | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |