Package com.helger.html.hc.render
Class HCRenderer
- java.lang.Object
-
- com.helger.html.hc.render.HCRenderer
-
@Immutable public final class HCRenderer extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetAsHTMLString(IHCNode aHCNode)Convert the passed HC node to an HTML string using the default conversion settings.static StringgetAsHTMLString(IHCNode aHCNode, IHCConversionSettings aConversionSettings)Convert the passed node to it's HTML representation.static StringgetAsHTMLStringWithoutNamespaces(IHCNode aHCNode)Convert the passed HC node to an HTML string without namespaces.static com.helger.xml.microdom.IMicroNodegetAsNode(IHCNode aHCNode)Convert the passed HC node to a micro node using the default conversion settings.static com.helger.xml.microdom.IMicroNodegetAsNode(IHCNode aSrcNode, IHCConversionSettingsToNode aConversionSettings)Convert the passed HC node to a micro node using the provided conversion settings.static <T extends IHCNode>
TgetPreparedNode(T aNode, IHCHasChildrenMutable<?,? super IHCNode> aTargetNode, IHCConversionSettingsToNode aConversionSettings)Prepare and return a single node.static voidprepareForConversion(IHCNode aStartNode, IHCHasChildrenMutable<?,? super IHCNode> aGlobalTargetNode, IHCConversionSettingsToNode aConversionSettings)Customize the passed base node and all child nodes recursively.static voidprepareHtmlForConversion(HCHtml aHtml, IHCConversionSettingsToNode aConversionSettings)static voidwriteHtmlTo(IHCNode aHCNode, IHCConversionSettings aConversionSettings, OutputStream aOS)static voidwriteHtmlTo(IHCNode aHCNode, OutputStream aOS)
-
-
-
Method Detail
-
getPreparedNode
@Nonnull public static <T extends IHCNode> T getPreparedNode(@Nonnull T aNode, @Nonnull IHCHasChildrenMutable<?,? super IHCNode> aTargetNode, @Nonnull IHCConversionSettingsToNode aConversionSettings)
Prepare and return a single node.- Type Parameters:
T- Input and return node type- Parameters:
aNode- Node to be prepared.aTargetNode- Target node for additional nodes.aConversionSettings- Conversion settings to be used.- Returns:
- The passed in node.
-
prepareHtmlForConversion
public static void prepareHtmlForConversion(@Nonnull HCHtml aHtml, @Nonnull IHCConversionSettingsToNode aConversionSettings)
-
prepareForConversion
public static void prepareForConversion(@Nonnull IHCNode aStartNode, @Nonnull IHCHasChildrenMutable<?,? super IHCNode> aGlobalTargetNode, @Nonnull IHCConversionSettingsToNode aConversionSettings)
Customize the passed base node and all child nodes recursively.- Parameters:
aStartNode- Base node to start customizing (incl.). May not benull.aGlobalTargetNode- The target node where new nodes should be appended to in case the direct parent node is not suitable. May not benull.aConversionSettings- The conversion settings to use. May not benull.
-
getAsNode
@Nullable public static com.helger.xml.microdom.IMicroNode getAsNode(@Nonnull IHCNode aHCNode)
Convert the passed HC node to a micro node using the default conversion settings.- Parameters:
aHCNode- The node to be converted. May not benull.- Returns:
- The fully created HTML node
-
getAsNode
@Nullable public static com.helger.xml.microdom.IMicroNode getAsNode(@Nonnull IHCNode aSrcNode, @Nonnull IHCConversionSettingsToNode aConversionSettings)
Convert the passed HC node to a micro node using the provided conversion settings.- Parameters:
aSrcNode- The node to be converted. May not benull.aConversionSettings- The conversion settings to be used. May not benull.- Returns:
- The fully created HTML node
-
getAsHTMLString
@Nonnull public static String getAsHTMLString(@Nonnull IHCNode aHCNode)
Convert the passed HC node to an HTML string using the default conversion settings.- Parameters:
aHCNode- The node to be converted. May not benull.- Returns:
- The node as XML with or without indentation.
-
getAsHTMLString
@Nonnull public static String getAsHTMLString(@Nonnull IHCNode aHCNode, @Nonnull IHCConversionSettings aConversionSettings)
Convert the passed node to it's HTML representation. First this HC-node is converted to a micro node, which is than- Parameters:
aHCNode- The HC node to be converted to an HTML string. May not benull.aConversionSettings- The conversion settings to be used. May not benull.- Returns:
- The node as HTML string. Never
null.
-
writeHtmlTo
public static void writeHtmlTo(@Nonnull IHCNode aHCNode, @Nonnull OutputStream aOS)
-
writeHtmlTo
public static void writeHtmlTo(@Nonnull IHCNode aHCNode, @Nonnull IHCConversionSettings aConversionSettings, @Nonnull @WillClose OutputStream aOS)
-
getAsHTMLStringWithoutNamespaces
@Nonnull public static String getAsHTMLStringWithoutNamespaces(@Nonnull IHCNode aHCNode)
Convert the passed HC node to an HTML string without namespaces. Indent and align status is determined fromGlobalDebug.isDebugMode()- Parameters:
aHCNode- The node to be converted. May not benull.- Returns:
- The node as XML with or without indentation.
-
-