VariableMapperImpl (Apache Tomcat 11.0.24 API Documentation)
Description: declaration: package: org.apache.el.lang, class: VariableMapperImpl

# Class VariableMapperImpl

java.lang.Object
jakarta.el.VariableMapper
org.apache.el.lang.VariableMapperImpl

All Implemented Interfaces:
  `Externalizable, Serializable`

public class VariableMapperImpl extends VariableMapper implements Externalizable
Implementation of VariableMapper that stores variables in a map.

See Also:
  - Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `VariableMapperImpl()`
  Constructs a new VariableMapperImpl for deserialization.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `readExternal(ObjectInput in)`
  `ValueExpression`
  `resolveVariable(String variable)`
  Resolves a variable name to its corresponding ValueExpression.
  `ValueExpression`
  `setVariable(String variable, ValueExpression expression)`
  Sets or removes a variable mapping.
  `void`
  `writeExternal(ObjectOutput out)`

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### VariableMapperImpl

    public VariableMapperImpl()
    Constructs a new VariableMapperImpl for deserialization.

- ## Method Details

  - ### resolveVariable

    public ValueExpression resolveVariable(String variable)
    Description copied from class: `jakarta.el.VariableMapper`
    Resolves a variable name to its corresponding ValueExpression.
    Specified by:
      `resolveVariable` in class `VariableMapper`
    Parameters:
      `variable` - the name of the variable to resolve
    Returns:
      the ValueExpression for the variable, or `null` if not found

  - ### setVariable

    public ValueExpression setVariable(String variable, ValueExpression expression)
    Description copied from class: `jakarta.el.VariableMapper`
    Sets or removes a variable mapping.
    Specified by:
      `setVariable` in class `VariableMapper`
    Parameters:
      `variable` - the name of the variable
      `expression` - the ValueExpression to associate with the variable, or `null` to remove the mapping
    Returns:
      the previous ValueExpression for the variable, or `null` if there was no mapping

  - ### readExternal

    public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
    Specified by:
      `readExternal` in interface `Externalizable`
    Throws:
      `IOException`
      `ClassNotFoundException`

  - ### writeExternal

    public void writeExternal(ObjectOutput out) throws IOException
    Specified by:
      `writeExternal` in interface `Externalizable`
    Throws:
      `IOException`