Package io.wcm.handler.commons.dom
Class Anchor
java.lang.Object
org.jdom2.Content
org.jdom2.Element
- All Implemented Interfaces:
Serializable,Cloneable,org.jdom2.NamespaceAware,org.jdom2.Parent
Html anchor (a) element.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jdom2.Content
org.jdom2.Content.CType -
Field Summary
Fields inherited from class org.jdom2.Element
name, namespaceFields inherited from class org.jdom2.Content
ctype, parent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCssClass(String value) Html "class" attribute.Html "accesskey" attribute.getHRef()Html "href" attribute.getRel()Html "rel" attribute.intHtml "tabindex" attribute.Html "target" attribute.setAccessKey(String value) Html "accesskey" attribute.setAttributeValueAsLong(String name, long value) Sets attribute value as long.setCssClass(String value) Sets Html "class" attribute - unless you're really sure that you want to replace existing classes, you probably should callHtmlElement.addCssClass(String)instead.Custom Html5 "data-*" attribute.protected AnchorsetEmptyAttributeValueAsBoolean(String attributeName, boolean value) Sets "empty" attribute value as boolean (i.e. for "checked" attribute).Html "href" attribute.Html "id" attribute.Html "rel" attribute.Html "style" attribute.setStyleString(String value) Html "style" attribute.setTabIndex(int value) Html "tabindex" attribute.Html "target" attribute.Sets the content of the element to be the text given.Html "title" attribute.Methods inherited from class io.wcm.handler.commons.dom.HtmlElement
add, getCssClass, getData, getEmptyAttributeValueAsBoolean, getId, getStyle, getStyles, getStyleString, getTitleMethods 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, createVideoMethods inherited from class io.wcm.handler.commons.dom.AbstractElement
add, addContent, addContent, addContent, addContent, addContent, getAttributeValueAsInteger, getAttributeValueAsLong, setAttribute, setAttribute, setAttributeValueAsInteger, toString, toStringContentOnlyMethods 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, setName, setNamespace, sortAttributes, sortChildren, sortContent, sortContentMethods inherited from class org.jdom2.Content
equals, getCType, getDocument, getParent, getParentElement, hashCode, setParentMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jdom2.Parent
getDocument, getParent
-
Constructor Details
-
Anchor
public Anchor()Initializes html element. -
Anchor
Initializes html element.- Parameters:
href- Html "href" attribute.
-
Anchor
Initializes html element.- Parameters:
href- Html "href" attribute.target- Html "target" attribute.
-
-
Method Details
-
getRel
Html "rel" attribute.- Returns:
- Value of attribute
-
setRel
Html "rel" attribute.- Parameters:
value- Value of attribute- Returns:
- Self reference
-
getHRef
Html "href" attribute.- Returns:
- Value of attribute
-
setHRef
Html "href" attribute.- Parameters:
value- Value of attribute- Returns:
- Self reference
-
getTarget
Html "target" attribute.- Returns:
- Value of attribute
-
setTarget
Html "target" attribute.- Parameters:
value- Value of attribute- Returns:
- Self reference
-
getTabIndex
public int getTabIndex()Html "tabindex" attribute.- Returns:
- Value of attribute
-
setTabIndex
Html "tabindex" attribute.- Parameters:
value- Value of attribute- Returns:
- Self reference
-
getAccessKey
Html "accesskey" attribute.- Returns:
- Value of attribute
-
setAccessKey
Html "accesskey" attribute.- Parameters:
value- Value of attribute- Returns:
- Self reference
-
setEmptyAttributeValueAsBoolean
Description copied from class:HtmlElementSets "empty" attribute value as boolean (i.e. for "checked" attribute).- Overrides:
setEmptyAttributeValueAsBooleanin classHtmlElement- Parameters:
attributeName- Attribute namevalue- Attribute value as boolean- Returns:
- Self reference
-
setId
Description copied from class:HtmlElementHtml "id" attribute.- Overrides:
setIdin classHtmlElement- Parameters:
value- Value of attribute- Returns:
- Self reference
-
setCssClass
Description copied from class:HtmlElementSets Html "class" attribute - unless you're really sure that you want to replace existing classes, you probably should callHtmlElement.addCssClass(String)instead.- Overrides:
setCssClassin classHtmlElement- Parameters:
value- Value of attribute- Returns:
- Self reference
-
addCssClass
Description copied from class:HtmlElementHtml "class" attribute. Adds a single, space-separated value while preserving existing ones.- Overrides:
addCssClassin classHtmlElement- Parameters:
value- Value of attribute- Returns:
- Self reference
-
setStyleString
Description copied from class:HtmlElementHtml "style" attribute.- Overrides:
setStyleStringin classHtmlElement- Parameters:
value- Value of attribute with style key/value pairs- Returns:
- Self reference
-
setStyle
Description copied from class:HtmlElementHtml "style" attribute. Sets single style attribute value.- Overrides:
setStylein classHtmlElement- Parameters:
styleAttribute- Style attribute namestyleValue- Style attribute value- Returns:
- Self reference
-
setTitle
Description copied from class:HtmlElementHtml "title" attribute.- Overrides:
setTitlein classHtmlElement- Parameters:
value- Value of attribute- Returns:
- Self reference
-
setData
Description copied from class:HtmlElementCustom Html5 "data-*" attribute.- Overrides:
setDatain classHtmlElement- Parameters:
attributeName- Name of HTML5 data attribute (without the 'data-' prefix).value- Value of attribute- Returns:
- Self reference
-
setAttributeValueAsLong
Description copied from class:AbstractElementSets attribute value as long.- Overrides:
setAttributeValueAsLongin classAbstractElement- Parameters:
name- Attribute namevalue- Attribute value as long- Returns:
- Self reference
-
setText
Description copied from class:AbstractElementSets 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.Element.setContent(java.util.Collection<? extends org.jdom2.Content>)- Overrides:
setTextin classAbstractElement- Parameters:
text- new text content for the element- Returns:
- the target element
-