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 protectedJFunctorImpl(FunctorType type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddArg(JFunctor x)voidaddArg(JSONFunctor x)voidaddArg(Boolean x)voidaddArg(Integer x)voidaddArg(String x)voidaddArg(List<JFunctor> functors)protected voidcheckArgs()This will check that there are args (assumes that the functor requires arguments and that each argument in turn is a functor.protected voidcheckArgs(boolean allowEmptyList)voidclearState()ArrayList<Object>getArgs()booleangetBooleanResult()intgetIntResult()ListgetListResult()This will always return a list.StringgetName()ObjectgetResult()StringgetStringResult()booleanisExecuted()voidreset()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.JSONObjecttoJSON()StringtoString()-
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:
getResultin 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:
toJSONin interfaceJSONFunctor
-
-