Package org.apache.tika.parser.microsoft
Class FormattingUtils
- java.lang.Object
-
- org.apache.tika.parser.microsoft.FormattingUtils
-
public class FormattingUtils extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FormattingUtils.Tag
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
closeStyleTags(XHTMLContentHandler xhtml, java.util.Deque<FormattingUtils.Tag> formattingState)
Closes all formatting tags.static void
ensureFormattingState(XHTMLContentHandler xhtml, java.util.EnumSet<FormattingUtils.Tag> desired, java.util.Deque<FormattingUtils.Tag> currentState)
Closes all tags untilcurrentState
contains only tags fromdesired
set, then open all required tags to reach desired state.static java.util.EnumSet<FormattingUtils.Tag>
toTags(CharacterRun run)
-
-
-
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 untilcurrentState
contains only tags fromdesired
set, then open all required tags to reach desired state.- Parameters:
xhtml
- handlerdesired
- desired formatting statecurrentState
- 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
- handlerformattingState
- current formatting state (stack of open formatting tags)- Throws:
org.xml.sax.SAXException
- pass underlying handler exception
-
toTags
public static java.util.EnumSet<FormattingUtils.Tag> toTags(CharacterRun run)
-
-