Package org.docx4j.toc.switches
Class AbstractSwitch
java.lang.Object
org.docx4j.toc.switches.AbstractSwitch
- All Implemented Interfaces:
SwitchInterface
- Direct Known Subclasses:
FormattingSwitch,SelectorSwitch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final Stringstatic final String(package private) intstatic final String(package private) Stringprivate static org.slf4j.Loggerprivate static final Stringprivate static final String(package private) int(package private) String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintbooleanparseFieldArgument(String fieldArgument) Default implementation doesn't need to parse at all.private voidprotected StringprepareArgument(String fieldArgument) Rules applied: 1.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.docx4j.toc.switches.SwitchInterface
getPriority, hasFieldArgument, process
-
Field Details
-
log
private static org.slf4j.Logger log -
EMPTY
- See Also:
-
BACKSLASH_QUOTE_REGEX
- See Also:
-
BACKSLASHES_REGEX
- See Also:
-
BACKSLASHES
- See Also:
-
NUMBERS_REGEX
- See Also:
-
QUOTE
- See Also:
-
ERROR_NOT_VALID_HEADING_LEVEL
- See Also:
-
tSwitchSeparator
String tSwitchSeparator -
fieldArgument
String fieldArgument -
startLevel
int startLevel -
endLevel
int endLevel -
styleLevelMap
-
-
Constructor Details
-
AbstractSwitch
public AbstractSwitch()
-
-
Method Details
-
parseFieldArgument
Default implementation doesn't need to parse at all.- Specified by:
parseFieldArgumentin interfaceSwitchInterface- Parameters:
fieldArgument- .- Returns:
- error string if any for exception
-
isSelectorSwitch
public boolean isSelectorSwitch() -
getStartLevel
public int getStartLevel() -
getEndLevel
public int getEndLevel() -
parseStartEndLevel
private void parseStartEndLevel() -
getStyleLevelMap
-
prepareArgument
Rules applied: 1. if argument has quote and this quote is not the beginning of string - return empty 2. if argument starts with quote but has no ending quote - return empty- Parameters:
fieldArgument-- Returns:
- empty string in case field argument can not be parsed correctly
-