/** * Convert the passed HC node to a micro node using the default conversion * settings. * * @param aHCNode * The node to be converted. May not be <code>null</code>. * @return The fully created HTML node */ @Nullable public static IMicroNode getAsNode (@Nonnull final IHCNode aHCNode) { return getAsNode (aHCNode, HCSettings.getConversionSettings ()); }
/** * Convert the passed HC node to an HTML string using the default conversion * settings. * * @param aHCNode * The node to be converted. May not be <code>null</code>. * @return The node as XML with or without indentation. */ @Nonnull public static String getAsHTMLString (@Nonnull final IHCNode aHCNode) { return getAsHTMLString (aHCNode, HCSettings.getConversionSettings ()); }
/** * Get the {@link Charset} that is used to create the HTML code. * * @return The non-<code>null</code> Charset object */ @Nonnull public static Charset getHTMLCharset () { return getConversionSettings ().getXMLWriterSettings ().getCharsetObj (); }
private JQuerySelector (@Nonnull @Nonempty final String sSelectorName, @Nonnull final IJSExpression aSelectorExpr) { // Is used as a literal!! this (sSelectorName + '(' + aSelectorExpr.getJSCode (HCSettings.getConversionSettings ().getJSWriterSettings ()) + ')'); ValueEnforcer.notEmpty (sSelectorName, "SelectorName"); }
private JQuerySelector (@Nonnull @Nonempty final String sSelectorName, @Nonnull final IJSExpression aSelectorExpr) { // Is used as a literal!! this (sSelectorName + '(' + aSelectorExpr.getJSCode (HCSettings.getConversionSettings ().getJSWriterSettings ()) + ')'); ValueEnforcer.notEmpty (sSelectorName, "SelectorName"); }
@Override @OverrideOnDemand @OverridingMethodsMustInvokeSuper public void before () { m_ePrevHTMLVersion = HCSettings.getConversionSettings ().getHTMLVersion (); HCSettings.setDefaultHTMLVersion (m_eHTMLVersion); }
public static void createHTMLResponse (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope, @Nonnull final UnifiedResponse aUnifiedResponse, @Nonnull final IHTMLProvider aHTMLProvider) { // Build the main HC tree final HCHtml aHtml = aHTMLProvider.createHTML (aRequestScope); // Add some ad comment :) aHtml.head () .metaElements () .add (new HCMeta ().setName (EStandardMetaElement.GENERATOR.getName ()) .setContent ("https://github.com/phax/ph-oton // phax // ASL 2.0")); // Convert HTML to String, including namespaces try ( final NonBlockingByteArrayOutputStream aBAOS = new NonBlockingByteArrayOutputStream (50 * CGlobal.BYTES_PER_KILOBYTE)) { final IMimeType aMimeType = getMimeType (aRequestScope); final IHCConversionSettings aCS = HCSettings.getConversionSettings (); HCRenderer.writeHtmlTo (aHtml, aCS, aBAOS); // Write to response aUnifiedResponse.setMimeType (aMimeType) .setCharset (aCS.getCharset ()) .setContent (HasInputStream.multiple (aBAOS::getAsInputStream)) .disableCaching (); } }
final IHCConversionSettingsToNode aConversionSettings = HCSettings.getConversionSettings ();
if (HCConversionSettings.isDefaultCustomizer (HCSettings.getConversionSettings ().getCustomizer ()))
final IHCConversionSettings aConversionSettings = HCSettings.getConversionSettings ();
final IHCConversionSettings aConversionSettings = HCSettings.getConversionSettings ();