abstract class AbstractSedProcessor extends Object implements LineProcessor
Modifier and Type | Field and Description |
---|---|
protected SedArguments |
args |
protected Command |
command |
protected LineProcessor |
output |
Constructor and Description |
---|
AbstractSedProcessor(Command command,
SedArguments args,
LineProcessor output) |
Modifier and Type | Method and Description |
---|---|
void |
finish()
Indicates that this line processing task is complete and can finished.
|
protected static String |
getRegexp(SedArguments args)
Returns the regexp operand from args, either called "regexp" or
"string1".
|
protected static String |
getReplacement(SedArguments args)
Returns the replacement operand from args, either called "replacement" or
"string2".
|
protected static int |
indexOfNextDelimiter(String script,
int indexOfPreviousDelimiter)
Returns the index of the next delimiter in the given sed script.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
processLine
protected final SedArguments args
protected final LineProcessor output
public AbstractSedProcessor(Command command, SedArguments args, LineProcessor output)
public void finish()
LineProcessor
Simple output devices usually perform a flush
operation in this
method. More complex commands may perform the real operation in this
method, for instance write the total count of lines or words to the
target file or stream.
finish
in interface LineProcessor
protected static String getRegexp(SedArguments args)
args
- the args with operand valuesprotected static String getReplacement(SedArguments args)
args
- the args with operand valuesprotected static int indexOfNextDelimiter(String script, int indexOfPreviousDelimiter)
indexOfPreviousDelimiter
is taken as delimiter. The
method handles escaped delimiters and returns -1 if no further delimiter
is found.script
- the script to analyzeindexOfPreviousDelimiter
- the index of the previous delimiterindexOfPreviousDelimiter
, or -1 if no further delimiter
exists of if indexOfNextDelimiter < 0
Copyright © 2024. All rights reserved.