You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Andreas Veithen (JIRA)" <ji...@apache.org> on 2010/05/14 22:30:46 UTC

[jira] Commented: (WSCOMMONS-518) Some consumers of Axiom need direct access to the orignal parser/XMLStreamReader

    [ https://issues.apache.org/jira/browse/WSCOMMONS-518?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12867659#action_12867659 ] 

Andreas Veithen commented on WSCOMMONS-518:
-------------------------------------------

For the OMAttachmentAccessor dependency issue, I elegantly circumvented the problem by generalizing the getOMAttachmentAccessorXMLStreamReader to arbitrary XMLStreamReader types. See r944448 and r944449.

> 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.