/** * Constructor * * @param eHTMLVersion * The HTML version to use. May not be <code>null</code>. */ public HCConversionSettings (@Nonnull final EHTMLVersion eHTMLVersion) { setHTMLVersion (eHTMLVersion); setToDefault (); }
/** * Kind of copy constructor. Also creates a copy of the * {@link XMLWriterSettings} and the {@link CSSWriterSettings}. * * @param aBase * Object to copy the settings from. May not be <code>null</code>. * @param eHTMLVersion * A different HTML version to use than the one from the base settings */ public HCConversionSettings (@Nonnull final IHCConversionSettings aBase, @Nonnull final EHTMLVersion eHTMLVersion) { ValueEnforcer.notNull (aBase, "Base"); ValueEnforcer.notNull (eHTMLVersion, "HTMLVersion"); setHTMLVersion (eHTMLVersion); m_aXMLWriterSettings = aBase.getMutableXMLWriterSettings ().getClone (); m_aCSSWriterSettings = aBase.getMutableCSSWriterSettings ().getClone (); m_aJSWriterSettings = aBase.getMutableJSWriterSettings ().getClone (); m_bConsistencyChecksEnabled = aBase.areConsistencyChecksEnabled (); m_bExtractOutOfBandNodes = aBase.isExtractOutOfBandNodes (); m_aCustomizer = aBase.getCustomizer (); }
/** * Set the default HTML version to use. This sets the HTML version in the * {@link HCSettings} class and performs some additional modifications * depending on the chosen version. * * @param eHTMLVersion * The HTML version to use. May not be <code>null</code>. */ public static void setDefaultHTMLVersion (@Nonnull final EHTMLVersion eHTMLVersion) { ValueEnforcer.notNull (eHTMLVersion, "HTMLVersion"); // Update the HCSettings getMutableConversionSettings ().setHTMLVersion (eHTMLVersion); // Update the XMLWriterSettings getMutableConversionSettings ().setXMLWriterSettings (HCConversionSettings.createDefaultXMLWriterSettings (eHTMLVersion)); s_aLogger.info ("Default HTML version set to " + eHTMLVersion); if (eHTMLVersion.isAtLeastHTML5 ()) { // No need to put anything in a comment if (getScriptInlineMode () != EHCScriptInlineMode.PLAIN_TEXT_NO_ESCAPE) setScriptInlineMode (EHCScriptInlineMode.PLAIN_TEXT_NO_ESCAPE); } else { // Use default mode if (getScriptInlineMode () != DEFAULT_SCRIPT_INLINE_MODE) setScriptInlineMode (DEFAULT_SCRIPT_INLINE_MODE); } }