com.lowagie.text.xml
public class SAXiTextHandler extends DefaultHandler
Field Summary | |
---|---|
BaseFont | bf |
float | bottomMargin current margin of a page. |
protected int | chapters Counts the number of chapters in this document. |
protected boolean | controlOpenClose
This is a flag that can be set, if you want to open and close the
Document-object yourself. |
protected Chunk | currentChunk This is the current chunk to which characters can be added. |
protected DocListener | document This is the resulting document. |
protected boolean | ignore This is the current chunk to which characters can be added. |
float | leftMargin current margin of a page. |
protected HashMap | myTags This hashmap contains all the custom keys and peers. |
float | rightMargin current margin of a page. |
protected Stack | stack
This is a Stack of objects, waiting to be added to the
document. |
float | topMargin current margin of a page. |
Constructor Summary | |
---|---|
SAXiTextHandler(DocListener document) | |
SAXiTextHandler(DocListener document, HtmlTagMap myTags) | |
SAXiTextHandler(DocListener document, HtmlTagMap myTags, BaseFont bf) | |
SAXiTextHandler(DocListener document, HashMap myTags) |
Method Summary | |
---|---|
protected void | addImage(Image img) |
void | characters(char[] ch, int start, int length)
This method gets called when characters are encountered.
|
void | endElement(String uri, String lname, String name)
This method gets called when an end tag is encountered.
|
void | handleEndingTags(String name)
This method deals with the starting tags.
|
void | handleStartingTags(String name, Properties attributes)
This method deals with the starting tags.
|
void | ignorableWhitespace(char[] ch, int start, int length)
This method gets called when ignorable white space encountered.
|
protected boolean | isDocumentRoot(String tag)
Checks if a certain tag corresponds with the roottag.
|
boolean | isNewline(String tag)
Checks if a certain tag corresponds with the newpage-tag.
|
boolean | isNewpage(String tag)
Checks if a certain tag corresponds with the newpage-tag.
|
void | setBaseFont(BaseFont bf)
Sets the font that has to be used. |
void | setControlOpenClose(boolean controlOpenClose)
Sets the parameter that allows you to enable/disable the control over the
Document.open() and Document.close() method.
|
void | startElement(String uri, String lname, String name, Attributes attrs)
This method gets called when a start tag is encountered.
|
Stack
of objects, waiting to be added to the
document.Parameters: document
Parameters: document myTags
Parameters: document myTags bf
Parameters: document myTags
Parameters: ch an array of characters start the start position in the array length the number of characters to read from the array
Parameters: uri the Uniform Resource Identifier lname the local name (without prefix), or the empty string if Namespace processing is not being performed. name the name of the tag that ends
Parameters: name the name of the tag
Parameters: name the name of the tag attributes the list of attributes
Parameters: ch an array of characters start the start position in the array length the number of characters to read from the array
Parameters: tag a presumed tagname
Returns: true
if tag equals itext
,false
otherwise.
Parameters: tag a presumed tagname
Returns: true
or false
Parameters: tag a presumed tagname
Returns: true
or false
Parameters: bf
If you set this parameter to true (= default), the parser will open the Document object when the start-root-tag is encountered and close it when the end-root-tag is met. If you set it to false, you have to open and close the Document object yourself.
Parameters: controlOpenClose set this to false if you plan to open/close the Document yourself
Parameters: uri the Uniform Resource Identifier lname the local name (without prefix), or the empty string if Namespace processing is not being performed. name the name of the tag that is encountered attrs the list of attributes