[
https://issues.apache.org/jira/browse/WSCOMMONS-518?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12876836#action_12876836
]
Andreas Veithen commented on WSCOMMONS-518:
-------------------------------------------
Implemented the changes as described in the previous comment(s). See r952840
(Axiom part) and r952842 (Axis2 part).
> Some consumers of Axiom need direct access to the orignal
> parser/XMLStreamReader
> --------------------------------------------------------------------------------
>
> Key: WSCOMMONS-518
> URL: https://issues.apache.org/jira/browse/WSCOMMONS-518
> Project: WS-Commons
> Issue Type: Bug
> Components: AXIOM
> Reporter: Rich Scheuerle
> Assignee: Andreas Veithen
> Fix For: Axiom 1.2.9
>
> Original Estimate: 120h
> Remaining Estimate: 120h
>
> Background:
> The dialect, "safe reader" and other improvements to Axiom allow the Axiom
> builders and other Axiom specific code to accommodate differences between
> different vendor XMLStreamReader.
> The Axiom implementation has been changed to add wrappers and delegates
> around the original, system XMLStreamReader.
> Problem:
> I agree with these improvements, but there is currently no way for a consumer
> of Axiom to access the original XMLStreamReader. A particular consumer may
> need to access the original XMLStreamReader due its dependency on a
> particular vendor implementation.
> Proposal/Solution:
> Two new methods are added to the XMStreamReaderUtils class:
> /**
> * getOriginalXMLStreamReader
> * Searches the wrapper and delegate classes to find the original
> XMLStreamReader
> * This method should only be used when a consumer of Axiom really needs
> to
> * access the original stream reader.
> * @param parser XMLStreamReader used by Axiom
> * @return original parser
> */
> public static XMLStreamReader getOriginalXMLStreamReader(XMLStreamReader
> parser) ...
> /**
> * Searches the wrapper and delegate classes to find an XMLStreamReader
> * that implements the OMAttachmentAccessor
> * @param parser
> * @return XMLStreamREader that implements OMAttachmentAccessor or null
> */
> public static XMLStreamReader
> getOMAttachmentAccessorXMLStreamReader(XMLStreamReader parser) ...
> To facilitate these changes, a new interface is proposed:
> XMLStreamReaderContainer.
> **
> * Marker interface for Axiom XMLStreamReader classes that
> * wrap or delegate to another (parent) XMLStreamReader.
> *
> * The marker interface is necessary so that consumers
> * can access the original parser.
> * @see XMLStreamReaderUtils
> *
> * Note that the only the getParent() method is applicable.
> * Please do not add a setParent() method since that would
> * violate the immutable characteristic of the XMLStreamReaderWrapper
> */
> public interface XMLStreamReaderContainer {
> XMLStreamReader getParent();
> }
> Also:
> The ability to access the original XMLStreamReader and the
> OMAttachmentAccessor XMLStreamReader is necessary for the Axis2 JAX-WS JAXB
> Unmarshaling code.
> Once these two methods are added to Axiom, I will be using a different JIRA
> for the Axis2 change.
> Current State:
> Still doing my testing.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.