|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
com.lowagie.text.markup.Parser
public class Parser
This class allows you to parse files in a tree.
| Field Summary | |
|---|---|
protected int[] |
counterParents
|
protected int[] |
counters
|
protected Chunk |
currentChunk
|
protected Document |
document
|
protected java.util.Stack |
filestack
|
protected MarkupParser |
markup
|
protected java.util.Stack |
objectstack
|
protected java.util.Stack |
outline
|
protected int |
previoustitle
|
protected java.lang.String[] |
structures
|
protected java.util.Stack |
tagstack
|
protected java.lang.String |
title
|
protected java.lang.String[] |
titles
|
protected PdfWriter |
writer
|
| Constructor Summary | |
|---|---|
Parser(java.lang.String srcfile)
Constructs a recursive parser object. |
|
Parser(java.lang.String srcfile,
java.lang.String title,
java.lang.String[] structures,
java.lang.String[] titles,
int[] counterParents)
Constructs a recursive parser object. |
|
| Method Summary | |
|---|---|
private void |
addObject(Paragraph paragraph)
Creates a new Object and puts it on top of the objectstack. |
private void |
addObject(Phrase phrase)
Creates a new Object and puts it on top of the objectstack. |
private void |
addObject(SimpleCell cell)
Creates a new Object and puts it on top of the objectstack. |
private void |
addObject(SimpleTable table)
Creates a new Object and puts it on top of the objectstack. |
private void |
addToCurrentChunk(java.lang.String s)
extending the CurrentChunk. |
void |
characters(char[] ch,
int start,
int length)
This method gets called when characters are encountered. |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
|
private void |
flushCurrentChunk()
flushing the CurrentChunk. |
private boolean |
flushObject()
Deals with the object on top of the objectstack. |
private void |
parse()
Gets the file on top of the filestack, parses it and removes it from the stack. |
void |
processingInstruction(java.lang.String instruction,
java.lang.String parameter)
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
|
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
|---|
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Stack filestack
protected java.util.Stack outline
protected java.util.Stack tagstack
protected java.util.Stack objectstack
protected Chunk currentChunk
protected Document document
protected PdfWriter writer
protected java.lang.String title
protected java.lang.String[] structures
protected java.lang.String[] titles
protected int[] counterParents
protected int[] counters
protected int previoustitle
protected MarkupParser markup
| Constructor Detail |
|---|
public Parser(java.lang.String srcfile)
srcfile - the file that has to be parsed.
public Parser(java.lang.String srcfile,
java.lang.String title,
java.lang.String[] structures,
java.lang.String[] titles,
int[] counterParents)
srcfile - the file that has to be parsedtitle - the value of the id selector marking a titlestructures - an array with the values of the class selectors marking titles in the complete structuretitles - the strings that have to be added to the titlenumbercounterParents - an array with references from each child in the structure to its parent| Method Detail |
|---|
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void characters(char[] ch,
int start,
int length)
characters in interface org.xml.sax.ContentHandlercharacters in class org.xml.sax.helpers.DefaultHandlerch - an array of charactersstart - the start position in the arraylength - the number of characters to read from the array
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandlerendElement in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
public void processingInstruction(java.lang.String instruction,
java.lang.String parameter)
throws org.xml.sax.SAXException
processingInstruction in interface org.xml.sax.ContentHandlerprocessingInstruction in class org.xml.sax.helpers.DefaultHandlerorg.xml.sax.SAXExceptionContentHandler.processingInstruction(java.lang.String, java.lang.String)private void flushCurrentChunk()
private void addToCurrentChunk(java.lang.String s)
s - private void addObject(Phrase phrase)
phrase - private void addObject(SimpleTable table)
table - private void addObject(SimpleCell cell)
cell - private void addObject(Paragraph paragraph)
paragraph - private boolean flushObject()
private void parse()
throws javax.xml.parsers.ParserConfigurationException,
java.io.IOException,
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
java.io.IOException
org.xml.sax.SAXException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||