Package io.wcm.handler.commons.dom
Class Script
- java.lang.Object
-
- org.jdom2.Content
-
- org.jdom2.Element
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,org.jdom2.NamespaceAware,org.jdom2.Parent
@ProviderType public final class Script extends AbstractNonSelfClosingHtmlElement<Script>
Html script element. This script block is initialized by default for "text/javascript" type.Script blocks are generated in a special XHTML conformant way, to work around some browser XHTML JavaScript problems:
<script type="text/javascript"> //<![CDATA[ script... //]]> </script>
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringTYPE_JAVASCRIPTType "text/javascript".
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetSrc()Html "src" attribute.java.lang.StringgetType()Html "type" attribute.ScriptsetSrc(java.lang.String value)Html "src" attribute.org.jdom2.ElementsetText(java.lang.String script)Sets the content of the element to be the text given.ScriptsetType(java.lang.String value)Html "type" attribute.-
Methods inherited from class io.wcm.handler.commons.dom.HtmlElement
add, addCssClass, getCssClass, getData, getEmptyAttributeValueAsBoolean, getId, getStyle, getStyles, getStyleString, getTitle, setCssClass, setData, setEmptyAttributeValueAsBoolean, setId, setStyle, setStyleString, setTitle
-
Methods inherited from class io.wcm.handler.commons.dom.AbstractHtmlElementFactory
create, createAnchor, createAnchor, createAnchor, createAudio, createComment, createDiv, createFigCaption, createFigure, createImage, createImage, createImage, createImage, createImage, createNoScript, createScript, createScript, createSource, createSpan, createSpan, createVideo
-
Methods inherited from class io.wcm.handler.commons.dom.AbstractElement
add, addContent, addContent, addContent, addContent, addContent, getAttributeValueAsInteger, getAttributeValueAsLong, setAttribute, setAttribute, setAttributeValueAsInteger, setAttributeValueAsLong, setName, toString, toStringContentOnly
-
Methods inherited from class org.jdom2.Element
addNamespaceDeclaration, canContainContent, clone, cloneContent, coalesceText, detach, getAdditionalNamespaces, getAttribute, getAttribute, getAttributes, getAttributesSize, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValue, getChild, getChild, getChildren, getChildren, getChildren, getChildText, getChildText, getChildTextNormalize, getChildTextNormalize, getChildTextTrim, getChildTextTrim, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getName, getNamespace, getNamespace, getNamespacePrefix, getNamespacesInherited, getNamespacesInScope, getNamespacesIntroduced, getNamespaceURI, getQualifiedName, getText, getTextNormalize, getTextTrim, getValue, getXMLBaseURI, hasAdditionalNamespaces, hasAttributes, indexOf, isAncestor, isRootElement, removeAttribute, removeAttribute, removeAttribute, removeChild, removeChild, removeChildren, removeChildren, removeContent, removeContent, removeContent, removeContent, removeNamespaceDeclaration, setAttribute, setAttributes, setContent, setContent, setContent, setContent, setNamespace, sortAttributes, sortChildren, sortContent, sortContent
-
Methods inherited from class org.jdom2.Content
equals, getCType, getDocument, getParent, getParentElement, hashCode, setParent
-
-
-
-
Field Detail
-
TYPE_JAVASCRIPT
public static final java.lang.String TYPE_JAVASCRIPT
Type "text/javascript".- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
public java.lang.String getType()
Html "type" attribute.- Returns:
- Value of attribute
-
setType
public Script setType(java.lang.String value)
Html "type" attribute.- Parameters:
value- Value of attribute- Returns:
- Self reference
-
getSrc
public java.lang.String getSrc()
Html "src" attribute.- Returns:
- Value of attribute
-
setSrc
public Script setSrc(java.lang.String value)
Html "src" attribute.- Parameters:
value- Value of attribute- Returns:
- Self reference
-
setText
public org.jdom2.Element setText(java.lang.String script)
Sets the content of the element to be the text given. All existing text content and non-text context is removed. If this element should have both textual content and nested elements, useinstead. Setting a null text value is equivalent to setting an empty string value. Overrides standard setText method to add special xHTML conformant CDATA block as workaround for browsers that does not interpret XHTML-encoded script blocks correctly.Element.setContent(java.util.Collection<? extends org.jdom2.Content>)- Overrides:
setTextin classAbstractElement<Script>- Parameters:
script- new text content for the element- Returns:
- the target element
-
-