Interface IFilter

    • Field Detail

      • SUB_FILTER

        static final String SUB_FILTER
        Prefix marker indicating a sub-filter in the name of a StartDocument object created when processing content with sub-filters.
        See Also:
        Constant Field Values
    • Method Detail

      • getName

        String getName()
        Gets the name/identifier of this filter.
        Returns:
        The name/identifier of the filter.
      • getDisplayName

        String getDisplayName()
        Gets the localizable display name of this filter.
        Returns:
        the localizable display name of this filter.
      • open

        void open​(RawDocument input)
        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

        void open​(RawDocument input,
                  boolean generateSkeleton)
        Opens the input document described in a give RawDocument object, and optionally creates skeleton information.
        Parameters:
        input - The RawDocument object to use to open the document.
        generateSkeleton - true to generate the skeleton data, false otherwise.
      • close

        void close()
        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
      • hasNext

        boolean hasNext()
        Indicates if there is an event to process.

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

        Specified by:
        hasNext in interface Iterator<Event>
        Returns:
        True if there is at least one event to process, false if not.
      • next

        Event next()
        Gets the next event available. Calling this method can be done only once on each event.
        Specified by:
        next in interface Iterator<Event>
        Returns:
        The next event available or null if there are no events.
      • cancel

        void cancel()
        Cancels the current process.
      • getParameters

        default IParameters getParameters()
        Gets the current parameters for this filter.
        Returns:
        The current parameters for this filter, or DefaultParameters if this filter has no parameters.
      • setParameters

        void setParameters​(IParameters params)
        Sets new parameters for this filter.
        Parameters:
        params - The new parameters to use.
      • setFilterConfigurationMapper

        void setFilterConfigurationMapper​(IFilterConfigurationMapper fcMapper)
        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.
        Parameters:
        fcMapper - the mapper to set.
      • createSkeletonWriter

        ISkeletonWriter createSkeletonWriter()
        Creates a new ISkeletonWriter object that corresponds to the type of skeleton this filter uses.
        Returns:
        A new instance of ISkeletonWriter for the type of skeleton this filter uses.
      • createFilterWriter

        IFilterWriter createFilterWriter()
        Creates a new IFilterWriter object from the most appropriate class to use with this filter.
        Returns:
        A new instance of IFilterWriter for the preferred implementation for this filter.
      • getEncoderManager

        EncoderManager getEncoderManager()
        Gets the EncoderManager object for this filter. This encoder manager should provided the mappings to the different MIME types used by the filter.
        Returns:
        the EncoderManager for this filter.
      • getMimeType

        String getMimeType()
        Gets the MIME type of the format supported by this filter.
        Returns:
        The MIME type of the format supported by this filter.
      • getConfigurations

        List<FilterConfiguration> getConfigurations()
        Gets the list of all predefined configurations for this filter.
        Returns:
        a list of the all predefined configurations for this filter.
      • isMultilingual

        default boolean isMultilingual()
      • stream

        default Stream<Event> stream()
        Generates all events from a filter as a Stream.
        Returns:
        the Stream of events from the filter