Package com.helger.html.hc.config
Class HCSettings
- java.lang.Object
-
- com.helger.html.hc.config.HCSettings
-
@ThreadSafe public final class HCSettings extends Object
Global HTML Control settings- Author:
- Philip Helger
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_AUTO_COMPLETE_OFF_FOR_PASSWORD_EDITSDefault auto-complete for password fields: only in debug modestatic EHTMLVersionDEFAULT_HTML_VERSIONDefault HTML version is HTML5static EHCScriptInlineModeDEFAULT_SCRIPT_INLINE_MODEBy default inline scripts are emitted in mode "plain text"static EHCStyleInlineModeDEFAULT_STYLE_MODEBy default plain text without escape is used
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IHCConversionSettingsgetConversionSettings()static HCConversionSettingsgetConversionSettingsWithoutNamespaces()static CharsetgetHTMLCharset()Get theCharsetthat is used to create the HTML code.static HCConversionSettingsgetMutableConversionSettings()static com.helger.commons.system.ENewLineModegetNewLineMode()static IHCOnDocumentReadyProvidergetOnDocumentReadyProvider()static EHCScriptInlineModegetScriptInlineMode()static EHCStyleInlineModegetStyleInlineMode()static intgetTextAreaDefaultRows()static booleanisAutoCompleteOffForPasswordEdits()static booleanisOutOfBandDebuggingEnabled()static booleanisScriptsInBody()static booleanisSilentMode()static booleanisUseRegularResources()static voidsetAutoCompleteOffForPasswordEdits(boolean bAutoCompleteOffForPasswordEdits)static voidsetConversionSettings(HCConversionSettings aConversionSettings)Set the global conversion settings.static voidsetDefaultHTMLVersion(EHTMLVersion eHTMLVersion)Set the default HTML version to use.static voidsetNewLineMode(com.helger.commons.system.ENewLineMode eNewLineMode)static voidsetOnDocumentReadyProvider(IHCOnDocumentReadyProvider aOnDocumentReadyProvider)static voidsetOutOfBandDebuggingEnabled(boolean bEnabled)static voidsetScriptInlineMode(EHCScriptInlineMode eMode)Set how the content of script elements should be emitted.static voidsetScriptsInBody(boolean bEnabled)static booleansetSilentMode(boolean bSilentMode)static voidsetStyleInlineMode(EHCStyleInlineMode eStyleInlineMode)Set how the content of style elements should be emitted.static voidsetTextAreaDefaultRows(int nTextAreaDefaultRows)static voidsetUseRegularResources(boolean bUseRegularResources)
-
-
-
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 benull.
-
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-
nullconversion settings
-
getConversionSettingsWithoutNamespaces
@Nonnull public static HCConversionSettings getConversionSettingsWithoutNamespaces()
- Returns:
- The global read-only non-
nullconversion settings with XML namespaces disabled
-
getHTMLCharset
@Nonnull public static Charset getHTMLCharset()
Get theCharsetthat is used to create the HTML code.- Returns:
- The non-
nullCharset object
-
setDefaultHTMLVersion
public static void setDefaultHTMLVersion(@Nonnull EHTMLVersion eHTMLVersion)
Set the default HTML version to use. This sets the HTML version in theHCSettingsclass and performs some additional modifications depending on the chosen version.- Parameters:
eHTMLVersion- The HTML version to use. May not benull.
-
isAutoCompleteOffForPasswordEdits
public static boolean isAutoCompleteOffForPasswordEdits()
-
setAutoCompleteOffForPasswordEdits
public static void setAutoCompleteOffForPasswordEdits(boolean bAutoCompleteOffForPasswordEdits)
-
getTextAreaDefaultRows
public static int getTextAreaDefaultRows()
-
setTextAreaDefaultRows
public static void setTextAreaDefaultRows(int nTextAreaDefaultRows)
-
getOnDocumentReadyProvider
@Nonnull public static IHCOnDocumentReadyProvider getOnDocumentReadyProvider()
-
setOnDocumentReadyProvider
public static void setOnDocumentReadyProvider(@Nonnull IHCOnDocumentReadyProvider aOnDocumentReadyProvider)
-
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 isDEFAULT_SCRIPT_INLINE_MODE.- Parameters:
eMode- The new masking mode to set. May not benull.
-
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 isDEFAULT_STYLE_MODE.- Parameters:
eStyleInlineMode- The new mode to set. May not benull.
-
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:
trueif <script> elements should be placed in the <body>,falseif they should be placed in the <head>. Default istrue.
-
setScriptsInBody
public static void setScriptsInBody(boolean bEnabled)
-
isUseRegularResources
public static boolean isUseRegularResources()
- Returns:
trueto include regular, non-minified resources orfalseto include minified resources (JS + CSS).
-
setUseRegularResources
public static void setUseRegularResources(boolean bUseRegularResources)
-
-