Package org.docx4j.toc.switches
Class OSwitch
java.lang.Object
org.docx4j.toc.switches.AbstractSwitch
org.docx4j.toc.switches.OSwitch
- All Implemented Interfaces:
SwitchInterface
public class OSwitch extends AbstractSwitch
Uses paragraphs formatted with (or based on) all or the specified range of built-in heading styles.
Headings in a style range are specified by text in this switch's field-argument
using the notation specified as for \l, where each integer corresponds to the style
with a style ID of HeadingX (e.g. 1 corresponds to Heading1).
If no heading range is specified, all heading levels used in the document are listed.
Actually Word 2010 does this based on style's w:name (TODO confirm its that or id, not instead of id)
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringIDFields inherited from class org.docx4j.toc.switches.AbstractSwitch
EMPTY, ERROR_NOT_VALID_HEADING_LEVEL -
Constructor Summary
Constructors Constructor Description OSwitch() -
Method Summary
Modifier and Type Method Description intgetPriority()booleanhasFieldArgument()booleanisStyleSwitch()java.lang.StringparseFieldArgument(java.lang.String fieldArgument)voidprocess(Style s, SwitchProcessor sp)Methods inherited from class org.docx4j.toc.switches.AbstractSwitch
getEndLevel, getStartLevel, getStyleLevelMap
-
Field Details
-
ID
public static final java.lang.String ID- See Also:
- Constant Field Values
-
-
Constructor Details
-
OSwitch
public OSwitch()
-
-
Method Details
-
process
-
parseFieldArgument
public java.lang.String parseFieldArgument(java.lang.String fieldArgument)- Specified by:
parseFieldArgumentin interfaceSwitchInterface- Overrides:
parseFieldArgumentin classAbstractSwitch
-
hasFieldArgument
public boolean hasFieldArgument() -
getPriority
public int getPriority() -
isStyleSwitch
public boolean isStyleSwitch()- Specified by:
isStyleSwitchin interfaceSwitchInterface- Overrides:
isStyleSwitchin classAbstractSwitch
-