Package org.apache.tika.parser.microsoft
Class FormattingUtils
java.lang.Object
org.apache.tika.parser.microsoft.FormattingUtils
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcloseStyleTags(XHTMLContentHandler xhtml, Deque<FormattingUtils.Tag> formattingState) Closes all formatting tags.static voidensureFormattingState(XHTMLContentHandler xhtml, EnumSet<FormattingUtils.Tag> desired, Deque<FormattingUtils.Tag> currentState) Closes all tags untilcurrentStatecontains only tags fromdesiredset, 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 untilcurrentStatecontains only tags fromdesiredset, 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
-