org.apache.synapse.commons.evaluators

## Class EvaluatorContext

- java.lang.Object
- - org.apache.synapse.commons.evaluators.EvaluatorContext

-     public class EvaluatorContext
      extends java.lang.Object

  Holds the information about the HTTP request. Created on per request basis and passed to each and every evaluator.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `EvaluatorContext(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> headers)` Creates the Evalutor context with the URL and the set of HTTP headers

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getHeader(java.lang.String name)` Get the HTTP header value for the Header name
    `java.util.Map<java.lang.String,java.lang.String>` | `getHeaders()` Get all the HTTP headers
    `org.apache.axis2.context.MessageContext` | `getMessageContext()` Get the message context associated with this evaluator context
    `java.lang.String` | `getParam(java.lang.String name)` Return the value of a HTTP parameter
    `java.util.Map<java.lang.String,java.lang.String>` | `getParams()` Get all the HTTP parameters
    `java.lang.Object` | `getProperty(java.lang.String name)` Get the value of the named property
    `java.lang.String` | `getUrl()` Get the complete URL
    `void` | `setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)` Set the headers
    `void` | `setMessageContext(org.apache.axis2.context.MessageContext messageContext)` Set the current Axis2 MessageContext to this evaluator context
    `void` | `setParams(java.util.Map<java.lang.String,java.lang.String> params)` Set all the HTTP URL parameters
    `void` | `setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)` Associate a set of properties with this evaluator context
    `void` | `setUrl(java.lang.String url)` Set the URL

    - ### Methods inherited from class java.lang.Object

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

- - ### Constructor Detail

    - #### EvaluatorContext

          public EvaluatorContext(java.lang.String url,
                                  java.util.Map<java.lang.String,java.lang.String> headers)

      Creates the Evalutor context with the URL and the set of HTTP headers
      Parameters:
        `url` - url
        `headers` - HTTP header as a Name, Value map

  - ### Method Detail

    - #### getUrl

          public java.lang.String getUrl()

      Get the complete URL
      Returns:
        URL

    - #### getHeaders

          public java.util.Map<java.lang.String,java.lang.String> getHeaders()

      Get all the HTTP headers
      Returns:
        all the HTTP headers as name value pairs

    - #### getParams

          public java.util.Map<java.lang.String,java.lang.String> getParams()

      Get all the HTTP parameters
      Returns:
        all the HTTP parameter as Name Value pairs

    - #### getParam

          public java.lang.String getParam(java.lang.String name)
                                    throws java.io.UnsupportedEncodingException

      Return the value of a HTTP parameter
      Parameters:
        `name` - name of the parameter
      Returns:
        value of the parameter
      Throws:
        `java.io.UnsupportedEncodingException` - if cannot decode the URLs

    - #### getHeader

          public java.lang.String getHeader(java.lang.String name)

      Get the HTTP header value for the Header name
      Parameters:
        `name` - name of the header
      Returns:
        header value

    - #### getMessageContext

          public org.apache.axis2.context.MessageContext getMessageContext()

      Get the message context associated with this evaluator context
      Returns:
        an Axis2 MessageContext instance or null

    - #### getProperty

          public java.lang.Object getProperty(java.lang.String name)

      Get the value of the named property
      Parameters:
        `name` - Name of the property
      Returns:
        A string property value or null

    - #### setUrl

          public void setUrl(java.lang.String url)

      Set the URL
      Parameters:
        `url` - to be set

    - #### setHeaders

          public void setHeaders(java.util.Map<java.lang.String,java.lang.String> headers)

      Set the headers
      Parameters:
        `headers` - as a HeaderName, HeaderValue pair map

    - #### setParams

          public void setParams(java.util.Map<java.lang.String,java.lang.String> params)

      Set all the HTTP URL parameters
      Parameters:
        `params` - as a ParameterName, ParameterValue pair map

    - #### setMessageContext

          public void setMessageContext(org.apache.axis2.context.MessageContext messageContext)

      Set the current Axis2 MessageContext to this evaluator context
      Parameters:
        `messageContext` - an Axis2 MessageContext object

    - #### setProperties

          public void setProperties(java.util.Map<java.lang.String,java.lang.Object> properties)

      Associate a set of properties with this evaluator context
      Parameters:
        `properties` - a Properties map

Copyright © 2005-2020 Apache Software Foundation. All Rights Reserved.