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
public class JsoupElementNode extends JsoupNode implements IElementNode
Implementation of theIElementNode
interface; wrapper for the JSoupJsoupNode
class.
-
-
Field Summary
Fields Modifier and Type Field Description private IAttributes
attributes
The attributes.private java.util.List<java.util.Map<java.lang.String,java.lang.String>>
customDefaultStyles
The custom default styles.private Element
element
The JSoup element.private java.util.Map<java.lang.String,java.lang.String>
elementResolvedStyles
The resolved styles.private java.lang.String
lang
The language.-
Fields inherited from class com.itextpdf.styledxmlparser.node.impl.jsoup.node.JsoupNode
parentNode
-
-
Constructor Summary
Constructors Constructor Description JsoupElementNode(Element element)
Creates a newJsoupElementNode
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAdditionalHtmlStyles(java.util.Map<java.lang.String,java.lang.String> styles)
Adds additional HTML styles.java.util.List<java.util.Map<java.lang.String,java.lang.String>>
getAdditionalHtmlStyles()
Gets additional styles, more specifically styles that affect an element based on its position in the HTML DOM, e.g.java.lang.String
getAttribute(java.lang.String key)
Gets an attribute.IAttributes
getAttributes()
Gets the attributes.java.lang.String
getLang()
Gets the language.java.util.Map<java.lang.String,java.lang.String>
getStyles()
Gets the styles.java.lang.String
name()
Gets the name of the element node.void
setStyles(java.util.Map<java.lang.String,java.lang.String> elementResolvedStyles)
Sets the styles.java.lang.String
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
-
-
-
-
Field Detail
-
element
private Element element
The JSoup element.
-
attributes
private IAttributes attributes
The attributes.
-
elementResolvedStyles
private java.util.Map<java.lang.String,java.lang.String> elementResolvedStyles
The resolved styles.
-
customDefaultStyles
private java.util.List<java.util.Map<java.lang.String,java.lang.String>> customDefaultStyles
The custom default styles.
-
lang
private java.lang.String lang
The language.
-
-
Constructor Detail
-
JsoupElementNode
public JsoupElementNode(Element element)
Creates a newJsoupElementNode
instance.- Parameters:
element
- the element
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from interface:IElementNode
Gets the name of the element node.- Specified by:
name
in interfaceIElementNode
- Returns:
- the string
-
getAttributes
public IAttributes getAttributes()
Description copied from interface:IElementNode
Gets the attributes.- Specified by:
getAttributes
in interfaceIElementNode
- Returns:
- the attributes
-
getAttribute
public java.lang.String getAttribute(java.lang.String key)
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
public void setStyles(java.util.Map<java.lang.String,java.lang.String> elementResolvedStyles)
Description copied from interface:IStylesContainer
Sets the styles.- Specified by:
setStyles
in interfaceIStylesContainer
- Parameters:
elementResolvedStyles
- aMap
with style keys and values.
-
getStyles
public java.util.Map<java.lang.String,java.lang.String> getStyles()
Description copied from interface:IStylesContainer
Gets the styles.- Specified by:
getStyles
in interfaceIStylesContainer
- Returns:
- the styles
-
getAdditionalHtmlStyles
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> 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
public void addAdditionalHtmlStyles(java.util.Map<java.lang.String,java.lang.String> styles)
Description copied from interface:IElementNode
Adds additional HTML styles.- Specified by:
addAdditionalHtmlStyles
in interfaceIElementNode
- Parameters:
styles
- the styles
-
getLang
public java.lang.String getLang()
Description copied from interface:IElementNode
Gets the language.- Specified by:
getLang
in interfaceIElementNode
- Returns:
- the language value
-
text
public java.lang.String text()
Returns the element text.- Returns:
- the text
-
-