com.java4less.ocr.docparser.data
Class Document

java.lang.Object
  extended by com.java4less.ocr.docparser.data.Document

public class Document
extends java.lang.Object

Parsed document in the image file.


Constructor Summary
Document()
           
 
Method Summary
 void addError(DocParseException e)
          add error to the document
 void addSection(Section s)
          add section instance to document
 Section[] getAllSections()
          get all sections in the same sequence they are in the text file
 DocumentDef getDefinition()
          get document definition
 DocParseException[] getErrors()
          get all errors found while parsing the document
 java.lang.String getName()
          name of the document
 Section[] getSectionByName(java.lang.String name)
          get all repetitions of the section with a certain name
 boolean hasError()
          returns true if there is an error in the docuemtns
 void setDefinition(DocumentDef def)
          set document definition
 void toXml(org.w3c.dom.Document doc, org.w3c.dom.Node root)
          exports document to XML
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Document

public Document()
Method Detail

getDefinition

public DocumentDef getDefinition()
get document definition

Returns:

setDefinition

public void setDefinition(DocumentDef def)
set document definition

Parameters:
def -

getSectionByName

public Section[] getSectionByName(java.lang.String name)
get all repetitions of the section with a certain name

Returns:

getErrors

public DocParseException[] getErrors()
get all errors found while parsing the document

Returns:

hasError

public boolean hasError()
returns true if there is an error in the docuemtns

Returns:

addError

public void addError(DocParseException e)
add error to the document

Parameters:
e -

getAllSections

public Section[] getAllSections()
get all sections in the same sequence they are in the text file

Returns:

toXml

public void toXml(org.w3c.dom.Document doc,
                  org.w3c.dom.Node root)
           throws java.lang.Exception
exports document to XML

Parameters:
doc -
root -
Throws:
java.lang.Exception

getName

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

Returns:

addSection

public void addSection(Section s)
add section instance to document

Parameters:
s -