Class HCRenderer


  • @Immutable
    public final class HCRenderer
    extends Object
    • 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.
      • 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 be null .
        aGlobalTargetNode - The target node where new nodes should be appended to in case the direct parent node is not suitable. May not be null.
        aConversionSettings - The conversion settings to use. May not be null.
      • 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 be null.
        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 be null.
        aConversionSettings - The conversion settings to be used. May not be null.
        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 be null.
        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 be null.
        aConversionSettings - The conversion settings to be used. May not be null.
        Returns:
        The node as HTML string. Never null.
      • 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 from GlobalDebug.isDebugMode()
        Parameters:
        aHCNode - The node to be converted. May not be null.
        Returns:
        The node as XML with or without indentation.