Package org.docx4j.toc.switches
Class CSwitch
java.lang.Object
org.docx4j.toc.switches.AbstractSwitch
org.docx4j.toc.switches.SelectorSwitch
org.docx4j.toc.switches.CSwitch
- All Implemented Interfaces:
SwitchInterface
\c field-argument
Includes figures, tables, charts, and other items that are numbered
by a SEQ field (§2.16.5.63).
The sequence identifier designated by text in this switch's field-argument,
which corresponds to the caption label, shall match the identifier
in the corresponding SEQ field.
- Since:
- 11.5.4
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) int(package private) booleanstatic final Stringprivate Stringidentifier is the name assigned to the series of items that are to be numbered.private static org.slf4j.Loggerprivate static final intFields inherited from class org.docx4j.toc.switches.AbstractSwitch
EMPTY, endLevel, ERROR_NOT_VALID_HEADING_LEVEL, fieldArgument, startLevel, styleLevelMap, tSwitchSeparator -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static StringextractInstr(List<Object> instructions) protected static StringgetIdentifierFromInstr(String instr) Get the identifier from, for example SEQ Figure \* ARABICintbooleanbooleanparseFieldArgument(String fieldArgument) Default implementation doesn't need to parse at all.postprocess(P p, WordprocessingMLPackage wordMLPackage) We detected a SEQ in the P, so before we put the P in the TOC, lets resolve the SEQ to a number.voidprocess(P p, SwitchProcessorInterface sp) voidprocess(Style s, SwitchProcessorInterface sp) Methods inherited from class org.docx4j.toc.switches.AbstractSwitch
getEndLevel, getStartLevel, getStyleLevelMap, isSelectorSwitch, prepareArgument
-
Field Details
-
log
private static org.slf4j.Logger log -
ID
- See Also:
-
PRIORITY
private static final int PRIORITY- See Also:
-
itemIdentifier
identifier is the name assigned to the series of items that are to be numbered. [Example: identifier might be Equation, Figure, Table, or Thing, as the user deems appropriate for a caption. end example] identifier shall start with a Latin letter and shall consist of no more than 40 Latin letters, Arabic digits, and underscores. (See the TOC field (§2.16.5.75) switches \c and \s for uses of identifier.) Since a C switch can only include one series (ie 1 identifier), there is a 1:1 relationship in this class. -
counter
int counter -
detected
boolean detected
-
-
Constructor Details
-
CSwitch
public CSwitch()
-
-
Method Details
-
getPriority
public int getPriority() -
getItemIdentifier
-
parseFieldArgument
Description copied from class:AbstractSwitchDefault implementation doesn't need to parse at all.- Specified by:
parseFieldArgumentin interfaceSwitchInterface- Overrides:
parseFieldArgumentin classAbstractSwitch- Parameters:
fieldArgument- .- Returns:
- error string if any for exception
-
hasFieldArgument
public boolean hasFieldArgument() -
process
-
process
-
isDetected
public boolean isDetected() -
postprocess
We detected a SEQ in the P, so before we put the P in the TOC, lets resolve the SEQ to a number.- Parameters:
p-
-
extractInstr
-
getIdentifierFromInstr
Get the identifier from, for example SEQ Figure \* ARABIC
-