Interface ComponentHelper.VariableScope

All Superinterfaces:
AutoCloseable
Enclosing class:
ComponentHelper

public static interface ComponentHelper.VariableScope extends AutoCloseable
Represents a scoped EL variable. When closed, the original value of the variable is restored.
Since:
8.5.3
Author:
XIMA MEDIA GmbH
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Restores the previous mapping of the variable.
    Gets the previous value of the variable before it was overridden by this scope.
    boolean
    Gets whether the variable existed before it was overridden by this scope.
  • Method Details

    • close

      void close()
      Restores the previous mapping of the variable.
      Specified by:
      close in interface AutoCloseable
    • getPreviousValue

      Object getPreviousValue()
      Gets the previous value of the variable before it was overridden by this scope. If the variable did not exist before, this method returns null.
      Returns:
      The previous value of the variable, or null if the variable did not exist before.
    • isHadPreviousValue

      boolean isHadPreviousValue()
      Gets whether the variable existed before it was overridden by this scope.
      Returns:
      true if the variable existed before, or false if the variable did not exist before.