public final class GrepFactory extends Object implements Grep.Interface<GrepCommand>
grep
command returning
a new command instance from every signature method.Modifier and Type | Field and Description |
---|---|
static GrepFactory |
INSTANCE
The singleton instance of this factory.
|
Modifier and Type | Method and Description |
---|---|
GrepCommand |
grep(GrepOptions options,
Pattern pattern)
Filters the input lines from the standard input and writes the
matching lines to the standard output.
|
GrepCommand |
grep(GrepOptions options,
Pattern pattern,
File... files)
Filters the input lines from the specified input files and writes
the matching lines to the standard output.
|
GrepCommand |
grep(GrepOptions options,
Pattern pattern,
Input... inputs)
Filters the input lines from the specified inputs and writes
the matching lines to the standard output.
|
GrepCommand |
grep(GrepOptions options,
Pattern pattern,
String... paths)
Filters the input lines from the specified input files and writes
the matching lines to the standard output.
|
GrepCommand |
grep(GrepOptions options,
String regexp)
Filters the input lines from the standard input and writes the
matching lines to the standard output.
|
GrepCommand |
grep(GrepOptions options,
String regexp,
File... files)
Filters the input lines from the specified input files and writes
the matching lines to the standard output.
|
GrepCommand |
grep(GrepOptions options,
String regexp,
Input... inputs)
Filters the input lines from the specified inputs and writes
the matching lines to the standard output.
|
GrepCommand |
grep(GrepOptions options,
String regexp,
String... paths)
Filters the input lines from the specified input files and writes
the matching lines to the standard output.
|
GrepCommand |
grep(Pattern pattern)
Filters the input lines from the standard input and writes the
matching lines to the standard output.
|
GrepCommand |
grep(Pattern pattern,
File... files)
Filters the lines from the specified input files and writes the
matching lines to the standard output.
|
GrepCommand |
grep(Pattern pattern,
Input... inputs)
Filters the lines from the specified inputs and writes the
matching lines to the standard output.
|
GrepCommand |
grep(Pattern pattern,
String... paths)
Filters the lines from the specified input files and writes the
matching lines to the standard output.
|
GrepCommand |
grep(String... args)
Filters the input lines from the standard input or the provided
input files and writes the matching lines to the standard output.
|
GrepCommand |
grep(String regexp)
Filters the input lines from the standard input and writes the
matching lines to the standard output.
|
GrepCommand |
grep(String regexp,
File... files)
Filters the lines from the specified input files and writes the
matching lines to the standard output.
|
GrepCommand |
grep(String regexp,
Input... inputs)
Filters the lines from the specified inputs and writes the
matching lines to the standard output.
|
public static final GrepFactory INSTANCE
public GrepCommand grep(String... args)
Grep.Interface
"--regexp"
operand
value (default operand).
Options can be specified by acronym (with a leading dash "-") or by long name (with two leading dashes "--"). Operands other than the default "--regexp" and "--paths" operands have to be prefixed with the operand name.
grep
in interface Grep.Interface<GrepCommand>
args
- String arguments defining the options and operands for the command.
Options can be specified by acronym (with a leading dash "-") or by
long name (with two leading dashes "--"). Operands other than the
default "--pattern" and "--paths" operands have to be prefixed with
the operand name (e.g. "--files" for subsequent file operand values).<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(String regexp)
Grep.Interface
regexp
using case-sensitive string comparison.grep
in interface Grep.Interface<GrepCommand>
regexp
- Lines will be printed which match the given regular expression. The
regexp
string is surrounded with ".*" on both sides unless
the --wholeLine
option is specified. If the
--fixedStrings
option is used, plain string comparison is
used instead of regular expression matching.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(String regexp, File... files)
Grep.Interface
regexp
string using case-sensitive comparison.
Line endings are not relevant for the comparison.grep
in interface Grep.Interface<GrepCommand>
regexp
- Lines will be printed which match the given regular expression. The
regexp
string is surrounded with ".*" on both sides unless
the --wholeLine
option is specified. If the
--fixedStrings
option is used, plain string comparison is
used instead of regular expression matching.files
- The input files to be searched for the pattern; relative paths are
not resolved (use the string paths argument to enable relative path
resolving based on the current working directory).<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(String regexp, Input... inputs)
Grep.Interface
regexp
string using case-sensitive comparison.
Line endings are not relevant for the comparison.grep
in interface Grep.Interface<GrepCommand>
regexp
- Lines will be printed which match the given regular expression. The
regexp
string is surrounded with ".*" on both sides unless
the --wholeLine
option is specified. If the
--fixedStrings
option is used, plain string comparison is
used instead of regular expression matching.inputs
- The inputs to be searched for the pattern.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(Pattern pattern)
Grep.Interface
pattern
using case-sensitive
comparison. Line endings are not relevant for the comparison.grep
in interface Grep.Interface<GrepCommand>
pattern
- Lines will be printed which match the given pattern.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(Pattern pattern, File... files)
Grep.Interface
pattern
using case-sensitive
comparison. Line endings are not relevant for the comparison.grep
in interface Grep.Interface<GrepCommand>
pattern
- Lines will be printed which match the given pattern.files
- The input files to be searched for the pattern; relative paths are
not resolved (use the string paths argument to enable relative path
resolving based on the current working directory).<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(Pattern pattern, String... paths)
Grep.Interface
pattern
using case-sensitive
comparison. Line endings are not relevant for the comparison.grep
in interface Grep.Interface<GrepCommand>
pattern
- Lines will be printed which match the given pattern.paths
- Path names of the input files to be searched for the pattern;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(Pattern pattern, Input... inputs)
Grep.Interface
pattern
using case-sensitive
comparison. Line endings are not relevant for the comparison.grep
in interface Grep.Interface<GrepCommand>
pattern
- Lines will be printed which match the given pattern.inputs
- The inputs to be searched for the pattern.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(GrepOptions options, String regexp)
Grep.Interface
regexp
string; the exact comparison rules are
defined by the specified matching options
.grep
in interface Grep.Interface<GrepCommand>
options
- The options defining the types of patterns and command behavior.regexp
- Lines will be printed which match the given regular expression. The
regexp
string is surrounded with ".*" on both sides unless
the --wholeLine
option is specified. If the
--fixedStrings
option is used, plain string comparison is
used instead of regular expression matching.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(GrepOptions options, Pattern pattern)
Grep.Interface
pattern
; the exact comparison
rules are defined by the specified matching options
.grep
in interface Grep.Interface<GrepCommand>
options
- The options defining the types of patterns and command behavior.pattern
- Lines will be printed which match the given pattern.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(GrepOptions options, String regexp, File... files)
Grep.Interface
regexp
string; the exact comparison rules
are defined by the specified matching options
.grep
in interface Grep.Interface<GrepCommand>
options
- The options defining the types of patterns and command behavior.regexp
- Lines will be printed which match the given regular expression. The
regexp
string is surrounded with ".*" on both sides unless
the --wholeLine
option is specified. If the
--fixedStrings
option is used, plain string comparison is
used instead of regular expression matching.files
- The input files to be searched for the pattern; relative paths are
not resolved (use the string paths argument to enable relative path
resolving based on the current working directory).<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(GrepOptions options, String regexp, String... paths)
Grep.Interface
regexp
string; the exact comparison rules
are defined by the specified matching options
.grep
in interface Grep.Interface<GrepCommand>
options
- The options defining the types of patterns and command behavior.regexp
- Lines will be printed which match the given regular expression. The
regexp
string is surrounded with ".*" on both sides unless
the --wholeLine
option is specified. If the
--fixedStrings
option is used, plain string comparison is
used instead of regular expression matching.paths
- Path names of the input files to be searched for the pattern;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(GrepOptions options, String regexp, Input... inputs)
Grep.Interface
regexp
string; the exact comparison rules
are defined by the specified matching options
.grep
in interface Grep.Interface<GrepCommand>
options
- The options defining the types of patterns and command behavior.regexp
- Lines will be printed which match the given regular expression. The
regexp
string is surrounded with ".*" on both sides unless
the --wholeLine
option is specified. If the
--fixedStrings
option is used, plain string comparison is
used instead of regular expression matching.inputs
- The inputs to be searched for the pattern.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(GrepOptions options, Pattern pattern, File... files)
Grep.Interface
pattern
; the exact
comparison rules are defined by the specified matching
options
.grep
in interface Grep.Interface<GrepCommand>
options
- The options defining the types of patterns and command behavior.pattern
- Lines will be printed which match the given pattern.files
- The input files to be searched for the pattern; relative paths are
not resolved (use the string paths argument to enable relative path
resolving based on the current working directory).<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(GrepOptions options, Pattern pattern, String... paths)
Grep.Interface
pattern
; the exact
comparison rules are defined by the specified matching
options
.grep
in interface Grep.Interface<GrepCommand>
options
- The options defining the types of patterns and command behavior.pattern
- Lines will be printed which match the given pattern.paths
- Path names of the input files to be searched for the pattern;
wildcards * and ? are supported; relative paths are resolved on the
basis of the current working directory.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailspublic GrepCommand grep(GrepOptions options, Pattern pattern, Input... inputs)
Grep.Interface
pattern
; the exact
comparison rules are defined by the specified matching
options
.grep
in interface Grep.Interface<GrepCommand>
options
- The options defining the types of patterns and command behavior.pattern
- Lines will be printed which match the given pattern.inputs
- The inputs to be searched for the pattern.<R>
defined by the implementing class;
the command itself returns no value and writes its result to the
standard output; see class level parameter comments for more
detailsCopyright © 2024. All rights reserved.