Class FormattingUtils


  • public class FormattingUtils
    extends java.lang.Object
    • Method Detail

      • ensureFormattingState

        public static void ensureFormattingState​(XHTMLContentHandler xhtml,
                                                 java.util.EnumSet<FormattingUtils.Tag> desired,
                                                 java.util.Deque<FormattingUtils.Tag> currentState)
                                          throws org.xml.sax.SAXException
        Closes all tags until currentState contains only tags from desired set, then open all required tags to reach desired state.
        Parameters:
        xhtml - handler
        desired - desired formatting state
        currentState - current formatting state (stack of open formatting tags)
        Throws:
        org.xml.sax.SAXException - pass underlying handler exception
      • closeStyleTags

        public static void closeStyleTags​(XHTMLContentHandler xhtml,
                                          java.util.Deque<FormattingUtils.Tag> formattingState)
                                   throws org.xml.sax.SAXException
        Closes all formatting tags.
        Parameters:
        xhtml - handler
        formattingState - current formatting state (stack of open formatting tags)
        Throws:
        org.xml.sax.SAXException - pass underlying handler exception