Package com.helger.html.hc.html.script
Class AbstractHCScriptInline<IMPLTYPE extends AbstractHCScriptInline<IMPLTYPE>>
- java.lang.Object
-
- com.helger.html.hc.impl.AbstractHCNode
-
- com.helger.html.hc.html.AbstractHCElement<IMPLTYPE>
-
- com.helger.html.hc.html.script.AbstractHCScript<IMPLTYPE>
-
- com.helger.html.hc.html.script.AbstractHCScriptInline<IMPLTYPE>
-
- Type Parameters:
IMPLTYPE- Implementation type
- 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<IMPLTYPE>,IHCElement<IMPLTYPE>,IHCHasCSSClasses<IMPLTYPE>,IHCHasCSSStyles<IMPLTYPE>,IHCScript<IMPLTYPE>,IHCScriptInline<IMPLTYPE>,IHCHasID<IMPLTYPE>,IHCNode,Serializable
- Direct Known Subclasses:
HCScriptInline,HCScriptInlineOnDocumentReady
public abstract class AbstractHCScriptInline<IMPLTYPE extends AbstractHCScriptInline<IMPLTYPE>> extends AbstractHCScript<IMPLTYPE> implements IHCScriptInline<IMPLTYPE>
This class represents an HTML <script> element with inline JS content.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEFAULT_EMIT_AFTER_FILESBy default place inline JS after script files-
Fields inherited from class com.helger.html.hc.html.script.AbstractHCScript
DEFAULT_TYPE
-
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 Modifier Constructor Description protectedAbstractHCScriptInline()protectedAbstractHCScriptInline(IHasJSCode aProvider)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanConvertToMicroNode(IHCConversionSettingsToNode aConversionSettings)This method checks whether the node is suitable for conversion to anIMicroNode.protected voidfillMicroElement(com.helger.xml.microdom.IMicroElement aElement, IHCConversionSettingsToNode aConversionSettings)Set all attributes and child elements of this objectStringgetJSCode(IJSWriterSettings aSettings)IHasJSCodegetJSCodeProvider()EHCScriptInlineModegetMode()booleanisEmitAfterFiles()IMPLTYPEsetEmitAfterFiles(boolean bEmitAfterFiles)static voidsetInlineScript(com.helger.xml.microdom.IMicroNodeWithChildren aElement, String sContent, EHCScriptInlineMode eMode, String sLineSeparator)IMPLTYPEsetJSCodeProvider(IHasJSCode aProvider)IMPLTYPEsetMode(EHCScriptInlineMode eMode)Set the masking mode.StringtoString()-
Methods inherited from class com.helger.html.hc.html.script.AbstractHCScript
getCharset, getCrossOrigin, getIntegrity, getType, setCharset, setCrossOrigin, setIntegrity, setType
-
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
consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, findFirstChild, findFirstChildMapped, forAllChildren, forAllChildren, forAllChildrenBreakable, forAllChildrenMapped, getAllChildren, getChildAtIndex, getChildCount, getChildren, getFirstChild, getLastChild, getNodeState, getPlainText, hasChildren, 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, getChildCount, getChildren, hasChildren, hasNoChildren
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenRecursive
forAllChildrenRecursive, forAllChildrenRecursive
-
Methods inherited from interface com.helger.commons.hierarchy.IHasChildrenSorted
findFirstChild, findFirstChildMapped, getAllChildren, getChildAtIndex, getFirstChild, getLastChild
-
Methods inherited from interface com.helger.html.hc.html.IHCElement
addEventHandler, containsEventHandler, customAttrs, getAccessKey, getContentEditable, getDirection, getDraggable, getElement, getEventHandler, getEventMap, getLanguage, getRole, getTabIndex, getTagName, getTitle, getTranslate, isHidden, isSpellCheck, isTranslateOff, isTranslateOn, isTranslateUndefined, isUnfocusable, prependEventHandler, removeAllEventHandler, setAccessKey, setContentEditable, setDirection, setDraggable, setEventHandler, setHidden, setLanguage, setRole, setSpellCheck, setTabIndex, setTitle, setTranslate, setTranslate, setUnfocusable, withCustomAttrs
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSClasses
addClass, addClasses, addClasses, addClasses, containsClass, getAllClasses, getAllClassesAsString, getAllClassNames, hasAnyClass, removeAllClasses, removeClass
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSStyles
addStyle, addStyle, addStyles, addStyles, addStyles, containsStyle, getAllStyles, getAllStylesAsString, getAllStyleValues, getStyleValue, hasAnyStyle, hasStyle, removeAllStyles, removeStyle
-
Methods inherited from interface com.helger.html.hc.IHCHasID
ensureID, getID, hasID, hasNoID, setID, setUniqueID
-
Methods inherited from interface com.helger.html.hc.IHCNode
consistencyCheck, convertToMicroNode, customizeNode, finalizeNodeState, getNodeState, getPlainText, registerExternalResources
-
Methods inherited from interface com.helger.html.hc.html.script.IHCScript
getCharset, getCrossOrigin, getIntegrity, getType, setCharset, setCharset, setCrossOrigin, setIntegrity, setType
-
-
-
-
Field Detail
-
DEFAULT_EMIT_AFTER_FILES
public static final boolean DEFAULT_EMIT_AFTER_FILES
By default place inline JS after script files- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AbstractHCScriptInline
protected AbstractHCScriptInline()
-
AbstractHCScriptInline
protected AbstractHCScriptInline(@Nonnull IHasJSCode aProvider)
-
-
Method Detail
-
getJSCodeProvider
@Nonnull public final IHasJSCode getJSCodeProvider()
- Specified by:
getJSCodeProviderin interfaceIHCScriptInline<IMPLTYPE extends AbstractHCScriptInline<IMPLTYPE>>- Returns:
- The JS code passed in the constructor. Never
null.
-
setJSCodeProvider
@Nonnull public final IMPLTYPE setJSCodeProvider(@Nonnull IHasJSCode aProvider)
- Specified by:
setJSCodeProviderin interfaceIHCScriptInline<IMPLTYPE extends AbstractHCScriptInline<IMPLTYPE>>
-
getJSCode
@Nullable public final String getJSCode(@Nonnull IJSWriterSettings aSettings)
- Specified by:
getJSCodein interfaceIHCScriptInline<IMPLTYPE extends AbstractHCScriptInline<IMPLTYPE>>- Parameters:
aSettings- The settings to be used. May benullto use the default.- Returns:
- The text representation of the JS code passed in the constructor.
May be
null.
-
getMode
@Nonnull public final EHCScriptInlineMode getMode()
- Specified by:
getModein interfaceIHCScriptInline<IMPLTYPE extends AbstractHCScriptInline<IMPLTYPE>>- Returns:
- The masking mode. Never
null.
-
setMode
@Nonnull public final IMPLTYPE setMode(@Nonnull EHCScriptInlineMode eMode)
Set the masking mode.- Specified by:
setModein interfaceIHCScriptInline<IMPLTYPE extends AbstractHCScriptInline<IMPLTYPE>>- Parameters:
eMode- The mode to use. MAy not benull.- Returns:
- this
-
isEmitAfterFiles
public final boolean isEmitAfterFiles()
- Specified by:
isEmitAfterFilesin interfaceIHCScriptInline<IMPLTYPE extends AbstractHCScriptInline<IMPLTYPE>>
-
setEmitAfterFiles
@Nonnull public final IMPLTYPE setEmitAfterFiles(boolean bEmitAfterFiles)
- Specified by:
setEmitAfterFilesin interfaceIHCScriptInline<IMPLTYPE extends AbstractHCScriptInline<IMPLTYPE>>
-
setInlineScript
public static void setInlineScript(@Nonnull com.helger.xml.microdom.IMicroNodeWithChildren aElement, @Nullable String sContent, @Nonnull EHCScriptInlineMode eMode, @Nonnull String sLineSeparator)
-
canConvertToMicroNode
public boolean canConvertToMicroNode(@Nonnull IHCConversionSettingsToNode aConversionSettings)
Description copied from interface:IHCNodeThis method checks whether the node is suitable for conversion to anIMicroNode. If this node cannot be converted, no child node will be converted as well!- Specified by:
canConvertToMicroNodein interfaceIHCNode- Overrides:
canConvertToMicroNodein classAbstractHCNode- Parameters:
aConversionSettings- The conversion settings to be used- Returns:
trueif the node can be converted to a node,falseotherwise.
-
fillMicroElement
protected void fillMicroElement(com.helger.xml.microdom.IMicroElement aElement, IHCConversionSettingsToNode aConversionSettings)Description copied from class:AbstractHCElementSet all attributes and child elements of this object- Overrides:
fillMicroElementin classAbstractHCScript<IMPLTYPE extends AbstractHCScriptInline<IMPLTYPE>>- Parameters:
aElement- The current micro element to be filled. Nevernull.aConversionSettings- The conversion settings to be used. Nevernull.
-
toString
public String toString()
- Overrides:
toStringin classAbstractHCScript<IMPLTYPE extends AbstractHCScriptInline<IMPLTYPE>>
-
-