public interface IFilter extends java.lang.AutoCloseable, java.util.Iterator<Event>
The following example shows a typical use of IFilter:
MyUtlity myUtility = new MyUtility(); // Some object that do things with filter events IFilter filter = new MyFilter(); // A filter implementation filter.open(new RawDocument(URI("myFile.ext"), "UTF-8", "en"); while ( filter.hasNext() ) { myUtility.handleEvent(filter.next()); } filter.close();
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SUB_FILTER
Prefix marker indicating a sub-filter in the name of a
StartDocument object created
when processing content with sub-filters. |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the current process.
|
void |
close()
Closes the input document.
|
IFilterWriter |
createFilterWriter()
Creates a new IFilterWriter object from the most appropriate class to
use with this filter.
|
ISkeletonWriter |
createSkeletonWriter()
Creates a new ISkeletonWriter object that corresponds to the type of skeleton
this filter uses.
|
java.util.List<FilterConfiguration> |
getConfigurations()
Gets the list of all predefined configurations for this filter.
|
java.lang.String |
getDisplayName()
Gets the localizable display name of this filter.
|
EncoderManager |
getEncoderManager()
Gets the EncoderManager object for this filter.
|
java.lang.String |
getMimeType()
Gets the MIME type of the format supported by this filter.
|
java.lang.String |
getName()
Gets the name/identifier of this filter.
|
IParameters |
getParameters()
Gets the current parameters for this filter.
|
boolean |
hasNext()
Indicates if there is an event to process.
|
Event |
next()
Gets the next event available.
|
void |
open(RawDocument input)
Opens the input document described in a give RawDocument object.
|
void |
open(RawDocument input,
boolean generateSkeleton)
Opens the input document described in a give RawDocument object, and
optionally creates skeleton information.
|
void |
setFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)
Sets the filter configuration mapper for this filter.
|
void |
setParameters(IParameters params)
Sets new parameters for this filter.
|
default java.util.stream.Stream<Event> |
stream()
Generates all events from a filter as a
Stream . |
static final java.lang.String SUB_FILTER
StartDocument
object created
when processing content with sub-filters.java.lang.String getName()
java.lang.String getDisplayName()
void open(RawDocument input)
input
- The RawDocument object to use to open the document.void open(RawDocument input, boolean generateSkeleton)
input
- The RawDocument object to use to open the document.generateSkeleton
- true to generate the skeleton data, false otherwise.void close()
close
in interface java.lang.AutoCloseable
boolean hasNext()
Implementer Note: The caller must be able to call this method several times without changing state.
hasNext
in interface java.util.Iterator<Event>
Event next()
next
in interface java.util.Iterator<Event>
void cancel()
IParameters getParameters()
void setParameters(IParameters params)
params
- The new parameters to use.void setFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)
fcMapper
- the mapper to set.ISkeletonWriter createSkeletonWriter()
IFilterWriter createFilterWriter()
EncoderManager getEncoderManager()
java.lang.String getMimeType()
java.util.List<FilterConfiguration> getConfigurations()
default java.util.stream.Stream<Event> stream()
Stream
.Stream
of events from the filterCopyright © 2022. All rights reserved.