Package com.helger.html.hc.html.metadata
Class HCHead
- java.lang.Object
-
- com.helger.html.hc.impl.AbstractHCNode
-
- com.helger.html.hc.html.AbstractHCElement<HCHead>
-
- com.helger.html.hc.html.metadata.HCHead
-
- 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<HCHead>,IHCElement<HCHead>,IHCHasCSSClasses<HCHead>,IHCHasCSSStyles<HCHead>,IHCHasID<HCHead>,IHCNode,Serializable
public class HCHead extends AbstractHCElement<HCHead>
Represents an HTML <head> element- 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
-
-
Constructor Summary
Constructors Constructor Description HCHead()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HCHeadaddCSS(IHCNode aCSS)HCHeadaddCSSAt(int nIndex, IHCNode aCSS)Add a CSS node at the specified index.HCHeadaddJS(IHCNode aJS)Append some JavaScript codeHCHeadaddJSAt(int nIndex, IHCNode aJS)Append some JavaScript code at the specified indexcom.helger.commons.collection.impl.ICommonsList<IHCNode>cssNodes()protected voidemitCSS(com.helger.xml.microdom.IMicroElement eHead, IHCConversionSettingsToNode aConversionSettings)protected voidemitJS(com.helger.xml.microdom.IMicroElement eHead, IHCConversionSettingsToNode aConversionSettings)protected voidemitLinks(com.helger.xml.microdom.IMicroElement eHead, IHCConversionSettingsToNode aConversionSettings)protected voidfillMicroElement(com.helger.xml.microdom.IMicroElement eHead, IHCConversionSettingsToNode aConversionSettings)Set all attributes and child elements of this objectvoidgetAllAndRemoveAllCSSNodes(List<IHCNode> aTargetList)voidgetAllAndRemoveAllJSNodes(List<IHCNode> aTargetList)com.helger.commons.collection.impl.ICommonsList<IHCNode>getAllChildren()com.helger.commons.collection.impl.ICommonsList<IHCNode>getAllCSSNodes()com.helger.commons.collection.impl.ICommonsList<IHCNode>getAllJSNodes()com.helger.commons.url.ISimpleURLgetBaseHref()HC_TargetgetBaseTarget()IHCNodegetChildAtIndex(int nIndex)intgetChildCount()com.helger.commons.collection.impl.ICommonsIterable<IHCNode>getChildren()intgetCSSCount()com.helger.commons.collection.impl.ICommonsIterable<IHCNode>getCSSNodes()IHCNodegetFirstChild()intgetJSCount()com.helger.commons.collection.impl.ICommonsIterable<IHCNode>getJSNodes()IHCNodegetLastChild()StringgetPageTitle()StringgetPlainText()StringgetProfile()booleanhasChildren()com.helger.commons.collection.impl.ICommonsList<IHCNode>jsNodes()com.helger.commons.collection.impl.ICommonsList<HCLink>links()com.helger.commons.collection.impl.ICommonsList<HCMeta>metaElements()HCHeadremoveAllCSS()HCHeadremoveAllJS()com.helger.commons.state.EChangeremoveMetaElement(String sName)HCHeadsetBaseHref(com.helger.commons.url.ISimpleURL aBaseHref)HCHeadsetBaseTarget(HC_Target aTarget)HCHeadsetPageTitle(String sPageTitle)HCHeadsetProfile(String sProfile)HCHeadsetShortcutIconHref(com.helger.commons.url.ISimpleURL aShortcutIconHref)StringtoString()-
Methods inherited from class com.helger.html.hc.html.AbstractHCElement
addClass, addEventHandler, addStyle, containsClass, containsEventHandler, containsStyle, createMicroElement, customAttrs, 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, internalConvertToMicroNode, 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
-
getBaseHref
@Nullable public final com.helger.commons.url.ISimpleURL getBaseHref()
-
setBaseHref
@Nonnull public final HCHead setBaseHref(@Nullable com.helger.commons.url.ISimpleURL aBaseHref)
-
metaElements
@Nonnull @ReturnsMutableObject public final com.helger.commons.collection.impl.ICommonsList<HCMeta> metaElements()
- Returns:
- meta element list. Never
null.
-
removeMetaElement
@Nonnull public final com.helger.commons.state.EChange removeMetaElement(@Nullable String sName)
-
links
@Nonnull @ReturnsMutableObject public final com.helger.commons.collection.impl.ICommonsList<HCLink> links()
- Returns:
- linkmeta element list. Never
null.
-
setShortcutIconHref
@Nonnull public final HCHead setShortcutIconHref(@Nullable com.helger.commons.url.ISimpleURL aShortcutIconHref)
-
addCSSAt
@Nonnull public final HCHead addCSSAt(@Nonnegative int nIndex, @Nonnull IHCNode aCSS)
Add a CSS node at the specified index.- Parameters:
nIndex- The index to add. Should be ≥ 0.aCSS- The CSS node to be added. May not benull.- Returns:
- this for chaining
-
getCSSCount
@Nonnegative public final int getCSSCount()
-
cssNodes
@Nonnull @ReturnsMutableObject public final com.helger.commons.collection.impl.ICommonsList<IHCNode> cssNodes()
-
getCSSNodes
@Nonnull @ReturnsImmutableObject public final com.helger.commons.collection.impl.ICommonsIterable<IHCNode> getCSSNodes()
-
getAllCSSNodes
@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsList<IHCNode> getAllCSSNodes()
-
getAllAndRemoveAllCSSNodes
public final void getAllAndRemoveAllCSSNodes(@Nonnull List<IHCNode> aTargetList)
-
addJS
@Nonnull public final HCHead addJS(@Nonnull IHCNode aJS)
Append some JavaScript code- Parameters:
aJS- The JS to be added. May not benull.- Returns:
- this
-
addJSAt
@Nonnull public final HCHead addJSAt(@Nonnegative int nIndex, @Nonnull IHCNode aJS)
Append some JavaScript code at the specified index- Parameters:
nIndex- The index where the JS should be added (counting only JS elements)aJS- The JS to be added. May not benull.- Returns:
- this
-
getJSCount
@Nonnegative public final int getJSCount()
- Returns:
- The number of contained JS elements
-
jsNodes
@Nonnull @ReturnsMutableObject public final com.helger.commons.collection.impl.ICommonsList<IHCNode> jsNodes()
-
getJSNodes
@Nonnull @ReturnsImmutableObject public final com.helger.commons.collection.impl.ICommonsIterable<IHCNode> getJSNodes()
-
getAllJSNodes
@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsList<IHCNode> getAllJSNodes()
-
getAllAndRemoveAllJSNodes
public final void getAllAndRemoveAllJSNodes(@Nonnull List<IHCNode> aTargetList)
-
emitLinks
@OverrideOnDemand protected void emitLinks(@Nonnull com.helger.xml.microdom.IMicroElement eHead, @Nonnull IHCConversionSettingsToNode aConversionSettings)
-
emitCSS
@OverrideOnDemand protected void emitCSS(@Nonnull com.helger.xml.microdom.IMicroElement eHead, @Nonnull IHCConversionSettingsToNode aConversionSettings)
-
emitJS
@OverrideOnDemand protected void emitJS(@Nonnull com.helger.xml.microdom.IMicroElement eHead, @Nonnull IHCConversionSettingsToNode aConversionSettings)
-
fillMicroElement
protected void fillMicroElement(@Nonnull com.helger.xml.microdom.IMicroElement eHead, @Nonnull IHCConversionSettingsToNode aConversionSettings)
Description copied from class:AbstractHCElementSet all attributes and child elements of this object- Overrides:
fillMicroElementin classAbstractHCElement<HCHead>- Parameters:
eHead- The current micro element to be filled. Nevernull.aConversionSettings- The conversion settings to be used. Nevernull.
-
getPlainText
@Nonnull public String getPlainText()
- Specified by:
getPlainTextin interfaceIHCNode- Overrides:
getPlainTextin classAbstractHCNode- Returns:
- The plain text representation of this text. May not be
null.
-
getAllChildren
@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsList<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<IHCNode> getChildren()
- Specified by:
getChildrenin interfacecom.helger.commons.hierarchy.IHasChildren<IHCNode>- Overrides:
getChildrenin classAbstractHCNode
-
getChildAtIndex
@Nullable public final IHCNode getChildAtIndex(@Nonnegative int nIndex)
- Specified by:
getChildAtIndexin interfacecom.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>- Overrides:
getChildAtIndexin classAbstractHCNode
-
getFirstChild
@Nullable public final IHCNode getFirstChild()
- Specified by:
getFirstChildin interfacecom.helger.commons.hierarchy.IHasChildrenSorted<IHCNode>- Overrides:
getFirstChildin classAbstractHCNode
-
getLastChild
@Nullable 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
-
toString
public String toString()
- Overrides:
toStringin classAbstractHCElement<HCHead>
-
-