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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAbstractState.QDLStackTraceElement
-
Field Summary
Fields Modifier and Type Field Description static StringINTRINSIC_PREFIXprotected List<String>libPathprotected 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 voiddebug(String x)voiderror(String x)voiderror(String message, Throwable t)voiderror(Throwable t)org.fife.ui.autocomplete.DefaultCompletionProvidergetCompletionProvider()edu.uiuc.ncsa.security.util.cli.IOInterfacegetIoInterface()List<String>getLibPath()StringgetLibrarySupportMode()edu.uiuc.ncsa.security.core.util.MyLoggingFacadegetLogger()MetaEvaluatorgetMetaEvaluator()List<String>getModulePaths()intgetOperatorType(String name)OpEvaluatorgetOpEvaluator()Object[]getScriptArgs()Command line arguments if this is being run in script mode.QDLStemgetScriptArgStem()StringgetScriptName()List<String>getScriptPaths()List<AbstractState.QDLStackTraceElement>getScriptStack()Map<UUID,AbstractState>getStateRegistry()StategetSuperState()Superstate is used in modules, functions, scripts etc.UUIDgetUuid()VStackgetVStack()booleanhasCompletionProvider()booleanhasLogging()booleanhasScriptArgs()booleanhasScriptName()booleanhasSuperState()voidinfo(String x)booleanisDebugOn()booleanisEnableLibrarySupport()static booleanisIntrinsic(String x)static booleanisPrintUnicode()protected List<String>pathToList(String rawPath)Internally paths are always normalized to end in a "/";voidsetCompletionProvider(org.fife.ui.autocomplete.DefaultCompletionProvider completionProvider)voidsetDebugOn(boolean setOn)voidsetEnableLibrarySupport(boolean enableLibrarySupport)voidsetIoInterface(edu.uiuc.ncsa.security.util.cli.IOInterface ioInterface)voidsetLibPath(String rawPath)voidsetLibPath(List<String> libPath)voidsetLibrarySupportMode(String librarySupportMode)voidsetLogger(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger)voidsetMetaEvaluator(MetaEvaluator metaEvaluator)voidsetModulePaths(String rawPath)voidsetModulePaths(List<String> newModulePaths)voidsetOpEvaluator(OpEvaluator opEvaluator)static voidsetPrintUnicode(boolean printU)voidsetScriptArgs(Object[] scriptArgs)voidsetScriptArgStem(QDLStem scriptArgStem)voidsetScriptName(String scriptName)voidsetScriptPaths(String rawPath)Sets the script path from a string like path0:path1:path2.voidsetScriptPaths(List<String> scriptPaths)voidsetScriptStack(List<AbstractState.QDLStackTraceElement> scriptStack)voidsetSuperState(State superState)voidsetUuid(UUID uuid)voidsetvStack(VStack vStack)voidwarn(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
-
getScriptStack
public List<AbstractState.QDLStackTraceElement> getScriptStack()
-
setScriptStack
public void setScriptStack(List<AbstractState.QDLStackTraceElement> scriptStack)
-
hasCompletionProvider
public boolean hasCompletionProvider()
-
getCompletionProvider
public org.fife.ui.autocomplete.DefaultCompletionProvider getCompletionProvider()
-
setCompletionProvider
public void setCompletionProvider(org.fife.ui.autocomplete.DefaultCompletionProvider completionProvider)
-
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, functions, scripts etc. 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:
isDebugOnin interfaceedu.uiuc.ncsa.security.core.Logable
-
setDebugOn
public void setDebugOn(boolean setOn)
- Specified by:
setDebugOnin interfaceedu.uiuc.ncsa.security.core.Logable
-
debug
public void debug(String x)
- Specified by:
debugin interfaceedu.uiuc.ncsa.security.core.Logable
-
info
public void info(String x)
- Specified by:
infoin interfaceedu.uiuc.ncsa.security.core.Logable
-
hasLogging
public boolean hasLogging()
-
warn
public void warn(String x)
- Specified by:
warnin interfaceedu.uiuc.ncsa.security.core.Logable
-
error
public void error(Throwable t)
-
error
public void error(String x)
- Specified by:
errorin 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 values).- Returns:
-
setScriptArgs
public void setScriptArgs(Object[] scriptArgs)
-
isEnableLibrarySupport
public boolean isEnableLibrarySupport()
-
setEnableLibrarySupport
public void setEnableLibrarySupport(boolean enableLibrarySupport)
-
getLibrarySupportMode
public String getLibrarySupportMode()
-
setLibrarySupportMode
public void setLibrarySupportMode(String librarySupportMode)
-
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)
-
-