Package org.apache.tika.parser.microsoft
Class FormattingUtils
java.lang.Object
org.apache.tika.parser.microsoft.FormattingUtils
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
closeStyleTags
(XHTMLContentHandler xhtml, Deque<FormattingUtils.Tag> formattingState) Closes all formatting tags.static void
ensureFormattingState
(XHTMLContentHandler xhtml, EnumSet<FormattingUtils.Tag> desired, Deque<FormattingUtils.Tag> currentState) Closes all tags untilcurrentState
contains only tags fromdesired
set, then open all required tags to reach desired state.static EnumSet<FormattingUtils.Tag>
toTags
(org.apache.poi.wp.usermodel.CharacterRun run)
-
Method Details
-
ensureFormattingState
public static void ensureFormattingState(XHTMLContentHandler xhtml, EnumSet<FormattingUtils.Tag> desired, Deque<FormattingUtils.Tag> currentState) throws 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:
SAXException
- pass underlying handler exception
-
closeStyleTags
public static void closeStyleTags(XHTMLContentHandler xhtml, Deque<FormattingUtils.Tag> formattingState) throws SAXException Closes all formatting tags.- Parameters:
xhtml
- handlerformattingState
- current formatting state (stack of open formatting tags)- Throws:
SAXException
- pass underlying handler exception
-
toTags
-