Configurable, Expressionpublic abstract class BaseExpression extends java.lang.Object implements Expression, Configurable
Find command. Provides default
behavior for a no-argument primary expression.| Constructor | Description |
|---|---|
BaseExpression() |
| Modifier and Type | Method | Description |
|---|---|---|
protected void |
addArgument(java.lang.String arg) |
Add a single argument to this expression.
|
void |
addArguments(java.util.Deque<java.lang.String> args) |
Adds arguments to this expression.
|
protected void |
addArguments(java.util.Deque<java.lang.String> args,
int count) |
Add a specific number of arguments to this expression.
|
void |
addChildren(java.util.Deque<Expression> exprs) |
Adds children to this expression.
|
protected void |
addChildren(java.util.Deque<Expression> exprs,
int count) |
Add a specific number of children to this expression.
|
void |
finish() |
Finishes the expression, called once after processing all items.
|
protected java.lang.String |
getArgument(int position) |
Returns the argument at the given position (starting from 1).
|
protected java.util.List<java.lang.String> |
getArguments() |
Returns the arguments of this expression
|
protected java.util.List<Expression> |
getChildren() |
Returns the children of this expression.
|
Configuration |
getConf() |
Return the configuration used by this object.
|
protected FileStatus |
getFileStatus(PathData item,
int depth) |
Returns the
FileStatus from the PathData item. |
protected FileSystem |
getFileSystem(PathData item) |
Returns the
FileSystem associated with the PathData item. |
java.lang.String[] |
getHelp() |
Returns a description of the expression for use in help.
|
protected FindOptions |
getOptions() |
Return the options to be used by this expression.
|
protected Path |
getPath(PathData item) |
|
int |
getPrecedence() |
Returns the precedence of this expression
(only applicable to operators).
|
java.lang.String[] |
getUsage() |
Returns brief usage instructions for this expression.
|
boolean |
isAction() |
Indicates whether this expression performs an action, i.e.
|
boolean |
isOperator() |
Identifies the expression as an operator rather than a primary.
|
void |
prepare() |
Prepares the expression for execution, called once after setting options
and before processing any options.
|
void |
setConf(Configuration conf) |
Set the configuration to be used by this object.
|
protected void |
setHelp(java.lang.String[] help) |
Sets the help text for this
Expression . |
void |
setOptions(FindOptions options) |
Set the options for this expression, called once before processing any
items.
|
protected void |
setUsage(java.lang.String[] usage) |
Sets the usage text for this
Expression . |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyprotected void setUsage(java.lang.String[] usage)
Expression .usage - usage array.protected void setHelp(java.lang.String[] help)
Expression .help - help.public java.lang.String[] getUsage()
ExpressiongetUsage in interface Expressionpublic java.lang.String[] getHelp()
ExpressiongetHelp in interface Expressionpublic void setOptions(FindOptions options) throws java.io.IOException
ExpressionsetOptions in interface Expressionoptions - options.java.io.IOException - raised on errors performing I/O.public void prepare()
throws java.io.IOException
Expressionprepare in interface Expressionjava.io.IOException - raised on errors performing I/O.public void finish()
throws java.io.IOException
Expressionfinish in interface Expressionjava.io.IOException - raised on errors performing I/O.protected FindOptions getOptions()
public void setConf(Configuration conf)
ConfigurablesetConf in interface Configurableconf - configuration to be usedpublic Configuration getConf()
ConfigurablegetConf in interface Configurablepublic java.lang.String toString()
toString in class java.lang.Objectpublic boolean isAction()
ExpressionisAction in interface Expressionpublic boolean isOperator()
ExpressionisOperator in interface Expressionprotected java.util.List<java.lang.String> getArguments()
protected java.lang.String getArgument(int position)
throws java.io.IOException
position - argument to be returnedjava.io.IOException - if the argument doesn't exist or is nullprotected java.util.List<Expression> getChildren()
public int getPrecedence()
ExpressiongetPrecedence in interface Expressionpublic void addChildren(java.util.Deque<Expression> exprs)
ExpressionaddChildren in interface Expressionexprs - deque of expressions from which to take the childrenprotected void addChildren(java.util.Deque<Expression> exprs, int count)
exprs - deque of expressions from which to take the childrencount - number of children to be addedpublic void addArguments(java.util.Deque<java.lang.String> args)
ExpressionaddArguments in interface Expressionargs - deque of arguments from which to take expression argumentsprotected void addArguments(java.util.Deque<java.lang.String> args,
int count)
args - deque of arguments from which to take the argumentcount - number of children to be addedprotected void addArgument(java.lang.String arg)
arg - argument to add to the expressionprotected FileStatus getFileStatus(PathData item, int depth) throws java.io.IOException
FileStatus from the PathData item. If the
current options require links to be followed then the returned file status
is that of the linked file.item - PathDatadepth - current depth in the process directoriesjava.io.IOException - raised on errors performing I/O.protected Path getPath(PathData item) throws java.io.IOException
item - PathDatajava.io.IOException - raised on errors performing I/O.protected FileSystem getFileSystem(PathData item) throws java.io.IOException
FileSystem associated with the PathData item.item - PathDatajava.io.IOException - raised on errors performing I/O.Copyright © 2008–2025 Apache Software Foundation. All rights reserved.