Package eu.bandm.tools.option.runtime
Class Model.Pre20220613
java.lang.Object
eu.bandm.tools.option.runtime.Model.Pre20220613
- All Implemented Interfaces:
Model.ShellAdapter
An adapter which escapes blanks contained in an opt arg by a backslash.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionIf the argument value contains whitespace or double quotes, it must be escaped when integrated into a serialization.int
Delivers the start of the last successful match.testNextToken
(Matcher mat, int len) Parse and return the next argument value.
-
Field Details
-
p_arg
Pattern to match a serialized argument. -
lastStart
protected int lastStart
-
-
Constructor Details
-
Pre20220613
public Pre20220613()
-
-
Method Details
-
serializeToArgsString
Description copied from interface:Model.ShellAdapter
If the argument value contains whitespace or double quotes, it must be escaped when integrated into a serialization. It is only assumed that this function is only called (and only necessary) for argument values of String type.- Specified by:
serializeToArgsString
in interfaceModel.ShellAdapter
-
startOfLastMatch
public int startOfLastMatch()Description copied from interface:Model.ShellAdapter
Delivers the start of the last successful match. May only be called immediately after a call toModel.ShellAdapter.testNextToken(Matcher,int)
with result != null.- Specified by:
startOfLastMatch
in interfaceModel.ShellAdapter
-
testNextToken
Description copied from interface:Model.ShellAdapter
Parse and return the next argument value. The serialized input, theModel.matcher
is looking at, will be translated into the internal form (ie. blanks will be unescaped, empty strings stripped from quotation marks, etc.) Internal matcher registers will be advanced (thus no more reflecting this match!) and the translated character data is copied inotModel.nextToken
. The realization by the sub-classes must use a regex-Pattern which accepts ALL non-whitespace input and returns null only when the end of the input stream (discarding whitespace) is reached.- Specified by:
testNextToken
in interfaceModel.ShellAdapter
- Parameters:
mat
- is prepared and looking at the current parsing position of the input string.
-