Class VariableState

  • All Implemented Interfaces:
    edu.uiuc.ncsa.security.core.Logable, edu.uiuc.ncsa.security.util.scripting.StateInterface, Serializable
    Direct Known Subclasses:
    FunctionState

    public abstract class VariableState
    extends NamespaceAwareState

    Created by Jeff Gaynor
    on 2/2/20 at 6:42 AM

    See Also:
    Serialized Form
    • Field Detail

      • var_regex

        public static String var_regex
      • int_regex

        public static String int_regex
      • typeSafetyMode

        protected int typeSafetyMode
    • Constructor Detail

    • Method Detail

      • isDefined

        public boolean isDefined​(String symbol)
        Checks if a symbol is defined. Note that this does do stem tail resolution and namespace resolution.
        Parameters:
        symbol -
        Returns:
      • getValue

        public QDLValue getValue​(String variableName)
        GetValue may return null if the variable has not been set.
        Parameters:
        variableName -
        Returns:
      • setValue

        public void setValue​(String variableName,
                             QDLValue value)
      • remove

        public void remove​(String variableName)
      • gsrNSStemOp

        protected QDLValue gsrNSStemOp​(StemMultiIndex w,
                                       int op,
                                       QDLValue value,
                                       Set<XKey> checkInstances)
        gsr = get, set or remove. This resolves the name of the stem
        Parameters:
        w -
        op -
        value -
        Returns:
      • handleVariableType

        protected VThing handleVariableType​(VThing vThing,
                                            XKey key,
                                            QDLValue newValue)
        the contract here is that if the VThing is null, then it can be created. If it does exist, then cvarious contracts for type safety are followed. These are in the QDLVariable.setQDLValue(QDLValue) method.

        This returns the vThing to save or throws an exception for a type violation.

        Parameters:
        vThing -
        key -
        newValue -
        Returns:
      • getTypeSafetyMode

        public int getTypeSafetyMode()
      • setTypeSafetyMode

        public void setTypeSafetyMode​(int typeSafetyMode)
      • resolveStemIndex

        protected String resolveStemIndex​(String index)
      • listVariables

        public TreeSet<String> listVariables​(boolean useCompactNotation,
                                             boolean includeModules,
                                             boolean showIntrinsic,
                                             boolean showExtrinsic)
      • isStem

        public boolean isStem​(String var)
      • isExtrinsic

        public static boolean isExtrinsic​(String x)
      • getExtrinsicVars

        public VStack getExtrinsicVars()
      • setIntrinsicVariables

        public void setIntrinsicVariables​(VStack instrinsicVariables)
      • getIntrinsicVariables

        public VStack getIntrinsicVariables()