Class SubFilterWrapper

  • All Implemented Interfaces:
    AutoCloseable, Iterator<Event>, IFilter, ISubFilter

    public class SubFilterWrapper
    extends AbstractSubFilter
    Wrapper that converts any IFilter into a ISubFilter (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.
    • Constructor Detail

      • SubFilterWrapper

        public SubFilterWrapper​(IFilter filter,
                                IEncoder parentEncoder,
                                int sectionIndex,
                                String parentId,
                                String parentName)
    • Method Detail

      • getFilter

        public IFilter getFilter()
      • getName

        public String getName()
        Description copied from interface: IFilter
        Gets the name/identifier of this filter.
        Specified by:
        getName in interface IFilter
        Overrides:
        getName in class AbstractFilter
        Returns:
        The name/identifier of the filter.
      • open

        public void open​(RawDocument input)
        Description copied from interface: IFilter
        Opens the input document described in a give RawDocument object. Skeleton information is always created when you use this method.
        Parameters:
        input - The RawDocument object to use to open the document.
      • open

        public void open​(RawDocument input,
                         boolean generateSkeleton)
        Description copied from interface: IFilter
        Opens the input document described in a give RawDocument object, and optionally creates skeleton information.
        Specified by:
        open in interface IFilter
        Overrides:
        open in class AbstractFilter
        Parameters:
        input - The RawDocument object to use to open the document.
        generateSkeleton - true to generate the skeleton data, false otherwise.
      • close

        public void close()
        Description copied from interface: IFilter
        Closes the input document. Developers should call this method from within their code before sending the last event: This can allow writer objects to overwrite the input file when they receive the last event. This method must also be safe to call even if the input document is not opened.
        Specified by:
        close in interface AutoCloseable
        Specified by:
        close in interface IFilter
        Overrides:
        close in class AbstractFilter
      • hasNext

        public boolean hasNext()
        Description copied from interface: IFilter
        Indicates if there is an event to process.

        Implementer Note: The caller must be able to call this method several times without changing state.

        Returns:
        True if there is at least one event to process, false if not.
      • next

        public Event next()
        Description copied from interface: IFilter
        Gets the next event available. Calling this method can be done only once on each event.
        Returns:
        The next event available or null if there are no events.
      • getEncoderManager

        public EncoderManager getEncoderManager()
        Description copied from interface: IFilter
        Gets the EncoderManager object for this filter. This encoder manager should provided the mappings to the different MIME types used by the filter.
        Specified by:
        getEncoderManager in interface IFilter
        Overrides:
        getEncoderManager in class AbstractFilter
        Returns:
        the EncoderManager for this filter.
      • setFilterConfigurationMapper

        public void setFilterConfigurationMapper​(IFilterConfigurationMapper fcMapper)
        Description copied from interface: IFilter
        Sets the filter configuration mapper for this filter. This object is used by this filter if it needs to instantiate sub-filters. The implementations of IFilter that do not use sub-filters can use an empty stub for this method.
        Specified by:
        setFilterConfigurationMapper in interface IFilter
        Overrides:
        setFilterConfigurationMapper in class AbstractFilter
        Parameters:
        fcMapper - the mapper to set.