|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.any23.extractor.SimpleExtractorFactory<T>
T
- the type of the Extractor
served by this factory.public class SimpleExtractorFactory<T extends Extractor<?>>
This class is a simple and default-like implementation of ExtractorFactory
.
Method Summary | ||
---|---|---|
static
|
create(String name,
Prefixes prefixes,
Collection<String> supportedMIMETypes,
String exampleInput,
Class<S> extractorClass)
Creates an instance of a ExtractorFactory serving concrete implementation
instances of Extractor . |
|
T |
createExtractor()
Creates an extractor instance. |
|
String |
getExampleInput()
An example input file for the extractor, to be used in auto-generated documentation. |
|
String |
getExtractorName()
Returns the name of the extractor. |
|
Class<T> |
getExtractorType()
Returns the extractor type. |
|
Prefixes |
getPrefixes()
An instance defining the prefixes supported by this extractor. |
|
Collection<MIMEType> |
getSupportedMIMETypes()
Supports wildcards, e.g. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <S extends Extractor<?>> ExtractorFactory<S> create(String name, Prefixes prefixes, Collection<String> supportedMIMETypes, String exampleInput, Class<S> extractorClass)
ExtractorFactory
serving concrete implementation
instances of Extractor
.
S
- the concrete type of the Extractor
.name
- of the Extractor
.prefixes
- handled Prefixes
.supportedMIMETypes
- collection of supported MIME Types.exampleInput
- a string acting as a input example.extractorClass
- concrete implementation class of the Extractor
.
ExtractorFactory
.public String getExtractorName()
ExtractorDescription
getExtractorName
in interface ExtractorDescription
Extractor
public Prefixes getPrefixes()
ExtractorDescription
getPrefixes
in interface ExtractorDescription
Prefixes
public Collection<MIMEType> getSupportedMIMETypes()
ExtractorFactory
"*/*"
for blind extractors that merely call a web service.
getSupportedMIMETypes
in interface ExtractorFactory<T extends Extractor<?>>
MIMEType
public Class<T> getExtractorType()
ExtractorFactory
getExtractorType
in interface ExtractorFactory<T extends Extractor<?>>
null
extractor class.public T createExtractor()
ExtractorFactory
createExtractor
in interface ExtractorFactory<T extends Extractor<?>>
Extractor
public String getExampleInput()
ExtractorFactory
Extractor.BlindExtractor
,
this is an arbitrary URI.
For extractors that require content, it is the name of a file, relative
to the factory's class file's location, it will be opened using
factory.getClass().getResourceAsStream(filename). The example should be
a short file that produces characteristic output if sent through the
extractor. The file will be read as UTF-8, so it should either use that
encoding or avoid characters outside of the US-ASCII range.
getExampleInput
in interface ExtractorFactory<T extends Extractor<?>>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |