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 the IElementNode interface; wrapper for the JSoup JsoupNode class.
  • Constructor Details

    • JsoupElementNode

      public JsoupElementNode (com.itextpdf.styledxmlparser.jsoup.nodes.Element element)
      Creates a new JsoupElementNode instance.
      Parameters:
      element - the element
  • Method Details

    • name

      public String name()
      Description copied from interface: IElementNode
      Gets the name of the element node.
      Specified by:
      name in interface IElementNode
      Returns:
      the string
    • getAttributes

      public IAttributes getAttributes()
      Description copied from interface: IElementNode
      Gets the attributes.
      Specified by:
      getAttributes in interface IElementNode
      Returns:
      the attributes
    • getAttribute

      public String getAttribute (String key)
      Description copied from interface: IElementNode
      Gets an attribute.
      Specified by:
      getAttribute in interface IElementNode
      Parameters:
      key - the key of the attribute we want to get
      Returns:
      the value of the attribute
    • setStyles

      public void setStyles (Map<String,String> elementResolvedStyles)
      Description copied from interface: IStylesContainer
      Sets the styles.
      Specified by:
      setStyles in interface IStylesContainer
      Parameters:
      elementResolvedStyles - a Map with style keys and values.
    • getStyles

      public Map<String,String> getStyles()
      Description copied from interface: IStylesContainer
      Gets the styles.
      Specified by:
      getStyles in interface IStylesContainer
      Returns:
      the styles
    • getAdditionalHtmlStyles

      public List<Map<String,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 interface IElementNode
      Returns:
      the additional html styles
    • addAdditionalHtmlStyles

      public void addAdditionalHtmlStyles (Map<String,String> styles)
      Description copied from interface: IElementNode
      Adds additional HTML styles.
      Specified by:
      addAdditionalHtmlStyles in interface IElementNode
      Parameters:
      styles - the styles
    • getLang

      public String getLang()
      Description copied from interface: IElementNode
      Gets the language.
      Specified by:
      getLang in interface IElementNode
      Returns:
      the language value
    • text

      public String text()
      Returns the element text.
      Returns:
      the text