com.java4less.ocr.docparser
Class DocumentDef

java.lang.Object
  extended by com.java4less.ocr.docparser.DocumentDef

public class DocumentDef
extends java.lang.Object

This class defines the structure of your text document


Constructor Summary
DocumentDef()
           
 
Method Summary
 void addSection(SectionDef s)
           
 SectionDef getDocSecondPageHeader()
          document page header.
 SectionDef getDocSection(int i)
          get section of the document, the first section (header) has index 0
 java.util.Vector getDocSections()
          regular sections of the document, for example, document header, detail, footer.
 java.lang.String getName()
          get the name of the document
 SectionDef getPageFooter()
          page footer section.
 SectionDef getPageheader()
          page header section, this section will appear in each page
 void loadFromXml(java.lang.String file)
          load document from XML file
 void saveToXml(java.io.OutputStream os)
          write document definition to xml
 void setDocSecondPageHeader(SectionDef docPageHeader)
           
 void setDocSections(java.util.Vector docSections)
           
 void setName(java.lang.String s)
          set the name of the document
 void setPageFooter(SectionDef pageFooter)
           
 void setPageheader(SectionDef pageheader)
          page header section, this section will appear in each page
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentDef

public DocumentDef()
Method Detail

setName

public void setName(java.lang.String s)
set the name of the document

Parameters:
s -

getName

public java.lang.String getName()
get the name of the document

Returns:

getPageheader

public SectionDef getPageheader()
page header section, this section will appear in each page

Returns:

setPageheader

public void setPageheader(SectionDef pageheader)
page header section, this section will appear in each page

Parameters:
pageheader -

getDocSecondPageHeader

public SectionDef getDocSecondPageHeader()
document page header. This header appears only in the second and further pages of the document

Returns:

setDocSecondPageHeader

public void setDocSecondPageHeader(SectionDef docPageHeader)

addSection

public void addSection(SectionDef s)

getDocSections

public java.util.Vector getDocSections()
regular sections of the document, for example, document header, detail, footer.

Returns:

getDocSection

public SectionDef getDocSection(int i)
get section of the document, the first section (header) has index 0

Parameters:
i -
Returns:

setDocSections

public void setDocSections(java.util.Vector docSections)

getPageFooter

public SectionDef getPageFooter()
page footer section. It appears as last section on each page

Returns:

setPageFooter

public void setPageFooter(SectionDef pageFooter)

saveToXml

public void saveToXml(java.io.OutputStream os)
               throws java.lang.Exception
write document definition to xml

Parameters:
os -
Throws:
java.lang.Exception

loadFromXml

public void loadFromXml(java.lang.String file)
                 throws org.xml.sax.SAXException,
                        java.io.IOException
load document from XML file

Parameters:
file -
Throws:
org.xml.sax.SAXException
java.io.IOException