Class HCSettings


  • @ThreadSafe
    public final class HCSettings
    extends Object
    Global HTML Control settings
    Author:
    Philip Helger
    • Field Detail

      • DEFAULT_HTML_VERSION

        public static final EHTMLVersion DEFAULT_HTML_VERSION
        Default HTML version is HTML5
      • DEFAULT_AUTO_COMPLETE_OFF_FOR_PASSWORD_EDITS

        public static final boolean DEFAULT_AUTO_COMPLETE_OFF_FOR_PASSWORD_EDITS
        Default auto-complete for password fields: only in debug mode
      • DEFAULT_SCRIPT_INLINE_MODE

        public static final EHCScriptInlineMode DEFAULT_SCRIPT_INLINE_MODE
        By default inline scripts are emitted in mode "plain text"
      • DEFAULT_STYLE_MODE

        public static final EHCStyleInlineMode DEFAULT_STYLE_MODE
        By default plain text without escape is used
    • Method Detail

      • isSilentMode

        public static boolean isSilentMode()
      • setSilentMode

        public static boolean setSilentMode​(boolean bSilentMode)
      • setConversionSettings

        public static void setConversionSettings​(@Nonnull
                                                 HCConversionSettings aConversionSettings)
        Set the global conversion settings.
        Parameters:
        aConversionSettings - The object to be used. May not be null.
      • getMutableConversionSettings

        @Nonnull
        @ReturnsMutableObject
        public static HCConversionSettings getMutableConversionSettings()
        Returns:
        The global mutable conversion settings. Never null.
      • getConversionSettings

        @Nonnull
        public static IHCConversionSettings getConversionSettings()
        Returns:
        The global read-only non-null conversion settings
      • getConversionSettingsWithoutNamespaces

        @Nonnull
        public static HCConversionSettings getConversionSettingsWithoutNamespaces()
        Returns:
        The global read-only non-null conversion settings with XML namespaces disabled
      • getHTMLCharset

        @Nonnull
        public static Charset getHTMLCharset()
        Get the Charset that is used to create the HTML code.
        Returns:
        The non-null Charset object
      • setDefaultHTMLVersion

        public static void setDefaultHTMLVersion​(@Nonnull
                                                 EHTMLVersion eHTMLVersion)
        Set the default HTML version to use. This sets the HTML version in the HCSettings class and performs some additional modifications depending on the chosen version.
        Parameters:
        eHTMLVersion - The HTML version to use. May not be null.
      • isAutoCompleteOffForPasswordEdits

        public static boolean isAutoCompleteOffForPasswordEdits()
      • setAutoCompleteOffForPasswordEdits

        public static void setAutoCompleteOffForPasswordEdits​(boolean bAutoCompleteOffForPasswordEdits)
      • getTextAreaDefaultRows

        public static int getTextAreaDefaultRows()
      • setTextAreaDefaultRows

        public static void setTextAreaDefaultRows​(int nTextAreaDefaultRows)
      • getScriptInlineMode

        @Nonnull
        public static EHCScriptInlineMode getScriptInlineMode()
        Returns:
        The default masking mode to emit script content. Never null.
      • setScriptInlineMode

        public static void setScriptInlineMode​(@Nonnull
                                               EHCScriptInlineMode eMode)
        Set how the content of script elements should be emitted. This only affects new built objects, and does not alter existing objects! The default mode is DEFAULT_SCRIPT_INLINE_MODE.
        Parameters:
        eMode - The new masking mode to set. May not be null.
      • getStyleInlineMode

        @Nonnull
        public static EHCStyleInlineMode getStyleInlineMode()
        Returns:
        The default mode to emit style content. Never null.
      • setStyleInlineMode

        public static void setStyleInlineMode​(@Nonnull
                                              EHCStyleInlineMode eStyleInlineMode)
        Set how the content of style elements should be emitted. This only affects new built objects, and does not alter existing objects! The default mode is DEFAULT_STYLE_MODE.
        Parameters:
        eStyleInlineMode - The new mode to set. May not be null.
      • getNewLineMode

        @Nonnull
        public static com.helger.commons.system.ENewLineMode getNewLineMode()
      • setNewLineMode

        public static void setNewLineMode​(@Nonnull
                                          com.helger.commons.system.ENewLineMode eNewLineMode)
      • isOutOfBandDebuggingEnabled

        public static boolean isOutOfBandDebuggingEnabled()
      • setOutOfBandDebuggingEnabled

        public static void setOutOfBandDebuggingEnabled​(boolean bEnabled)
      • isScriptsInBody

        public static boolean isScriptsInBody()
        Returns:
        true if <script> elements should be placed in the <body>, false if they should be placed in the <head>. Default is true.
      • setScriptsInBody

        public static void setScriptsInBody​(boolean bEnabled)
      • isUseRegularResources

        public static boolean isUseRegularResources()
        Returns:
        true to include regular, non-minified resources or false to include minified resources (JS + CSS).
      • setUseRegularResources

        public static void setUseRegularResources​(boolean bUseRegularResources)