Package com.helger.html.hc.html.root
Class HCHtml
- java.lang.Object
-
- com.helger.html.hc.impl.AbstractHCNode
-
- com.helger.html.hc.html.AbstractHCElement<HCHtml>
-
- com.helger.html.hc.html.root.HCHtml
-
- All Implemented Interfaces:
com.helger.commons.hierarchy.IHasChildren<IHCNode>,com.helger.commons.hierarchy.IHasChildrenRecursive<IHCNode>,com.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>,com.helger.commons.traits.IGenericImplTrait<HCHtml>,IHCElement<HCHtml>,IHCHasCSSClasses<HCHtml>,IHCHasCSSStyles<HCHtml>,IHCHasID<HCHtml>,IHCNode,Serializable
public class HCHtml extends AbstractHCElement<HCHtml>
The node that represents a full HTML document.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.helger.html.hc.html.AbstractHCElement
DEFAULT_HIDDEN, DEFAULT_SPELLCHECK, DEFAULT_TRANSLATE, DEFAULT_UNFOCUSABLE
-
Fields inherited from interface com.helger.html.hc.html.IHCElement
DEFAULT_TABINDEX
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAllOutOfBandNodesToHead(List<IHCNode> aAllOOBNodes)Add the passed OOB nodes to the head.HCBodybody()com.helger.commons.collection.impl.ICommonsList<? extends IHCNode>getAllChildren()com.helger.commons.collection.impl.ICommonsList<IHCNode>getAllOutOfBandNodesWithMergedInlineNodes()Extract all out-of-band (OOB) nodes from head and body.IHCNodegetChildAtIndex(int nIndex)intgetChildCount()com.helger.commons.collection.impl.ICommonsIterable<? extends IHCNode>getChildren()IHCNodegetFirstChild()IHCNodegetLastChild()StringgetPlainText()booleanhasChildren()HCHeadhead()protected com.helger.xml.microdom.IMicroDocumentinternalConvertToMicroNode(IHCConversionSettingsToNode aConversionSettings)voidmoveScriptElementsToBody()Move all JS nodes from the head to the body.StringtoString()-
Methods inherited from class com.helger.html.hc.html.AbstractHCElement
addClass, addEventHandler, addStyle, containsClass, containsEventHandler, containsStyle, createMicroElement, customAttrs, fillMicroElement, finishMicroElement, getAccessKey, getAllClasses, getAllClassesAsString, getAllClassNames, getAllStyles, getAllStylesAsString, getAllStyleValues, getContentEditable, getDirection, getDraggable, getElement, getEventHandler, getEventMap, getID, getLanguage, getRole, getStyleValue, getTabIndex, getTagName, getTitle, getTranslate, hasAnyClass, hasAnyStyle, hasStyle, isHidden, isSpellCheck, isTranslateOff, isTranslateOn, isTranslateUndefined, isUnfocusable, isValidID, onConsistencyCheck, onFinalizeNodeState, prependEventHandler, removeAllClasses, removeAllEventHandler, removeAllStyles, removeClass, removeStyle, setAccessKey, setContentEditable, setDirection, setDraggable, setEventHandler, setHidden, setID, setID, setLanguage, setRole, setSpellCheck, setTabIndex, setTitle, setTranslate, setUnfocusable
-
Methods inherited from class com.helger.html.hc.impl.AbstractHCNode
canConvertToMicroNode, consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, findFirstChild, findFirstChildMapped, forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getNodeState, internalSetNodeState, onCustomizeNode, onRegisterExternalResources, registerExternalResources
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildren
forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, hasNoChildren
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenRecursive
forAllChildrenRecursive, forAllChildrenRecursive
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenSorted
findFirstChild, findFirstChildMapped
-
Methods inherited from interface com.helger.html.hc.html.IHCElement
setTranslate, withCustomAttrs
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSClasses
addClasses, addClasses, addClasses
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSStyles
addStyle, addStyles, addStyles, addStyles
-
Methods inherited from interface com.helger.html.hc.IHCHasID
ensureID, hasID, hasNoID, setUniqueID
-
Methods inherited from interface com.helger.html.hc.IHCNode
canConvertToMicroNode, consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, getNodeState, registerExternalResources
-
-
-
-
Method Detail
-
getAllChildren
@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsList<? extends IHCNode> getAllChildren()
- Specified by:
getAllChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<IHCNode>- Specified by:
getAllChildrenin interfacecom.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>- Overrides:
getAllChildrenin classAbstractHCNode
-
getChildren
@Nonnull public final com.helger.commons.collection.impl.ICommonsIterable<? extends IHCNode> getChildren()
- Specified by:
getChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<IHCNode>- Overrides:
getChildrenin classAbstractHCNode
-
getChildAtIndex
@Nullable public final IHCNode getChildAtIndex(int nIndex)
- Specified by:
getChildAtIndexin interfacecom.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>- Overrides:
getChildAtIndexin classAbstractHCNode
-
getFirstChild
@Nonnull public final IHCNode getFirstChild()
- Specified by:
getFirstChildin interfacecom.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>- Overrides:
getFirstChildin classAbstractHCNode
-
getLastChild
@Nonnull public final IHCNode getLastChild()
- Specified by:
getLastChildin interfacecom.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>- Overrides:
getLastChildin classAbstractHCNode
-
hasChildren
public final boolean hasChildren()
- Specified by:
hasChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<IHCNode>- Overrides:
hasChildrenin classAbstractHCNode
-
getChildCount
public final int getChildCount()
- Specified by:
getChildCountin interfacecom.helger.commons.hierarchy.IHasChildren<IHCNode>- Overrides:
getChildCountin classAbstractHCNode
-
internalConvertToMicroNode
@Nonnull protected final com.helger.xml.microdom.IMicroDocument internalConvertToMicroNode(@Nonnull IHCConversionSettingsToNode aConversionSettings)
- Overrides:
internalConvertToMicroNodein classAbstractHCElement<HCHtml>
-
getAllOutOfBandNodesWithMergedInlineNodes
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<IHCNode> getAllOutOfBandNodesWithMergedInlineNodes()
Extract all out-of-band (OOB) nodes from head and body. Afterwards merge all inline CSS and JS nodes.- Returns:
- An ordered list of all OOB nodes in the correct order.
-
addAllOutOfBandNodesToHead
public void addAllOutOfBandNodesToHead(@Nonnull List<IHCNode> aAllOOBNodes)
Add the passed OOB nodes to the head.- Parameters:
aAllOOBNodes- The out-of-band node list. Usually retrieved fromgetAllOutOfBandNodesWithMergedInlineNodes(). May not benull.
-
moveScriptElementsToBody
public void moveScriptElementsToBody()
Move all JS nodes from the head to the body.
-
getPlainText
@Nonnull public String getPlainText()
- Specified by:
getPlainTextin interfaceIHCNode- Overrides:
getPlainTextin classAbstractHCNode- Returns:
- The plain text representation of this text. May not be
null.
-
toString
public String toString()
- Overrides:
toStringin classAbstractHCElement<HCHtml>
-
-