Class AbstractHCNode

    • Constructor Detail

      • AbstractHCNode

        public AbstractHCNode()
    • Method Detail

      • hasChildren

        @OverrideOnDemand
        public boolean hasChildren()
        Specified by:
        hasChildren in interface com.helger.commons.hierarchy.IHasChildren<IHCNode>
      • getChildCount

        @OverrideOnDemand
        @Nonnegative
        public int getChildCount()
        Specified by:
        getChildCount in interface com.helger.commons.hierarchy.IHasChildren<IHCNode>
      • getAllChildren

        @Nullable
        @OverrideOnDemand
        public com.helger.commons.collection.impl.ICommonsList<? extends IHCNode> getAllChildren()
        Specified by:
        getAllChildren in interface com.helger.commons.hierarchy.IHasChildren<IHCNode>
        Specified by:
        getAllChildren in interface com.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>
      • getChildren

        @OverrideOnDemand
        @Nullable
        public com.helger.commons.collection.impl.ICommonsIterable<? extends IHCNode> getChildren()
        Specified by:
        getChildren in interface com.helger.commons.hierarchy.IHasChildren<IHCNode>
      • forAllChildren

        public void forAllChildren​(@Nonnull
                                   Consumer<? super IHCNode> aConsumer)
        Specified by:
        forAllChildren in interface com.helger.commons.hierarchy.IHasChildren<IHCNode>
      • forAllChildrenBreakable

        @Nonnull
        public com.helger.commons.state.EContinue forAllChildrenBreakable​(@Nonnull
                                                                          Function<? super IHCNode,​com.helger.commons.state.EContinue> aConsumer)
        Specified by:
        forAllChildrenBreakable in interface com.helger.commons.hierarchy.IHasChildren<IHCNode>
      • getChildAtIndex

        @Nullable
        @OverrideOnDemand
        public IHCNode getChildAtIndex​(@Nonnegative
                                       int nIndex)
        Specified by:
        getChildAtIndex in interface com.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>
      • getFirstChild

        @Nullable
        @OverrideOnDemand
        public IHCNode getFirstChild()
        Specified by:
        getFirstChild in interface com.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>
      • getLastChild

        @Nullable
        @OverrideOnDemand
        public IHCNode getLastChild()
        Specified by:
        getLastChild in interface com.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>
      • internalSetNodeState

        public final void internalSetNodeState​(@Nonnull
                                               EHCNodeState eNodeState)
        Change the node state internally. Handle with care!
        Parameters:
        eNodeState - The new node state. May not be null.
      • customizeNode

        public final void customizeNode​(@Nullable
                                        IHCCustomizer aCustomizer,
                                        @Nonnull
                                        EHTMLVersion eHTMLVersion,
                                        @Nonnull
                                        IHCHasChildrenMutable<?,​? super IHCNode> aTargetNode)
        Description copied from interface: IHCNode
        Customize the current node with the respective customizer.
        This method is called at last once per IHCNode.
        Specified by:
        customizeNode in interface IHCNode
        Parameters:
        aCustomizer - The customizer to use. May be null.
        eHTMLVersion - The HTML version to be used. May not be null.
        aTargetNode - The target node where additional nodes should be added. May not be null.
      • onFinalizeNodeState

        @OverrideOnDemand
        @OverridingMethodsMustInvokeSuper
        protected void onFinalizeNodeState​(@Nonnull
                                           IHCConversionSettingsToNode aConversionSettings,
                                           @Nonnull
                                           IHCHasChildrenMutable<?,​? super IHCNode> aTargetNode)
        Finalize the node by applying any internal state that was not yet converted to a HC element. This method is called at maximum once per IHCNode. It is safe to still add classes, style or children to this node in this method.
        Parameters:
        aConversionSettings - HC conversion settings
        aTargetNode - The target node where additional nodes should be added
      • finalizeNodeState

        public final void finalizeNodeState​(@Nonnull
                                            IHCConversionSettingsToNode aConversionSettings,
                                            @Nonnull
                                            IHCHasChildrenMutable<?,​? super IHCNode> aTargetNode)
        Description copied from interface: IHCNode
        Finalize the node by applying any internal state that was not yet converted to a HC element.
        This method is called at last once per IHCNode.
        Specified by:
        finalizeNodeState in interface IHCNode
        Parameters:
        aConversionSettings - The current conversion settings to be used. May not be null.
        aTargetNode - The target node where additional nodes should be added. May not be null.
      • consistencyCheck

        public final void consistencyCheck​(@Nonnull
                                           IHCConversionSettingsToNode aConversionSettings)
        Description copied from interface: IHCNode
        Perform consistency checks on this node.
        This method is called at last once per IHCNode.
        Specified by:
        consistencyCheck in interface IHCNode
        Parameters:
        aConversionSettings - The current conversion settings to be used. May not be null.
      • canConvertToMicroNode

        @OverrideOnDemand
        public boolean canConvertToMicroNode​(@Nonnull
                                             IHCConversionSettingsToNode aConversionSettings)
        Description copied from interface: IHCNode
        This method checks whether the node is suitable for conversion to an IMicroNode. If this node cannot be converted, no child node will be converted as well!
        Specified by:
        canConvertToMicroNode in interface IHCNode
        Parameters:
        aConversionSettings - The conversion settings to be used
        Returns:
        true if the node can be converted to a node, false otherwise.
      • onRegisterExternalResources

        @OverrideOnDemand
        protected void onRegisterExternalResources​(@Nonnull
                                                   IHCConversionSettingsToNode aConversionSettings,
                                                   boolean bForcedRegistration)
        Parameters:
        aConversionSettings - HC conversion settings
        bForcedRegistration - true if the registration is forced by the caller.
      • registerExternalResources

        public final void registerExternalResources​(@Nonnull
                                                    IHCConversionSettingsToNode aConversionSettings,
                                                    boolean bForcedRegistration)
        Description copied from interface: IHCNode
        Register external JS and CSS resources required for this node, but only if this HC node can be converted to a micro node as determined by IHCNode.canConvertToMicroNode(IHCConversionSettingsToNode). Using the bForceRegistration parameter, this can be forced.
        This method is called at last once per IHCNode.
        Specified by:
        registerExternalResources in interface IHCNode
        Parameters:
        aConversionSettings - Conversion settings to be used. Never null.
        bForcedRegistration - true to force registration, false to register resources only if the node can be converted to a micro node.
      • convertToMicroNode

        @Nullable
        public final com.helger.xml.microdom.IMicroNode convertToMicroNode​(@Nonnull
                                                                           IHCConversionSettingsToNode aConversionSettings)
        Description copied from interface: IHCNode
        The main conversion to a micro node.
        Note: must be an IMicroNode since e.g. the text node returns an IMicroText.
        Specified by:
        convertToMicroNode in interface IHCNode
        Parameters:
        aConversionSettings - The conversion settings to be used. May not be null.
        Returns:
        The fully created HTML node
      • getPlainText

        @OverrideOnDemand
        @Nonnull
        public String getPlainText()
        Specified by:
        getPlainText in interface IHCNode
        Returns:
        The plain text representation of this text. May not be null.