Package Services.ResponseAnalyzer
Class ResponseAnalyzer
java.lang.Object
Services.ResponseAnalyzer.ResponseAnalyzer
Analyzes HTTP responses and extracts structured and atomic objects from JSON responses
and response headers.
This class is responsible for converting JSON responses into a tree of StructuredObject
and AtomicObject instances. It also extracts relevant information from response headers
such as "Set-Cookie" headers.
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.ResponseAnalyzer(String url, Integer num_req) Constructs a ResponseAnalyzer for a specific URL and request number. -
Method Summary
Modifier and TypeMethodDescriptionvoidanalyzeResponseHeader(Header[] headers, ResponseUnstructured responseUnstructured) Analyzes HTTP response headers and extracts atomic objects for headers such as "Set-Cookie".getUnstructuredResponse(String json_response) Converts a JSON response string into aResponseUnstructuredobject containingStructuredObjectandAtomicObjectinstances.
-
Constructor Details
-
ResponseAnalyzer
Constructs a ResponseAnalyzer for a specific URL and request number.- Parameters:
url- the URL of the HTTP requestnum_req- the index or number of the request
-
ResponseAnalyzer
public ResponseAnalyzer()Default constructor.
-
-
Method Details
-
getUnstructuredResponse
Converts a JSON response string into aResponseUnstructuredobject containingStructuredObjectandAtomicObjectinstances.- Parameters:
json_response- the JSON string to analyze- Returns:
- a ResponseUnstructured object containing the parsed structure
-
analyzeResponseHeader
Analyzes HTTP response headers and extracts atomic objects for headers such as "Set-Cookie".- Parameters:
headers- the array of HTTP headers to analyzeresponseUnstructured- the ResponseUnstructured object to add extracted atomic objects
-