de.oio.jpdfunit.document
Class DocumentFactory

java.lang.Object
  extended by de.oio.jpdfunit.document.DocumentFactory
Direct Known Subclasses:
PdfBoxFactory

public abstract class DocumentFactory
extends Object

Defines a factory API that enables the application to configure own factories and to parse pdf documents.

Author:
bbratkus

Constructor Summary
DocumentFactory()
           
 
Method Summary
abstract  Document getDocument(InputStream pdfStream)
          For working with a Document first you have to get the Document.
abstract  Document getDocument(String pdfFile)
          For working with a Document first you have to get the Document.
static DocumentFactory newInstance()
          This factory method works like the SaxParserFactory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentFactory

public DocumentFactory()
Method Detail

getDocument

public abstract Document getDocument(String pdfFile)
For working with a Document first you have to get the Document. In this method a String ist used to get the document.

Parameters:
pdfFile - The document i.e. "etc/testing-pdfs/oio-katalog-mit-logo-mit-farben.pdf"
Returns:
The document created via the pdfFile.

getDocument

public abstract Document getDocument(InputStream pdfStream)
For working with a Document first you have to get the Document. In this method a InputStream ist used to get the document.

Parameters:
pdfStream - A InputStream which contains the document.
Returns:
The document created via the stream.

newInstance

public static DocumentFactory newInstance()
This factory method works like the SaxParserFactory. Creates a new factory instance. The implementation class to load is the first found in the following locations:
  1. the de.oio.document.DocumentFactory system property
  2. the above named property value in the $JAVA_HOME/lib/DocumentFactory.properties file
  3. the class name specified in the META-INF/services/de.oio.document.DocumentFactory system resource
  4. the default factory class

Returns:
A concrete DocumentFactory by default the PdfBoxFactory.
Throws:
DocumentFactoryException - The exception will be thrown if the instantation fails.


Copyright © 2011. All Rights Reserved.