Substitution.ServerVariableEnvElement (Apache Tomcat 11.0.23 API Documentation)
Description: declaration: package: org.apache.catalina.valves.rewrite, class: Substitution, class: ServerVariableEnvElement

# Class Substitution.ServerVariableEnvElement

java.lang.Object
org.apache.catalina.valves.rewrite.Substitution.SubstitutionElement
org.apache.catalina.valves.rewrite.Substitution.ServerVariableEnvElement

Enclosing class:
  `Substitution`

public static class Substitution.ServerVariableEnvElement extends Substitution.SubstitutionElement
Substitution element that resolves an environment variable.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `String`
  `key`
  The environment variable name to resolve.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ServerVariableEnvElement()`
  Constructs a new ServerVariableEnvElement.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `evaluate(Matcher rule, Matcher cond, Resolver resolver)`
  Evaluates this element against the given matchers and resolver.

  ### Methods inherited from class Object

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

- ## Field Details

  - ### key

    public String key
    The environment variable name to resolve.

- ## Constructor Details

  - ### ServerVariableEnvElement

    public ServerVariableEnvElement()
    Constructs a new ServerVariableEnvElement.

- ## Method Details

  - ### evaluate

    public String evaluate(Matcher rule, Matcher cond, Resolver resolver)
    Description copied from class: `Substitution.SubstitutionElement`
    Evaluates this element against the given matchers and resolver.
    Specified by:
      `evaluate` in class `Substitution.SubstitutionElement`
    Parameters:
      `rule` - the rewrite rule matcher
      `cond` - the condition matcher
      `resolver` - the property resolver
    Returns:
      the evaluated string