Class JFunctorImpl
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.functor.JFunctorImpl
-
- All Implemented Interfaces:
JFunctor
,JMetaMetaFunctor
,JSONFunctor
,Serializable
- Direct Known Subclasses:
jAnd
,jclearEnv
,jConcat
,jDrop
,jEcho
,jFalse
,jgetEnv
,jIf
,jNot
,jOr
,jRaiseError
,jReplace
,jsetEnv
,jStringComparisons
,jThen
,jToArray
,jToLowerCase
,jToUpperCase
,jTrue
,jXOr
,UserDefined
public abstract class JFunctorImpl extends Object implements JFunctor
Created by Jeff Gaynor
on 2/27/18 at 8:53 AM- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JFunctorImpl(FunctorType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addArg(JFunctor x)
void
addArg(JSONFunctor x)
void
addArg(Boolean x)
void
addArg(Integer x)
void
addArg(String x)
void
addArg(List<JFunctor> functors)
protected void
checkArgs()
This will check that there are args (assumes that the functor requires arguments and that each argument in turn is a functor.protected void
checkArgs(boolean allowEmptyList)
void
clearState()
ArrayList<Object>
getArgs()
boolean
getBooleanResult()
int
getIntResult()
List
getListResult()
This will always return a list.String
getName()
Object
getResult()
String
getStringResult()
boolean
isExecuted()
void
reset()
This resets the entire state of the functor including erasing the argument list. If you need to clear the executed state and re-run everything, consider invokingclearState()
.net.sf.json.JSONObject
toJSON()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface edu.uiuc.ncsa.security.util.functor.JMetaMetaFunctor
execute
-
-
-
-
Field Detail
-
type
protected FunctorType type
-
executed
protected boolean executed
-
result
protected Object result
-
-
Constructor Detail
-
JFunctorImpl
protected JFunctorImpl(FunctorType type)
-
-
Method Detail
-
isExecuted
public boolean isExecuted()
-
clearState
public void clearState()
-
reset
public void reset()
This resets the entire state of the functor including erasing the argument list. If you need to clear the executed state and re-run everything, consider invokingclearState()
.
-
checkArgs
protected void checkArgs()
This will check that there are args (assumes that the functor requires arguments and that each argument in turn is a functor. This is used in various functors.
-
checkArgs
protected void checkArgs(boolean allowEmptyList)
-
getResult
public Object getResult()
- Specified by:
getResult
in interfaceJMetaMetaFunctor
-
getListResult
public List getListResult()
This will always return a list. If the result is not a list, it will be enclosed in an list.- Returns:
-
getBooleanResult
public boolean getBooleanResult()
-
getStringResult
public String getStringResult()
-
getIntResult
public int getIntResult()
-
addArg
public void addArg(JSONFunctor x)
-
addArg
public void addArg(Boolean x)
-
toJSON
public net.sf.json.JSONObject toJSON()
- Specified by:
toJSON
in interfaceJSONFunctor
-
-