# Class Substitution.MapElement

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

Enclosing class:
  `Substitution`

public class Substitution.MapElement extends Substitution.SubstitutionElement
Substitution element that performs a rewrite map lookup.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `Substitution.SubstitutionElement[]`
  `defaultValue`
  The default value elements if map lookup fails.
  `Substitution.SubstitutionElement[]`
  `key`
  The key elements for the map lookup.
  `RewriteMap`
  `map`
  The rewrite map to use for lookup.

- ## Constructor Summary

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

- ## 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

  - ### map

    public RewriteMap map
    The rewrite map to use for lookup.

  - ### defaultValue

    public Substitution.SubstitutionElement[] defaultValue
    The default value elements if map lookup fails.

  - ### key

    public Substitution.SubstitutionElement[] key
    The key elements for the map lookup.

- ## Constructor Details

  - ### MapElement

    public MapElement()
    Constructs a new MapElement.

- ## 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