Class HTMLOptions

  • All Implemented Interfaces:
    java.io.Serializable

    public class HTMLOptions
    extends java.lang.Object
    implements java.io.Serializable
    Options for (X)HTML filter. Serializable to allow saving to / reading from configuration file.

    HTML filter would have the following options ([+] means default on).
    Add or rewrite encoding declaration in HTML and XHTML files:

    • [] Always
    • [+] Only if HTML file has a header
    • [] Only if HTML file has an encoding declaration
    • [] Never
    Translatable attributes:
    • [+] href
    • [+] src
    • [+] lang
    • [+] hreflang
    • [+] value
    • [+] value (of buttons)
    Start a new paragraph on breaks (<br>) []
    Skip text matching regExp []
    Skip content of meta-tag when any of the given attibutename-value pairs is present in the tag
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int REWRITE_ALWAYS
      (X)HTML filter should always add/rewrite encoding declaration.
      static int REWRITE_IFHEADER
      Default.
      static int REWRITE_IFMETA
      (X)HTML filter should rewrite encoding declaration meta-tag if HTML file has one.
      static int REWRITE_NEVER
      (X)HTML filter should never rewrite encoding declaration.
    • Constructor Summary

      Constructors 
      Constructor Description
      HTMLOptions()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean getParagraphOnBr()
      Returns whether a new paragraph should be started on BR.
      int getRewriteEncoding()
      Returns whether and when (X)HTML filter adds/rewrites encoding declaration.
      java.lang.String getSkipMeta()
      Returns the meta-tag attribute key-value pairs of which meta-tags should not be translated
      java.lang.String getSkipRegExp()
      Returns the regular expression that matches text not to be translated
      boolean getTranslateButtonValue()
      Returns whether button value attributes should be translated.
      boolean getTranslateHref()
      Returns whether href attributes should be translated.
      boolean getTranslateHreflang()
      Returns whether hreflang attributes should be translated.
      boolean getTranslateLang()
      Returns whether lang attributes should be translated.
      boolean getTranslateSrc()
      Returns whether src attributes should be translated.
      boolean getTranslateValue()
      Returns whether value attributes should be translated.
      void setParagraphOnBr​(boolean paragraphOnBr)
      Sets whether a new paragraph should be started on BR.
      void setRewriteEncoding​(int rewriteEncoding)
      Sets when (X)HTML filter should add/rewrite encoding declaration.
      void setSkipMeta​(java.lang.String skipMeta)
      Sets the meta-tag attribute key-value pairs of which meta-tags should not be translated
      void setSkipRegExp​(java.lang.String skipRegExp)
      Sets the regular expression that matches text not to be translated
      void setTranslateButtonValue​(boolean translateButtonValue)
      Sets whether button value attributes should be translated.
      void setTranslateHref​(boolean translateHref)
      Sets whether href attributes should be translated.
      void setTranslateHreflang​(boolean translateHreflang)
      Sets whether hreflang attributes should be translated.
      void setTranslateLang​(boolean translateLang)
      Sets whether lang attributes should be translated.
      void setTranslateSrc​(boolean translateSrc)
      Sets whether src attributes should be translated.
      void setTranslateValue​(boolean translateValue)
      Sets whether value attributes should be translated.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • REWRITE_ALWAYS

        public static final int REWRITE_ALWAYS
        (X)HTML filter should always add/rewrite encoding declaration.
        See Also:
        Constant Field Values
      • REWRITE_IFHEADER

        public static final int REWRITE_IFHEADER
        Default. (X)HTML filter should rewrite encoding declaration if HTML file has a header.
        See Also:
        Constant Field Values
      • REWRITE_IFMETA

        public static final int REWRITE_IFMETA
        (X)HTML filter should rewrite encoding declaration meta-tag if HTML file has one.
        See Also:
        Constant Field Values
      • REWRITE_NEVER

        public static final int REWRITE_NEVER
        (X)HTML filter should never rewrite encoding declaration.
        See Also:
        Constant Field Values
    • Constructor Detail

      • HTMLOptions

        public HTMLOptions()
    • Method Detail

      • getTranslateHref

        public boolean getTranslateHref()
        Returns whether href attributes should be translated.
      • setTranslateHref

        public void setTranslateHref​(boolean translateHref)
        Sets whether href attributes should be translated.
      • getTranslateSrc

        public boolean getTranslateSrc()
        Returns whether src attributes should be translated.
      • setTranslateSrc

        public void setTranslateSrc​(boolean translateSrc)
        Sets whether src attributes should be translated.
      • getTranslateLang

        public boolean getTranslateLang()
        Returns whether lang attributes should be translated.
      • setTranslateLang

        public void setTranslateLang​(boolean translateLang)
        Sets whether lang attributes should be translated.
      • getTranslateHreflang

        public boolean getTranslateHreflang()
        Returns whether hreflang attributes should be translated.
      • setTranslateHreflang

        public void setTranslateHreflang​(boolean translateHreflang)
        Sets whether hreflang attributes should be translated.
      • setTranslateValue

        public void setTranslateValue​(boolean translateValue)
        Sets whether value attributes should be translated.
      • getTranslateValue

        public boolean getTranslateValue()
        Returns whether value attributes should be translated.
      • setTranslateButtonValue

        public void setTranslateButtonValue​(boolean translateButtonValue)
        Sets whether button value attributes should be translated.
      • getTranslateButtonValue

        public boolean getTranslateButtonValue()
        Returns whether button value attributes should be translated.
      • getParagraphOnBr

        public boolean getParagraphOnBr()
        Returns whether a new paragraph should be started on BR.
      • setParagraphOnBr

        public void setParagraphOnBr​(boolean paragraphOnBr)
        Sets whether a new paragraph should be started on BR.
      • getSkipRegExp

        public java.lang.String getSkipRegExp()
        Returns the regular expression that matches text not to be translated
      • setSkipRegExp

        public void setSkipRegExp​(java.lang.String skipRegExp)
        Sets the regular expression that matches text not to be translated
      • getSkipMeta

        public java.lang.String getSkipMeta()
        Returns the meta-tag attribute key-value pairs of which meta-tags should not be translated
      • setSkipMeta

        public void setSkipMeta​(java.lang.String skipMeta)
        Sets the meta-tag attribute key-value pairs of which meta-tags should not be translated