Package org.apache.tika.parser.microsoft
Class FormattingUtils
- java.lang.Object
-
- org.apache.tika.parser.microsoft.FormattingUtils
-
public class FormattingUtils extends Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFormattingUtils.Tag
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
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
public static EnumSet<FormattingUtils.Tag> toTags(org.apache.poi.wp.usermodel.CharacterRun run)
-
-