java.lang.Object
org.cruk.clarity.api.jaxb.JaxbUnmarshallingAspect
Aspect that wraps the unmarshalling of responses from the
Clarity API. Changes the returned value from a
JAXBElement
(seemingly now what is returned from Spring's Jaxb2Marshaller
as of Spring 4) to the actual object and, if the reply is found to be
an exception from the API, converts the reply into a Java exception
and throws it.- See Also:
-
Exception
ClarityException
Jaxb2Marshaller
JAXBElement
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionJoin point that replaces the JAXBElement object with the real object it contains, then tests whether the reply object is an error and, if so, throws a Java exception.
-
Constructor Details
-
JaxbUnmarshallingAspect
public JaxbUnmarshallingAspect()
-
-
Method Details
-
objectUnmarshalled
Join point that replaces the JAXBElement object with the real object it contains, then tests whether the reply object is an error and, if so, throws a Java exception.- Parameters:
pjp
- The AspectJ join point object. The return value from itsproceed
call gives the result of unmarshalling.- Returns:
- The real object extracted from
unmarshalled
(ifunmarshalled
is a JAXBElement). - Throws:
ClarityException
- ifunmarshalled
is an error message. It is created with the fields from the XML error.Throwable
- if there is another throwable from continuing the join point control chain.- See Also:
-