Class JsoupElementNode
java.lang.Object
com.itextpdf.styledxmlparser.node.impl.jsoup.node.JsoupNode
com.itextpdf.styledxmlparser.node.impl.jsoup.node.JsoupElementNode
- All Implemented Interfaces:
-
IElementNode
,INode
,IStylesContainer
- Direct Known Subclasses:
-
JsoupDocumentNode
Implementation of the
IElementNode
interface; wrapper for the JSoup JsoupNode
class.
-
Constructor Summary
ConstructorDescriptionJsoupElementNode
(com.itextpdf.styledxmlparser.jsoup.nodes.Element element) Creates a newJsoupElementNode
instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAdditionalHtmlStyles
(Map<String, String> styles) Adds additional HTML styles.Gets additional styles, more specifically styles that affect an element based on its position in the HTML DOM, e.g.getAttribute
(String key) Gets an attribute.Gets the attributes.getLang()
Gets the language.Gets the styles.name()
Gets the name of the element node.void
Sets the styles.text()
Returns the element text.Methods inherited from class com.itextpdf.styledxmlparser.node.impl.jsoup.node.JsoupNode
addChild, childNodes, parentNode
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.itextpdf.styledxmlparser.node.INode
addChild, childNodes, parentNode
-
Constructor Details
-
JsoupElementNode
public JsoupElementNode(com.itextpdf.styledxmlparser.jsoup.nodes.Element element) Creates a newJsoupElementNode
instance.- Parameters:
-
element
- the element
-
-
Method Details
-
name
Description copied from interface:IElementNode
Gets the name of the element node.- Specified by:
-
name
in interfaceIElementNode
- Returns:
- the string
-
getAttributes
Description copied from interface:IElementNode
Gets the attributes.- Specified by:
-
getAttributes
in interfaceIElementNode
- Returns:
- the attributes
-
getAttribute
Description copied from interface:IElementNode
Gets an attribute.- Specified by:
-
getAttribute
in interfaceIElementNode
- Parameters:
-
key
- the key of the attribute we want to get - Returns:
- the value of the attribute
-
setStyles
Description copied from interface:IStylesContainer
Sets the styles.- Specified by:
-
setStyles
in interfaceIStylesContainer
- Parameters:
-
elementResolvedStyles
- aMap
with style keys and values.
-
getStyles
Description copied from interface:IStylesContainer
Gets the styles.- Specified by:
-
getStyles
in interfaceIStylesContainer
- Returns:
- the styles
-
getAdditionalHtmlStyles
Description copied from interface:IElementNode
Gets additional styles, more specifically styles that affect an element based on its position in the HTML DOM, e.g. cell borders that are set due to the parent table "border" attribute, or styles from "col" tags that affect table elements, or blocks horizontal alignment that is the result of parent's "align" attribute.- Specified by:
-
getAdditionalHtmlStyles
in interfaceIElementNode
- Returns:
- the additional html styles
-
addAdditionalHtmlStyles
Description copied from interface:IElementNode
Adds additional HTML styles.- Specified by:
-
addAdditionalHtmlStyles
in interfaceIElementNode
- Parameters:
-
styles
- the styles
-
getLang
Description copied from interface:IElementNode
Gets the language.- Specified by:
-
getLang
in interfaceIElementNode
- Returns:
- the language value
-
text
Returns the element text.- Returns:
- the text
-