public class XStreamTransformer
extends java.lang.Object
PlanRequest
and PlanResponse
objects.
Usage: // Instantiates the PlanRequest.PlanRequest
planReq = newPlanRequest
("/gcube/devsec"); ...XStreamTransformer
transformer = newXStreamTransformer
(); // from PlanRequest -> XML String xml = transformer.toXML(planReq); ... // from XML -> PlanRequest.PlanRequest
tReq = transformer.getRequestfromXML(xml);
Constructor and Description |
---|
XStreamTransformer() |
Modifier and Type | Method and Description |
---|---|
Feedback |
getFeedbackFromXML(java.lang.String xml,
boolean validate)
Given an XML representation of a
Feedback instance
it returns its object representation. |
PlanRequest |
getRequestFromXML(java.lang.String xml,
boolean validate)
Given an XML representation of a
PlanRequest instance
it returns its object representation. |
PlanResponse |
getResponseFromXML(java.lang.String xml,
boolean validate)
Given an XML representation of a
PlanResponse instance
it returns its object representation. |
java.lang.String |
toXML(Feedback feedback)
Given a
Feedback
element it is serialized in its XML representation. |
java.lang.String |
toXML(PlanRequest request)
Given a
PlanRequest element it is serialized in its XML
representation. |
java.lang.String |
toXML(PlanResponse response)
Given a
PlanResponse element it is serialized in its XML
representation. |
public final java.lang.String toXML(PlanRequest request) throws GCUBEFault
PlanRequest
element it is serialized in its XML
representation.request
- the object to serializePlanRequest
GCUBEFault
public final java.lang.String toXML(PlanResponse response) throws GCUBEFault
PlanResponse
element it is serialized in its XML
representation.response
- the object to serializePlanResponse
GCUBEFault
public final java.lang.String toXML(Feedback feedback) throws GCUBEFault
Feedback
element it is serialized in its XML representation.feedback
- the object to serializeFeedback
GCUBEFault
public final PlanRequest getRequestFromXML(java.lang.String xml, boolean validate) throws GCUBEFault
PlanRequest
instance
it returns its object representation.xml
- the serialized PlanRequest
element.validate
- if the xml input must be validated.PlanRequest
.GCUBEFault
- if the parameter is null or if validation fails (when required).public final Feedback getFeedbackFromXML(java.lang.String xml, boolean validate) throws GCUBEFault
Feedback
instance
it returns its object representation.public final PlanResponse getResponseFromXML(java.lang.String xml, boolean validate) throws GCUBEFault
PlanResponse
instance
it returns its object representation.xml
- the serialized PlanResponse
element.validate
- if the xml input must be validated.PlanResponse
.GCUBEFault
- if the parameter is null or if validation fails (when required).