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
AResponseProcessor
implementation, which modifies the body of a web response based on regular expressions.
-
-
Constructor Summary
Constructors Constructor Description ResponseContentProcessor(java.lang.String contentPattern, java.lang.String replacement)
Creates a newResponseContentProcessor
object.ResponseContentProcessor(java.lang.String contentPattern, java.lang.String replacement, java.lang.String urlPattern)
Creates a newResponseContentProcessor
object.ResponseContentProcessor(java.util.regex.Pattern contentPattern, java.lang.String replacement)
Creates a newResponseContentProcessor
object.ResponseContentProcessor(java.util.regex.Pattern contentPattern, java.lang.String replacement, java.util.regex.Pattern urlPattern)
Creates a newResponseContentProcessor
object.
-
Method Summary
All Methods Instance Methods Concrete Methods 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
-
-
-
-
Constructor Detail
-
ResponseContentProcessor
public ResponseContentProcessor(java.lang.String contentPattern, java.lang.String replacement)
Creates a newResponseContentProcessor
object.- Parameters:
contentPattern
- a regex specifying the piece of content to be replacedreplacement
- the replacement string
-
ResponseContentProcessor
public ResponseContentProcessor(java.lang.String contentPattern, java.lang.String replacement, java.lang.String urlPattern)
Creates a newResponseContentProcessor
object.- Parameters:
contentPattern
- a regex specifying the piece of content to be replacedreplacement
- the replacement stringurlPattern
- a regex specifying the URL(s) for which to apply the replacement
-
ResponseContentProcessor
public ResponseContentProcessor(java.util.regex.Pattern contentPattern, java.lang.String replacement)
Creates a newResponseContentProcessor
object.- Parameters:
contentPattern
- a regex specifying the piece of content to be replacedreplacement
- the replacement string
-
ResponseContentProcessor
public ResponseContentProcessor(java.util.regex.Pattern contentPattern, java.lang.String replacement, java.util.regex.Pattern urlPattern)
Creates a newResponseContentProcessor
object.- Parameters:
contentPattern
- a regex specifying the piece of content to be replacedreplacement
- the replacement stringurlPattern
- a regex specifying the URL(s) for which to apply the replacement
-
-
Method Detail
-
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
-
-