Package Services.ResponseAnalyzer
Class StructuredObject
java.lang.Object
Services.ResponseAnalyzer.StructuredObject
- All Implemented Interfaces:
Serializable
Represents a structured part of an HTTP response.
A StructuredObject typically corresponds to a JSON object or array within
an HTTP response. It can contain nested AtomicObject or StructuredObject
instances in its objects list.
Upon creation, this class attempts to generate a JSON schema representation of its
value by calling JsonSchemaGenerator.generateJSONSchema(String).
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStructuredObject(String name, String value, String xpath) Constructs a StructuredObject with the specified name, value, and XPath. -
Method Summary
Modifier and TypeMethodDescriptiongetName()Returns the name of the object.Returns the list of child objects contained within this structured object.Returns the JSON schema string generated for this object.getValue()Returns the value of the object.getXpath()Returns the XPath-like path of the object within the JSON hierarchy.voidSets the name of the object.voidsetObjects(List<Object> objects) Sets the list of child objects for this structured object.voidsetSchemaString(String schemaString) voidSets the value of the object.voidSets the XPath-like path of the object within the JSON hierarchy.toString()Returns a string representation of the object, including its name, value, number of child objects, JSON schema, and XPath.
-
Field Details
-
name
-
value
-
xpath
-
objects
-
-
Constructor Details
-
StructuredObject
Constructs a StructuredObject with the specified name, value, and XPath.- Parameters:
name- the name of the object, typically corresponding to the JSON keyvalue- the raw JSON string or value of the objectxpath- the XPath-like path representing the location of the object within the JSON hierarchy- Throws:
RuntimeException- if the JSON schema generation fails
-
-
Method Details
-
getName
Returns the name of the object. -
getValue
Returns the value of the object. -
getObjects
Returns the list of child objects contained within this structured object. -
setName
Sets the name of the object. -
setValue
Sets the value of the object. -
setObjects
Sets the list of child objects for this structured object. -
setSchemaString
-
getXpath
Returns the XPath-like path of the object within the JSON hierarchy. -
setXpath
Sets the XPath-like path of the object within the JSON hierarchy. -
getSchemaString
Returns the JSON schema string generated for this object. -
toString
Returns a string representation of the object, including its name, value, number of child objects, JSON schema, and XPath.
-