Class XHTMLFilter

  • All Implemented Interfaces:
    IFilter

    public class XHTMLFilter
    extends XMLFilter
    Filter for XHTML files.
    • Constructor Detail

      • XHTMLFilter

        public XHTMLFilter()
        Creates a new instance of XHTMLFilter
    • Method Detail

      • getDefaultInstances

        public Instance[] getDefaultInstances()
        The default list of filter instances that this filter class has. One filter class may have different filter instances, different by source file mask, encoding of the source file etc.

        Note that the user may change the instances freely.

        Specified by:
        getDefaultInstances in interface IFilter
        Specified by:
        getDefaultInstances in class AbstractFilter
        Returns:
        Default filter instances
      • isFileSupported

        public boolean isFileSupported​(java.io.File inFile,
                                       java.util.Map<java.lang.String,​java.lang.String> config,
                                       FilterContext context)
        Checking whether it is a valid XHTML file.
        Specified by:
        isFileSupported in interface IFilter
        Overrides:
        isFileSupported in class AbstractFilter
        Parameters:
        inFile - Source file.
        config - filter's configuration options
        context - Filter context.
        Returns:
        Does the filter support the file.
      • translate

        public java.lang.String translate​(java.lang.String entry,
                                          java.util.List<ProtectedPart> protectedParts)
        Overrides superimplementation not to send translatable content on XHTML validity check, and don't translate items that match regular expression.
        Overrides:
        translate in class XMLFilter
      • hasOptions

        public boolean hasOptions()
        Returns true to indicate that the XHTML filter has options.
        Specified by:
        hasOptions in interface IFilter
        Overrides:
        hasOptions in class AbstractFilter
        Returns:
        True, because the XHTML filter has options.
      • changeOptions

        public java.util.Map<java.lang.String,​java.lang.String> changeOptions​(java.awt.Window parent,
                                                                                    java.util.Map<java.lang.String,​java.lang.String> currentOptions)
        XHTML Filter shows a modal dialog to edit its own options.
        Parameters:
        currentOptions - Current options to edit.
        parent - parent window
        Returns:
        Updated filter options if user confirmed the changes, and current options otherwise.