Class PTagWorker

java.lang.Object
com.itextpdf.html2pdf.attach.impl.tags.PTagWorker
All Implemented Interfaces:
IDisplayAware, ITagWorker

public class PTagWorker extends Object implements ITagWorker, IDisplayAware
TagWorker class for the p element.

This is how this worker processes the

tag:

  • if the worker meets a text or an inline element, it processes them with a help of the WaitingInlineElementsHelper instance
  • if the worker meets a block element without inline displaying or an inline element with the display: block style, it wraps all the content which hasn't been handled yet into a com.itextpdf.layout.element.Paragraph object and adds this paragraph to the resultant com.itextpdf.layout.element.Div object
  • Field Details

    • multicolContainer

      protected com.itextpdf.layout.element.MulticolContainer multicolContainer
      Container for the result in case of multicol layouting
  • Constructor Details

    • PTagWorker

      public PTagWorker (com.itextpdf.styledxmlparser.node.IElementNode element, ProcessorContext context)
      Creates a new PTagWorker instance.
      Parameters:
      element - the element
      context - the context
  • Method Details

    • processEnd

      public void processEnd (com.itextpdf.styledxmlparser.node.IElementNode element, ProcessorContext context)
      Description copied from interface: ITagWorker
      Placeholder for what needs to be done after the content of a tag has been processed.
      Specified by:
      processEnd in interface ITagWorker
      Parameters:
      element - the element node
      context - the processor context
    • processContent

      public boolean processContent (String content, ProcessorContext context)
      Description copied from interface: ITagWorker
      Placeholder for what needs to be done while the content of a tag is being processed.
      Specified by:
      processContent in interface ITagWorker
      Parameters:
      content - the content of a node
      context - the processor context
      Returns:
      true, if content was successfully processed, otherwise false.
    • processTagChild

      public boolean processTagChild (ITagWorker childTagWorker, ProcessorContext context)
      Description copied from interface: ITagWorker
      Placeholder for what needs to be done when a child node is being processed.
      Specified by:
      processTagChild in interface ITagWorker
      Parameters:
      childTagWorker - the tag worker of the child node
      context - the processor context
      Returns:
      true, if child was successfully processed, otherwise false.
    • getElementResult

      public com.itextpdf.layout.IPropertyContainer getElementResult()
      Description copied from interface: ITagWorker
      Gets a processed object if it can be expressed as an IPropertyContainer instance.
      Specified by:
      getElementResult in interface ITagWorker
      Returns:
      the same object on every call. Might return null either if result is not yet produced or if this particular tag worker doesn't produce result in a form of IPropertyContainer.
    • getDisplay

      public String getDisplay()
      Description copied from interface: IDisplayAware
      Gets the display value.
      Specified by:
      getDisplay in interface IDisplayAware
      Returns:
      the display value