Class MapVariableResolver

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Class<?> knownType  
      private java.lang.String name  
      private java.util.Map<java.lang.String,​java.lang.Object> variableMap  
    • Constructor Summary

      Constructors 
      Constructor Description
      MapVariableResolver​(java.util.Map<java.lang.String,​java.lang.Object> variableMap, java.lang.String name)  
      MapVariableResolver​(java.util.Map<java.lang.String,​java.lang.Object> variableMap, java.lang.String name, java.lang.Class knownType)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getFlags()
      Returns the bitset of special variable flags.
      java.lang.String getName()
      Returns the name of external variable.
      java.lang.Class getType()
      This should return the type of the variable.
      java.lang.Object getValue()
      Returns the physical target value of the variable.
      void setName​(java.lang.String name)  
      void setStaticType​(java.lang.Class knownType)  
      void setValue​(java.lang.Object value)
      Sets the value of the physical target value.
      void setVariableMap​(java.util.Map<java.lang.String,​java.lang.Object> variableMap)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • name

        private java.lang.String name
      • knownType

        private java.lang.Class<?> knownType
      • variableMap

        private java.util.Map<java.lang.String,​java.lang.Object> variableMap
    • Constructor Detail

      • MapVariableResolver

        public MapVariableResolver​(java.util.Map<java.lang.String,​java.lang.Object> variableMap,
                                   java.lang.String name)
      • MapVariableResolver

        public MapVariableResolver​(java.util.Map<java.lang.String,​java.lang.Object> variableMap,
                                   java.lang.String name,
                                   java.lang.Class knownType)
    • Method Detail

      • setName

        public void setName​(java.lang.String name)
      • setVariableMap

        public void setVariableMap​(java.util.Map<java.lang.String,​java.lang.Object> variableMap)
      • getName

        public java.lang.String getName()
        Description copied from interface: VariableResolver
        Returns the name of external variable.
        Specified by:
        getName in interface VariableResolver
        Returns:
        A string representing the variable name.
      • getType

        public java.lang.Class getType()
        Description copied from interface: VariableResolver
        This should return the type of the variable. However, this is not completely necessary, and is particularily only of benefit to systems that require use of MVEL's strict typing facilities. In most cases, this implementation can simply return: Object.class
        Specified by:
        getType in interface VariableResolver
        Returns:
        A Class instance representing the type of the target variable.
      • setValue

        public void setValue​(java.lang.Object value)
        Description copied from interface: VariableResolver
        Sets the value of the physical target value.
        Specified by:
        setValue in interface VariableResolver
        Parameters:
        value - The new value.
      • getValue

        public java.lang.Object getValue()
        Description copied from interface: VariableResolver
        Returns the physical target value of the variable.
        Specified by:
        getValue in interface VariableResolver
        Returns:
        The actual variable value.
      • getFlags

        public int getFlags()
        Description copied from interface: VariableResolver
        Returns the bitset of special variable flags. Internal use only. This should just return 0 in custom implentations.
        Specified by:
        getFlags in interface VariableResolver
        Returns:
        Bitset of special flags.