public class SubFilter extends Object implements IFilter
IFilter into a subfilter (a filter called from another IFilter).
Specific implementations can implement this class and override any needed methods to transform Events
as they are produced.
This class should be used to wrap filters that use GenericSkeleton and its subclasses.
If a different type of skeleton is used or id/name generation logic should be changed, subclass this class.SUB_FILTER| Constructor and Description |
|---|
SubFilter(IFilter filter,
IEncoder parentEncoder,
int sectionIndex,
String parentId,
String parentName) |
| Modifier and Type | Method and Description |
|---|---|
protected String |
buildRefId() |
protected String |
buildRefName() |
protected String |
buildResourceId(String resId,
Class<? extends IResource> resClass) |
protected String |
buildResourceName(String resName,
boolean autoGenerated,
Class<? extends INameable> resClass) |
void |
cancel()
Cancels the current process.
|
void |
close()
Closes the input document.
|
protected void |
convertRefsInSkeleton(ISkeleton skel) |
IFilterWriter |
createFilterWriter()
Creates a new IFilterWriter object from the most appropriate class to
use with this filter.
|
Code |
createRefCode() |
Event |
createRefEvent() |
Event |
createRefEvent(IResource resource) |
Event |
createRefEvent(ISkeleton beforeSkeleton,
ISkeleton afterSkeleton) |
ISkeletonWriter |
createSkeletonWriter()
Creates a new ISkeletonWriter object that corresponds to the type of skeleton
this filter uses.
|
List<FilterConfiguration> |
getConfigurations()
Gets the list of all predefined configurations for this filter.
|
SubFilterEventConverter |
getConverter() |
String |
getDisplayName()
Gets the localizable display name of this filter.
|
EncoderManager |
getEncoderManager()
Gets the EncoderManager object for this filter.
|
List<Event> |
getEvents(RawDocument input)
Get events by subfilter at once, without using open()/hasNext()/next()/close().
|
IFilter |
getFilter() |
String |
getMimeType()
Gets the MIME type of the format supported by this filter.
|
String |
getName()
Gets the name/identifier of this filter.
|
IParameters |
getParameters()
Gets the current parameters for this filter.
|
protected String |
getParentId() |
protected String |
getParentName() |
protected int |
getSectionIndex() |
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.
|
static boolean |
resourceIdsMatch(String startSubfilterResourceId,
String endSubfilterResourceId) |
void |
setFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)
Sets the filter configuration mapper for this filter.
|
void |
setParameters(IParameters params)
Sets new parameters for this filter.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemaining, removepublic IFilter getFilter()
public SubFilterEventConverter getConverter()
public String getName()
IFilterpublic String getDisplayName()
IFiltergetDisplayName in interface IFilterpublic void open(RawDocument input)
IFilterpublic void open(RawDocument input, boolean generateSkeleton)
IFilterpublic void close()
IFilterclose in interface AutoCloseableclose in interface IFilterpublic boolean hasNext()
IFilterImplementer Note: The caller must be able to call this method several times without changing state.
public Event next()
IFilterpublic void cancel()
IFilterpublic IParameters getParameters()
IFiltergetParameters in interface IFilterpublic void setParameters(IParameters params)
IFiltersetParameters in interface IFilterparams - The new parameters to use.public void setFilterConfigurationMapper(IFilterConfigurationMapper fcMapper)
IFiltersetFilterConfigurationMapper in interface IFilterfcMapper - the mapper to set.public ISkeletonWriter createSkeletonWriter()
IFiltercreateSkeletonWriter in interface IFilterpublic IFilterWriter createFilterWriter()
IFiltercreateFilterWriter in interface IFilterpublic EncoderManager getEncoderManager()
IFiltergetEncoderManager in interface IFilterpublic String getMimeType()
IFiltergetMimeType in interface IFilterpublic List<FilterConfiguration> getConfigurations()
IFiltergetConfigurations in interface IFilterpublic List<Event> getEvents(RawDocument input)
input - the RawDocument to retrieve events from.public Code createRefCode()
public Event createRefEvent()
protected String buildResourceName(String resName, boolean autoGenerated, Class<? extends INameable> resClass)
protected String buildRefId()
public static boolean resourceIdsMatch(String startSubfilterResourceId, String endSubfilterResourceId)
protected String buildRefName()
protected final String getParentId()
protected final String getParentName()
protected final int getSectionIndex()
protected void convertRefsInSkeleton(ISkeleton skel)
Copyright © 2021. All rights reserved.