org.apache.poi.extractor
Class ExtractorFactory
- java.lang.Object
-
- org.apache.poi.extractor.ExtractorFactory
-
public class ExtractorFactory extends java.lang.ObjectFigures out the correct POITextExtractor for your supplied document, and returns it.
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringCORE_DOCUMENT_REL
-
Constructor Summary
Constructors Constructor and Description ExtractorFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description static POITextExtractorcreateExtractor(DirectoryNode poifsDir)static POITextExtractorcreateExtractor(DirectoryNode poifsDir, POIFSFileSystem fs)Deprecated.UsecreateExtractor(DirectoryNode)insteadstatic POITextExtractorcreateExtractor(java.io.File f)static POITextExtractorcreateExtractor(java.io.InputStream inp)static POIXMLTextExtractorcreateExtractor(OPCPackage pkg)static POIOLE2TextExtractorcreateExtractor(POIFSFileSystem fs)static java.lang.BooleangetAllThreadsPreferEventExtractors()Should all threads prefer event based over usermodel based extractors? (usermodel extractors tend to be more accurate, but use more memory) Default is to use the thread level setting, which defaults to false.static POITextExtractor[]getEmbededDocsTextExtractors(POIOLE2TextExtractor ext)Returns an array of text extractors, one for each of the embedded documents in the file (if there are any).static POITextExtractor[]getEmbededDocsTextExtractors(POIXMLTextExtractor ext)Returns an array of text extractors, one for each of the embeded documents in the file (if there are any).static booleangetThreadPrefersEventExtractors()Should this thread prefer event based over usermodel based extractors? (usermodel extractors tend to be more accurate, but use more memory) Default is false.static voidsetAllThreadsPreferEventExtractors(java.lang.Boolean preferEventExtractors)Should all threads prefer event based over usermodel based extractors? If set, will take preference over the Thread level setting.static voidsetThreadPrefersEventExtractors(boolean preferEventExtractors)Should this thread prefer event based over usermodel based extractors? Will only be used if the All Threads setting is null.
-
-
-
Field Detail
-
CORE_DOCUMENT_REL
public static final java.lang.String CORE_DOCUMENT_REL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getThreadPrefersEventExtractors
public static boolean getThreadPrefersEventExtractors()
Should this thread prefer event based over usermodel based extractors? (usermodel extractors tend to be more accurate, but use more memory) Default is false.
-
getAllThreadsPreferEventExtractors
public static java.lang.Boolean getAllThreadsPreferEventExtractors()
Should all threads prefer event based over usermodel based extractors? (usermodel extractors tend to be more accurate, but use more memory) Default is to use the thread level setting, which defaults to false.
-
setThreadPrefersEventExtractors
public static void setThreadPrefersEventExtractors(boolean preferEventExtractors)
Should this thread prefer event based over usermodel based extractors? Will only be used if the All Threads setting is null.
-
setAllThreadsPreferEventExtractors
public static void setAllThreadsPreferEventExtractors(java.lang.Boolean preferEventExtractors)
Should all threads prefer event based over usermodel based extractors? If set, will take preference over the Thread level setting.
-
createExtractor
public static POITextExtractor createExtractor(java.io.File f) throws java.io.IOException, InvalidFormatException, OpenXML4JException, org.apache.xmlbeans.XmlException
- Throws:
java.io.IOExceptionInvalidFormatExceptionOpenXML4JExceptionorg.apache.xmlbeans.XmlException
-
createExtractor
public static POITextExtractor createExtractor(java.io.InputStream inp) throws java.io.IOException, InvalidFormatException, OpenXML4JException, org.apache.xmlbeans.XmlException
- Throws:
java.io.IOExceptionInvalidFormatExceptionOpenXML4JExceptionorg.apache.xmlbeans.XmlException
-
createExtractor
public static POIXMLTextExtractor createExtractor(OPCPackage pkg) throws java.io.IOException, OpenXML4JException, org.apache.xmlbeans.XmlException
- Throws:
java.io.IOExceptionOpenXML4JExceptionorg.apache.xmlbeans.XmlException
-
createExtractor
public static POIOLE2TextExtractor createExtractor(POIFSFileSystem fs) throws java.io.IOException, InvalidFormatException, OpenXML4JException, org.apache.xmlbeans.XmlException
- Throws:
java.io.IOExceptionInvalidFormatExceptionOpenXML4JExceptionorg.apache.xmlbeans.XmlException
-
createExtractor
@Deprecated public static POITextExtractor createExtractor(DirectoryNode poifsDir, POIFSFileSystem fs) throws java.io.IOException, InvalidFormatException, OpenXML4JException, org.apache.xmlbeans.XmlException
Deprecated. UsecreateExtractor(DirectoryNode)instead- Throws:
java.io.IOExceptionInvalidFormatExceptionOpenXML4JExceptionorg.apache.xmlbeans.XmlException
-
createExtractor
public static POITextExtractor createExtractor(DirectoryNode poifsDir) throws java.io.IOException, InvalidFormatException, OpenXML4JException, org.apache.xmlbeans.XmlException
- Throws:
java.io.IOExceptionInvalidFormatExceptionOpenXML4JExceptionorg.apache.xmlbeans.XmlException
-
getEmbededDocsTextExtractors
public static POITextExtractor[] getEmbededDocsTextExtractors(POIOLE2TextExtractor ext) throws java.io.IOException, InvalidFormatException, OpenXML4JException, org.apache.xmlbeans.XmlException
Returns an array of text extractors, one for each of the embedded documents in the file (if there are any). If there are no embedded documents, you'll get back an empty array. Otherwise, you'll get one openPOITextExtractorfor each embedded file.- Throws:
java.io.IOExceptionInvalidFormatExceptionOpenXML4JExceptionorg.apache.xmlbeans.XmlException
-
getEmbededDocsTextExtractors
public static POITextExtractor[] getEmbededDocsTextExtractors(POIXMLTextExtractor ext)
Returns an array of text extractors, one for each of the embeded documents in the file (if there are any). If there are no embeded documents, you'll get back an empty array. Otherwise, you'll get one openPOITextExtractorfor each embeded file.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG