Package com.xceptance.xlt.api.util

# Class ResponseContentProcessor

java.lang.Object
com.xceptance.xlt.api.util.AbstractResponseProcessor
com.xceptance.xlt.api.util.ResponseContentProcessor

All Implemented Interfaces:
  `ResponseProcessor`

public class ResponseContentProcessor extends AbstractResponseProcessor
A `ResponseProcessor` implementation, which modifies the body of a web response based on regular expressions.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ResponseContentProcessor(String contentPattern, String replacement)`
  Creates a new `ResponseContentProcessor` object.
  `ResponseContentProcessor(String contentPattern, String replacement, String urlPattern)`
  Creates a new `ResponseContentProcessor` object.
  `ResponseContentProcessor(Pattern contentPattern, String replacement)`
  Creates a new `ResponseContentProcessor` object.
  `ResponseContentProcessor(Pattern contentPattern, String replacement, Pattern urlPattern)`
  Creates a new `ResponseContentProcessor` object.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `WebResponse`
  `processResponse(WebResponse webResponse)`
  Processes the content of a response.

  ### Methods inherited from class com.xceptance.xlt.api.util.AbstractResponseProcessor

  `createWebResponse, createWebResponse`

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

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

- ## Constructor Details

  - ### ResponseContentProcessor

    public ResponseContentProcessor(String contentPattern, String replacement)
    Creates a new `ResponseContentProcessor` object.
    Parameters:
      `contentPattern` - a regex specifying the piece of content to be replaced
      `replacement` - the replacement string

  - ### ResponseContentProcessor

    public ResponseContentProcessor(String contentPattern, String replacement, String urlPattern)
    Creates a new `ResponseContentProcessor` object.
    Parameters:
      `contentPattern` - a regex specifying the piece of content to be replaced
      `replacement` - the replacement string
      `urlPattern` - a regex specifying the URL(s) for which to apply the replacement

  - ### ResponseContentProcessor

    public ResponseContentProcessor(Pattern contentPattern, String replacement)
    Creates a new `ResponseContentProcessor` object.
    Parameters:
      `contentPattern` - a regex specifying the piece of content to be replaced
      `replacement` - the replacement string

  - ### ResponseContentProcessor

    public ResponseContentProcessor(Pattern contentPattern, String replacement, Pattern urlPattern)
    Creates a new `ResponseContentProcessor` object.
    Parameters:
      `contentPattern` - a regex specifying the piece of content to be replaced
      `replacement` - the replacement string
      `urlPattern` - a regex specifying the URL(s) for which to apply the replacement

- ## Method Details

  - ### processResponse

    public WebResponse processResponse(WebResponse webResponse)
    Processes the content of a response.
    Parameters:
      `webResponse` - the web response to modify
    Returns:
      the (potentially) modified web response