Package org.qdl_lang.state
Class AbstractState
- java.lang.Object
-
- org.qdl_lang.state.AbstractState
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.Logable
,edu.uiuc.ncsa.security.util.scripting.StateInterface
,Serializable
- Direct Known Subclasses:
ModuleState
public abstract class AbstractState extends Object implements edu.uiuc.ncsa.security.util.scripting.StateInterface, edu.uiuc.ncsa.security.core.Logable
This helps us organize the functionality of the state object. There are subclasses of this that do specific tasks. The inheritance hierarchy isnamespaces → variables → functions --. total state.
Created by Jeff Gaynor
on 2/2/20 at 6:37 AM- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
INTRINSIC_PREFIX
protected List<String>
libPath
protected Object[]
scriptArgs
-
Constructor Summary
Constructors Constructor Description AbstractState(VStack vStack, OpEvaluator opEvaluator, MetaEvaluator metaEvaluator, edu.uiuc.ncsa.security.core.util.MyLoggingFacade myLoggingFacade)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
debug(String x)
void
error(String x)
void
error(String message, Throwable t)
void
error(Throwable t)
edu.uiuc.ncsa.security.util.cli.IOInterface
getIoInterface()
List<String>
getLibPath()
edu.uiuc.ncsa.security.core.util.MyLoggingFacade
getLogger()
MetaEvaluator
getMetaEvaluator()
List<String>
getModulePaths()
int
getOperatorType(String name)
OpEvaluator
getOpEvaluator()
Object[]
getScriptArgs()
Command line arguments if this is being run in script mode.QDLStem
getScriptArgStem()
String
getScriptName()
List<String>
getScriptPaths()
List<String>
getScriptStack()
Map<UUID,AbstractState>
getStateRegistry()
State
getSuperState()
Superstate is used in modules.UUID
getUuid()
VStack
getVStack()
boolean
hasLogging()
boolean
hasScriptArgs()
boolean
hasScriptName()
boolean
hasSuperState()
void
info(String x)
boolean
isDebugOn()
boolean
isEnableLibrarySupport()
static boolean
isIntrinsic(String x)
static boolean
isPrintUnicode()
protected List<String>
pathToList(String rawPath)
Internally paths are always normalized to end in a "/";void
setDebugOn(boolean setOn)
void
setEnableLibrarySupport(boolean enableLibrarySupport)
void
setIoInterface(edu.uiuc.ncsa.security.util.cli.IOInterface ioInterface)
void
setLibPath(String rawPath)
void
setLibPath(List<String> libPath)
void
setLogger(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger)
void
setMetaEvaluator(MetaEvaluator metaEvaluator)
void
setModulePaths(String rawPath)
void
setModulePaths(List<String> newModulePaths)
void
setOpEvaluator(OpEvaluator opEvaluator)
static void
setPrintUnicode(boolean printU)
void
setScriptArgs(Object[] scriptArgs)
void
setScriptArgStem(QDLStem scriptArgStem)
void
setScriptName(String scriptName)
void
setScriptPaths(String rawPath)
Sets the script path from a string like path0:path1:path2.void
setScriptPaths(List<String> scriptPaths)
void
setScriptStack(List<String> scriptStack)
void
setSuperState(State superState)
void
setUuid(UUID uuid)
void
setvStack(VStack vStack)
void
warn(String x)
-
-
-
Field Detail
-
INTRINSIC_PREFIX
public static final String INTRINSIC_PREFIX
- See Also:
- Constant Field Values
-
scriptArgs
protected Object[] scriptArgs
-
-
Constructor Detail
-
AbstractState
public AbstractState(VStack vStack, OpEvaluator opEvaluator, MetaEvaluator metaEvaluator, edu.uiuc.ncsa.security.core.util.MyLoggingFacade myLoggingFacade)
-
-
Method Detail
-
getUuid
public UUID getUuid()
-
setUuid
public void setUuid(UUID uuid)
-
getStateRegistry
public Map<UUID,AbstractState> getStateRegistry()
-
getSuperState
public State getSuperState()
Superstate is used in modules. If a module is created, then its state sets the super state so that references to the state vs. local module state can be cleanly separated.
For instance, in an expression like a#b#f(x) the instance of b would have a superstate that is the current state of a.- Returns:
-
setSuperState
public void setSuperState(State superState)
-
hasSuperState
public boolean hasSuperState()
-
isIntrinsic
public static boolean isIntrinsic(String x)
-
getIoInterface
public edu.uiuc.ncsa.security.util.cli.IOInterface getIoInterface()
-
setIoInterface
public void setIoInterface(edu.uiuc.ncsa.security.util.cli.IOInterface ioInterface)
-
getLogger
public edu.uiuc.ncsa.security.core.util.MyLoggingFacade getLogger()
-
setLogger
public void setLogger(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger)
-
getVStack
public VStack getVStack()
-
setvStack
public void setvStack(VStack vStack)
-
getOpEvaluator
public OpEvaluator getOpEvaluator()
-
setOpEvaluator
public void setOpEvaluator(OpEvaluator opEvaluator)
-
getMetaEvaluator
public MetaEvaluator getMetaEvaluator()
-
setMetaEvaluator
public void setMetaEvaluator(MetaEvaluator metaEvaluator)
-
getOperatorType
public int getOperatorType(String name)
-
isDebugOn
public boolean isDebugOn()
- Specified by:
isDebugOn
in interfaceedu.uiuc.ncsa.security.core.Logable
-
setDebugOn
public void setDebugOn(boolean setOn)
- Specified by:
setDebugOn
in interfaceedu.uiuc.ncsa.security.core.Logable
-
debug
public void debug(String x)
- Specified by:
debug
in interfaceedu.uiuc.ncsa.security.core.Logable
-
info
public void info(String x)
- Specified by:
info
in interfaceedu.uiuc.ncsa.security.core.Logable
-
hasLogging
public boolean hasLogging()
-
warn
public void warn(String x)
- Specified by:
warn
in interfaceedu.uiuc.ncsa.security.core.Logable
-
error
public void error(Throwable t)
-
error
public void error(String x)
- Specified by:
error
in interfaceedu.uiuc.ncsa.security.core.Logable
-
hasScriptArgs
public boolean hasScriptArgs()
-
hasScriptName
public boolean hasScriptName()
-
getScriptName
public String getScriptName()
-
setScriptName
public void setScriptName(String scriptName)
-
getScriptArgStem
public QDLStem getScriptArgStem()
-
setScriptArgStem
public void setScriptArgStem(QDLStem scriptArgStem)
-
getScriptArgs
public Object[] getScriptArgs()
Command line arguments if this is being run in script mode. This is an array of objects. If invoked from inside QDL then it may be any QDL variable. When coming from outside, these will be strings (since, e.g., bash is unaware of QDL variable types).- Returns:
-
setScriptArgs
public void setScriptArgs(Object[] scriptArgs)
-
isEnableLibrarySupport
public boolean isEnableLibrarySupport()
-
setEnableLibrarySupport
public void setEnableLibrarySupport(boolean enableLibrarySupport)
-
setLibPath
public void setLibPath(String rawPath)
-
setModulePaths
public void setModulePaths(String rawPath)
-
pathToList
protected List<String> pathToList(String rawPath)
Internally paths are always normalized to end in a "/";- Parameters:
rawPath
-- Returns:
-
setScriptPaths
public void setScriptPaths(String rawPath)
Sets the script path from a string like path0:path1:path2. Each path in normalized form ends with a /.- Parameters:
rawPath
-
-
isPrintUnicode
public static boolean isPrintUnicode()
-
setPrintUnicode
public static void setPrintUnicode(boolean printU)
-
-