org.apache.synapse.commons.evaluators

## Class EvaluatorContext

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

-     public class EvaluatorContext
      extends 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(String url, Map<String,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
    --- | ---
    `String` | `getHeader(String name)` Get the HTTP header value for the Header name
    `Map<String,String>` | `getHeaders()` Get all the HTTP headers
    `org.apache.axis2.context.MessageContext` | `getMessageContext()` Get the message context associated with this evaluator context
    `String` | `getParam(String name)` Return the value of a HTTP parameter
    `Map<String,String>` | `getParams()` Get all the HTTP parameters
    `Object` | `getProperty(String name)` Get the value of the named property
    `String` | `getUrl()` Get the complete URL
    `void` | `setHeaders(Map<String,String> headers)` Set the headers
    `void` | `setMessageContext(org.apache.axis2.context.MessageContext messageContext)` Set the current Axis2 MessageContext to this evaluator context
    `void` | `setParams(Map<String,String> params)` Set all the HTTP URL parameters
    `void` | `setProperties(Map<String,Object> properties)` Associate a set of properties with this evaluator context
    `void` | `setUrl(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(String url,
                                  Map<String,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 String getUrl()

      Get the complete URL
      Returns:
        URL

    - #### getHeaders

          public Map<String,String> getHeaders()

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

    - #### getParams

          public Map<String,String> getParams()

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

    - #### getParam

          public String getParam(String name)
                          throws UnsupportedEncodingException

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

    - #### getHeader

          public String getHeader(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 Object getProperty(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(String url)

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

    - #### setHeaders

          public void setHeaders(Map<String,String> headers)

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

    - #### setParams

          public void setParams(Map<String,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(Map<String,Object> properties)

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

Copyright © 2005–2019 Apache Software Foundation. All rights reserved.