|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.graph.text.TextExtractors
@ThreadSafe public final class TextExtractors
Facility for managing TextExtractorConfig
s.
Field Summary | |
---|---|
protected static ClassLoaderFactory |
DEFAULT_CLASSLOADER_FACTORY
Class loader factory instance that always returns the current thread's context class
loader , or if null the class loader for this class. |
static String |
DEFAULT_MIME_TYPE
|
Constructor Summary | |
---|---|
TextExtractors()
|
Method Summary | |
---|---|
boolean |
addExtractor(TextExtractorConfig config)
Adds the configuration for a text extractor before any previously added configurations, or updates any existing one that represents the same configuration |
void |
extractFrom(InputStream stream,
TextExtractorOutput output,
TextExtractorContext context)
Sequence the data found in the supplied stream, placing the output information into the supplied map. |
ClassLoaderFactory |
getClassLoaderFactory()
Gets the class loader factory that should be used to load text extractors. |
ComponentLibrary<TextExtractor,TextExtractorConfig> |
getLibrary()
|
Logger |
getLogger()
Gets the logger for this system |
boolean |
removeExtractor(TextExtractorConfig config)
Removes the configuration for a text extractor. |
void |
setClassLoaderFactory(ClassLoaderFactory classLoaderFactory)
Sets the Maven Repository that should be used to load the MIME-type detectors. |
void |
setLogger(Logger logger)
Sets the logger for this system. |
int |
size()
Get the number of text extractors. |
boolean |
supportsMimeType(String mimeType)
Determine if this extractor is capable of processing content with the supplied MIME type. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_MIME_TYPE
protected static final ClassLoaderFactory DEFAULT_CLASSLOADER_FACTORY
current thread's context class
loader
, or if null
the class loader for this class.
Constructor Detail |
---|
public TextExtractors()
Method Detail |
---|
public ComponentLibrary<TextExtractor,TextExtractorConfig> getLibrary()
public int size()
public boolean addExtractor(TextExtractorConfig config)
same configuration
config
- the new configuration; must not be null
.
true
if the detector was added, or false
if there already was an existing detector
configuration.removeExtractor(TextExtractorConfig)
public ClassLoaderFactory getClassLoaderFactory()
current thread's context class loader
, or if
null
the class loader for this class.
null
setClassLoaderFactory(ClassLoaderFactory)
public Logger getLogger()
public boolean supportsMimeType(String mimeType)
supportsMimeType
in interface TextExtractor
mimeType
- the MIME type; never null
TextExtractor.supportsMimeType(java.lang.String)
public void extractFrom(InputStream stream, TextExtractorOutput output, TextExtractorContext context) throws IOException
ModeShape's SequencingService determines the sequencers that should be executed by monitoring the changes to one or more workspaces that it is monitoring. Changes in those workspaces are aggregated and used to determine which sequencers should be called. If the sequencer implements this interface, then this method is called with the property that is to be sequenced along with the interface used to register the output. The framework takes care of all the rest.
extractFrom
in interface TextExtractor
stream
- the stream with the data to be sequenced; never null
output
- the output from the sequencing operation; never null
context
- the context for the sequencing operation; never null
IOException
- if there is a problem reading the streamTextExtractor.extractFrom(java.io.InputStream, org.modeshape.graph.text.TextExtractorOutput,
org.modeshape.graph.text.TextExtractorContext)
public boolean removeExtractor(TextExtractorConfig config)
config
- the configuration to be removed; must not be null
.
true
if the configuration was removed, or false
if there was no existing configurationaddExtractor(TextExtractorConfig)
public void setClassLoaderFactory(ClassLoaderFactory classLoaderFactory)
current thread's context class loader
, or if
null
the class loader for this class.
classLoaderFactory
- the class loader factory, or null
if the default class loader factory should be
used.getClassLoaderFactory()
public void setLogger(Logger logger)
logger
- the logger, or null
if the standard logging should be used
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |