Package org.apache.tika.parser.hook
Class ParseHooks
java.lang.Object
org.apache.tika.parser.hook.ParseHooks
- All Implemented Interfaces:
TransientParseState
The hooks a parse runs, in config order. Pinning and offering never fail a document: a
problem is a warning on that document's metadata.
- Since:
- Apache Tika 4.1
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classMarks a top-level parse in progress; tracks the documents being parsed, outermost last. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidend(Metadata root, boolean failed, ParseContext context) getHooks()booleanisEmpty()voidvoidofferPage(MediaType type, int page, Path bytes, ParseContext context) A rendered page of the current document, from its own parser; never fails it.pin(MediaType type, Metadata metadata, TikaInputStream tis, ParseContext context) The document's bytes as a file when a hook wants them, else null.voidstart(Metadata root, ParseContext context) booleanwantsPages(MediaType renderType, ParseContext context) Whether any hook wants the current document's pages rendered as images of this type.
-
Constructor Details
-
ParseHooks
-
-
Method Details
-
getHooks
-
isEmpty
public boolean isEmpty() -
start
- Throws:
TikaException
-
pin
public Path pin(MediaType type, Metadata metadata, TikaInputStream tis, ParseContext context) throws TikaException The document's bytes as a file when a hook wants them, else null.- Throws:
TikaException
-
offer
public void offer(MediaType type, Metadata metadata, Metadata parent, Path bytes, ParseContext context) -
wantsPages
Whether any hook wants the current document's pages rendered as images of this type.- Throws:
TikaException
-
offerPage
A rendered page of the current document, from its own parser; never fails it. -
end
-