[
https://issues.apache.org/jira/browse/CXF-6242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jason Pell updated CXF-6242:
----------------------------
Description:
The ability to configure custom event handlers to control the content of the
marshal and unmarshal exceptions emitted from jaxb. Uses the existing
ValidationEventHandler mechanism.
For Data Reader, if the ValidationEventHandler also implements
UnmarshalEventHandler, will call the onUnmarshalComplete when unmarshalling
finishes to enable throwing a custom UnmarshalException rather than relying on
the default from jaxb.
For Data Writer, if the ValidationEventHandler also implements
MarshalEventHandler, will call the onMarshalComplete when marshalling finishes
to enable throwing a custom MarshalException rather than relying on the
default from jaxb.
was:
Add an enhanced CustomValidationEventHandler interface which has two methods:
void onUnmarshallingComplete() throws UnmarshalException;
void onMarshallingComplete() throws MarshalException;
In the JAXBEncoderDecoder unmarshal / marshal methods call the relevant method
on the event handler and allow the event handler to choose to throw an
exception based on the events collected in the handleEvent method.
The format of the exception thrown from JAXB is not always very useful in a
soap fault message, so this handler allows the flexibility to configure more
appropriate UnmarshalException and MarshalException
> Ability to configure the format of the marshalling / unmarshalling exceptions
> that are thrown by JAXB when schema validation is enabled.
> ----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: CXF-6242
> URL: https://issues.apache.org/jira/browse/CXF-6242
> Project: CXF
> Issue Type: New Feature
> Components: JAXB Databinding
> Affects Versions: 3.0.2, 2.7.14, 3.1.0
> Reporter: Jason Pell
> Assignee: Jason Pell
> Priority: Minor
>
> The ability to configure custom event handlers to control the content of the
> marshal and unmarshal exceptions emitted from jaxb. Uses the existing
> ValidationEventHandler mechanism.
> For Data Reader, if the ValidationEventHandler also implements
> UnmarshalEventHandler, will call the onUnmarshalComplete when unmarshalling
> finishes to enable throwing a custom UnmarshalException rather than relying
> on the default from jaxb.
> For Data Writer, if the ValidationEventHandler also implements
> MarshalEventHandler, will call the onMarshalComplete when marshalling
> finishes to enable throwing a custom MarshalException rather than relying on
> the default from jaxb.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)