ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1734681 - in /webservices/axiom/trunk: aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/ aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/ aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/com...
Date Sat, 12 Mar 2016 10:28:32 GMT
Author: veithen
Date: Sat Mar 12 10:28:31 2016
New Revision: 1734681

URL: http://svn.apache.org/viewvc?rev=1734681&view=rev
Log:
* Unitfy StAXOMBuilder and PushBuilder.
* Improve encapsulation.
* Disable namespace repairing if the source is a parser.

Added:
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderImpl.java
      - copied, changed from r1734621, webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/AbstractBuilder.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/builder/SOAPModelBuilderImpl.java
      - copied, changed from r1734655, webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/builder/StAXSOAPModelBuilder.java
Removed:
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/AbstractBuilder.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/PushBuilder.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/builder/StAXSOAPModelBuilder.java
Modified:
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/DocumentElementExtractingFilterHandler.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuildableContext.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/Context.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/UnwrappingContext.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AbstractOMMetaFactory.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/stream/ds/PushOMDataSourceReader.java
    webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/DocumentElementExtractingFilterHandler.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/DocumentElementExtractingFilterHandler.java?rev=1734681&r1=1734680&r2=1734681&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/DocumentElementExtractingFilterHandler.java
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/DocumentElementExtractingFilterHandler.java
Sat Mar 12 10:28:31 2016
@@ -30,6 +30,10 @@ public final class DocumentElementExtrac
     }
 
     @Override
+    public void startFragment() throws StreamException {
+    }
+
+    @Override
     public void completed() throws StreamException {
     }
 

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuildableContext.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuildableContext.java?rev=1734681&r1=1734680&r2=1734681&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuildableContext.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuildableContext.java
Sat Mar 12 10:28:31 2016
@@ -153,6 +153,12 @@ final class BuildableContext extends Con
         target = document;
     }
 
+    @Override
+    void startFragment() {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
+
     void processDocumentTypeDeclaration(String rootName, String publicId, String systemId,
             String internalSubset) throws StreamException {
         if (passThroughHandler != null) {

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java?rev=1734681&r1=1734680&r2=1734681&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderHandler.java
Sat Mar 12 10:28:31 2016
@@ -38,10 +38,10 @@ final class BuilderHandler implements Xm
     final Builder builder;
     final OMNamespaceCache nsCache = new OMNamespaceCache();
     private final Context rootContext;
-    public Context context;
+    private Context context;
     private int activeContextCount;
     // returns the state of completion
-    public boolean done;
+    private boolean done;
     private AxiomDocument document;
     
     /**
@@ -135,8 +135,7 @@ final class BuilderHandler implements Xm
     
     @Override
     public void startFragment() throws StreamException {
-        // TODO
-        throw new UnsupportedOperationException();
+        context.startFragment();
     }
 
     public void processDocumentTypeDeclaration(String rootName, String publicId, String systemId,

Copied: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderImpl.java
(from r1734621, webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/AbstractBuilder.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderImpl.java?p2=webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderImpl.java&p1=webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/AbstractBuilder.java&r1=1734621&r2=1734681&rev=1734681&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/AbstractBuilder.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/BuilderImpl.java
Sat Mar 12 10:28:31 2016
@@ -21,30 +21,63 @@ package org.apache.axiom.om.impl.common.
 import org.apache.axiom.core.Builder;
 import org.apache.axiom.core.NodeFactory;
 import org.apache.axiom.core.stream.NamespaceRepairingFilterHandler;
-import org.apache.axiom.core.stream.XmlHandler;
+import org.apache.axiom.core.stream.StreamException;
+import org.apache.axiom.core.stream.XmlInput;
+import org.apache.axiom.core.stream.XmlReader;
+import org.apache.axiom.om.DeferredParsingException;
 import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.ds.custombuilder.CustomBuilder;
+import org.apache.axiom.om.ds.custombuilder.CustomBuilderSupport;
+import org.apache.axiom.om.ds.custombuilder.CustomBuilder.Selector;
+import org.apache.axiom.om.impl.builder.Detachable;
 import org.apache.axiom.om.impl.intf.AxiomDocument;
 import org.apache.axiom.om.impl.intf.AxiomSourcedElement;
 
-public abstract class AbstractBuilder implements OMXMLParserWrapper, Builder {
-    protected final BuilderHandler builderHandler;
-    protected final XmlHandler handler;
+public class BuilderImpl implements OMXMLParserWrapper, Builder, CustomBuilderSupport {
+    private final XmlReader reader;
+    private final Detachable detachable;
+    private final BuilderHandler builderHandler;
+    private final CustomBuilderManager customBuilderManager = new CustomBuilderManager();
 
-    public AbstractBuilder(NodeFactory nodeFactory, Model model, AxiomSourcedElement root,
boolean repairNamespaces) {
+    public BuilderImpl(XmlInput input, NodeFactory nodeFactory, Model model,
+            AxiomSourcedElement root, boolean repairNamespaces, Detachable detachable) {
         builderHandler = new BuilderHandler(nodeFactory, model, root, this);
-        handler = repairNamespaces ? new NamespaceRepairingFilterHandler(builderHandler,
null, false) : builderHandler;
+        reader = input.createReader(repairNamespaces ? new NamespaceRepairingFilterHandler(builderHandler,
null, false) : builderHandler);
+        this.detachable = detachable;
+        addListener(customBuilderManager);
     }
 
     public final void addListener(BuilderListener listener) {
         builderHandler.addListener(listener);
     }
+    
+    @Override
+    public void registerCustomBuilder(Selector selector, CustomBuilder customBuilder) {
+        customBuilderManager.register(selector, customBuilder);
+    }
+    
+    @Override
+    public void next() {
+        if (isCompleted()) {
+            throw new OMException();
+        }
+        try {
+            reader.proceed();
+        } catch (StreamException ex) {
+            throw new DeferredParsingException(ex);
+        }
+        builderHandler.executeDeferredActions();
+    }
 
+    @Override
     public final boolean isCompleted() {
         return builderHandler.isCompleted();
     }
 
+    @Override
     public final OMDocument getDocument() {
         AxiomDocument document;
         while ((document = builderHandler.getDocument()) == null) {
@@ -53,10 +86,12 @@ public abstract class AbstractBuilder im
         return document;
     }
     
+    @Override
     public final OMElement getDocumentElement() {
         return getDocumentElement(false);
     }
 
+    @Override
     public final OMElement getDocumentElement(boolean discardDocument) {
         OMDocument document = getDocument();
         OMElement element = document.getOMDocumentElement();
@@ -66,4 +101,20 @@ public abstract class AbstractBuilder im
         }
         return element;
     }
+
+    @Override
+    public final void close() {
+        reader.dispose();
+    }
+
+    @Override
+    public final void detach() throws OMException {
+        if (detachable != null) {
+            detachable.detach();
+        } else {
+            while (!isCompleted()) {
+                next();
+            }
+        }
+    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/Context.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/Context.java?rev=1734681&r1=1734680&r2=1734681&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/Context.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/Context.java
Sat Mar 12 10:28:31 2016
@@ -43,6 +43,8 @@ abstract class Context {
     
     abstract void startDocument(String inputEncoding, String xmlVersion, String xmlEncoding,
boolean standalone);
     
+    abstract void startFragment();
+    
     abstract void processDocumentTypeDeclaration(String rootName, String publicId, String
systemId,
             String internalSubset) throws StreamException;
     

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/UnwrappingContext.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/UnwrappingContext.java?rev=1734681&r1=1734680&r2=1734681&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/UnwrappingContext.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/UnwrappingContext.java
Sat Mar 12 10:28:31 2016
@@ -36,6 +36,10 @@ final class UnwrappingContext extends Co
     }
 
     @Override
+    void startFragment() {
+    }
+
+    @Override
     void processDocumentTypeDeclaration(String rootName, String publicId, String systemId,
             String internalSubset) throws StreamException {
         // TODO Auto-generated method stub

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AbstractOMMetaFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AbstractOMMetaFactory.java?rev=1734681&r1=1734680&r2=1734681&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AbstractOMMetaFactory.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AbstractOMMetaFactory.java
Sat Mar 12 10:28:31 2016
@@ -38,9 +38,8 @@ import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.impl.builder.Detachable;
+import org.apache.axiom.om.impl.common.builder.BuilderImpl;
 import org.apache.axiom.om.impl.common.builder.PlainXMLModel;
-import org.apache.axiom.om.impl.common.builder.PushBuilder;
-import org.apache.axiom.om.impl.common.builder.StAXOMBuilder;
 import org.apache.axiom.om.impl.stream.stax.StAXPullInput;
 import org.apache.axiom.om.util.StAXParserConfiguration;
 import org.apache.axiom.om.util.StAXUtils;
@@ -48,7 +47,7 @@ import org.apache.axiom.soap.SOAP12Const
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axiom.soap.SOAPModelBuilder;
 import org.apache.axiom.soap.SOAPProcessingException;
-import org.apache.axiom.soap.impl.common.builder.StAXSOAPModelBuilder;
+import org.apache.axiom.soap.impl.common.builder.SOAPModelBuilderImpl;
 import org.apache.axiom.util.stax.XMLEventUtils;
 import org.apache.axiom.util.stax.XMLFragmentStreamReader;
 import org.apache.axiom.util.stax.xop.MimePartProvider;
@@ -58,7 +57,7 @@ import org.xml.sax.InputSource;
 
 /**
  * Base class for {@link OMMetaFactory} implementations that make use of the standard builders
- * ({@link org.apache.axiom.om.impl.builder.StAXOMBuilder} and its subclasses).
+ * ({@link org.apache.axiom.om.impl.builder.BuilderImpl} and its subclasses).
  */
 public abstract class AbstractOMMetaFactory implements OMMetaFactory {
     private final static class SourceInfo {
@@ -168,13 +167,16 @@ public abstract class AbstractOMMetaFact
     }
     
     public OMXMLParserWrapper createStAXOMBuilder(OMFactory omFactory, XMLStreamReader parser)
{
-        return new StAXOMBuilder(nodeFactory, new StAXPullInput(getXMLStreamReader(parser),
false, null), null);
+        return new BuilderImpl(
+                new StAXPullInput(getXMLStreamReader(parser), false, null),
+                nodeFactory, PlainXMLModel.INSTANCE, null, true, null);
     }
 
     public OMXMLParserWrapper createOMBuilder(OMFactory omFactory, StAXParserConfiguration
configuration, InputSource is) {
         SourceInfo sourceInfo = createXMLStreamReader(configuration, is, true);
-        return new StAXOMBuilder(nodeFactory, new StAXPullInput(sourceInfo.getReader(), true,
-                sourceInfo.getCloseable()), sourceInfo.getDetachable());
+        return new BuilderImpl(
+                new StAXPullInput(sourceInfo.getReader(), true, sourceInfo.getCloseable()),
+                nodeFactory, PlainXMLModel.INSTANCE, null, false, sourceInfo.getDetachable());
     }
     
     private static InputSource toInputSource(StreamSource source) {
@@ -196,7 +198,9 @@ public abstract class AbstractOMMetaFact
                     toInputSource((StreamSource)source));
         } else {
             try {
-                return new StAXOMBuilder(nodeFactory, new StAXPullInput(StAXUtils.getXMLInputFactory().createXMLStreamReader(source),
true, null), null);
+                return new BuilderImpl(
+                        new StAXPullInput(StAXUtils.getXMLInputFactory().createXMLStreamReader(source),
true, null),
+                        nodeFactory, PlainXMLModel.INSTANCE, null, true, null);
             } catch (XMLStreamException ex) {
                 throw new OMException(ex);
             }
@@ -205,34 +209,35 @@ public abstract class AbstractOMMetaFact
 
     public OMXMLParserWrapper createOMBuilder(OMFactory omFactory, Node node,
             boolean expandEntityReferences) {
-        return new StAXOMBuilder(nodeFactory, new StAXPullInput(new DOMXMLStreamReader(node,
expandEntityReferences), true, null), null);
+        return new BuilderImpl(
+                new StAXPullInput(new DOMXMLStreamReader(node, expandEntityReferences), true,
null),
+                nodeFactory, PlainXMLModel.INSTANCE, null, true, null);
     }
 
     // TODO: don't need the omFactory argument anymore
     public OMXMLParserWrapper createOMBuilder(OMFactory omFactory, SAXSource source,
             boolean expandEntityReferences) {
-        return new PushBuilder(new SAXInput(source, expandEntityReferences), nodeFactory,
PlainXMLModel.INSTANCE, null, true);
+        return new BuilderImpl(new SAXInput(source, expandEntityReferences), nodeFactory,
PlainXMLModel.INSTANCE, null, true, null);
     }
 
     public OMXMLParserWrapper createOMBuilder(StAXParserConfiguration configuration,
             OMFactory omFactory, InputSource rootPart, MimePartProvider mimePartProvider)
{
         SourceInfo sourceInfo = createXMLStreamReader(configuration, rootPart, false);
-        return new StAXOMBuilder(
-                nodeFactory, 
-                new StAXPullInput(new XOPDecodingStreamReader(sourceInfo.getReader(), mimePartProvider),
true, sourceInfo.getCloseable()),
+        return new BuilderImpl(
+                new StAXPullInput(new XOPDecodingStreamReader(sourceInfo.getReader(), mimePartProvider),
true, sourceInfo.getCloseable()), 
+                nodeFactory, PlainXMLModel.INSTANCE, null, false,
                 mimePartProvider instanceof Detachable ? (Detachable)mimePartProvider : null);
     }
 
     public SOAPModelBuilder createStAXSOAPModelBuilder(XMLStreamReader parser) {
-        return new StAXSOAPModelBuilder(nodeFactory, new StAXPullInput(getXMLStreamReader(parser),
false, null), null);
+        return new SOAPModelBuilderImpl(new StAXPullInput(getXMLStreamReader(parser), false,
null), nodeFactory, true, null);
     }
 
     public SOAPModelBuilder createSOAPModelBuilder(StAXParserConfiguration configuration,
InputSource is) {
         SourceInfo sourceInfo = createXMLStreamReader(configuration, is, true);
-        return new StAXSOAPModelBuilder(
-                nodeFactory,
+        return new SOAPModelBuilderImpl(
                 new StAXPullInput(sourceInfo.getReader(), true, sourceInfo.getCloseable()),
-                sourceInfo.getDetachable());
+                nodeFactory, false, sourceInfo.getDetachable());
     }
 
     public SOAPModelBuilder createSOAPModelBuilder(Source source) {
@@ -240,13 +245,13 @@ public abstract class AbstractOMMetaFact
             // TODO: supporting this will require some refactoring of the builders
             throw new UnsupportedOperationException();
         } else if (source instanceof DOMSource) {
-            return new StAXSOAPModelBuilder(nodeFactory, new StAXPullInput(new DOMXMLStreamReader(((DOMSource)source).getNode(),
true), true, null), null);
+            return new SOAPModelBuilderImpl(new StAXPullInput(new DOMXMLStreamReader(((DOMSource)source).getNode(),
true), true, null), nodeFactory, true, null);
         } else if (source instanceof StreamSource) {
             return createSOAPModelBuilder(StAXParserConfiguration.SOAP,
                     toInputSource((StreamSource)source));
         } else {
             try {
-                return new StAXSOAPModelBuilder(nodeFactory, new StAXPullInput(StAXUtils.getXMLInputFactory().createXMLStreamReader(source),
true, null), null);
+                return new SOAPModelBuilderImpl(new StAXPullInput(StAXUtils.getXMLInputFactory().createXMLStreamReader(source),
true, null), nodeFactory, true, null);
             } catch (XMLStreamException ex) {
                 throw new OMException(ex);
             }
@@ -256,9 +261,9 @@ public abstract class AbstractOMMetaFact
     public SOAPModelBuilder createSOAPModelBuilder(StAXParserConfiguration configuration,
             SOAPFactory soapFactory, InputSource rootPart, MimePartProvider mimePartProvider)
{
         SourceInfo sourceInfo = createXMLStreamReader(configuration, rootPart, false);
-        StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(
-                nodeFactory,
+        SOAPModelBuilderImpl builder = new SOAPModelBuilderImpl(
                 new StAXPullInput(new XOPDecodingStreamReader(sourceInfo.getReader(), mimePartProvider),
true, sourceInfo.getCloseable()),
+                nodeFactory, false,
                 mimePartProvider instanceof Detachable ? (Detachable)mimePartProvider : null);
         if (builder.getSOAPMessage().getOMFactory() != soapFactory) {
             throw new SOAPProcessingException("Invalid SOAP namespace URI. " +

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj?rev=1734681&r1=1734680&r2=1734681&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/mixin/AxiomSourcedElementSupport.aj
Sat Mar 12 10:28:31 2016
@@ -34,9 +34,8 @@ import org.apache.axiom.om.OMXMLStreamRe
 import org.apache.axiom.om.QNameAwareOMDataSource;
 import org.apache.axiom.om.impl.common.DeferredNamespace;
 import org.apache.axiom.om.impl.common.OMNamespaceImpl;
+import org.apache.axiom.om.impl.common.builder.BuilderImpl;
 import org.apache.axiom.om.impl.common.builder.PlainXMLModel;
-import org.apache.axiom.om.impl.common.builder.PushBuilder;
-import org.apache.axiom.om.impl.common.builder.StAXOMBuilder;
 import org.apache.axiom.om.impl.common.util.OMDataSourceUtil;
 import org.apache.axiom.om.impl.intf.AxiomSourcedElement;
 import org.apache.axiom.om.impl.stream.ds.PushOMDataSourceInput;
@@ -220,7 +219,7 @@ public aspect AxiomSourcedElementSupport
             if (OMDataSourceUtil.isPushDataSource(dataSource)) {
                 // Disable namespace repairing because the OMDataSource is required to produce
well formed
                 // XML with respect to namespaces.
-                builder = new PushBuilder(new PushOMDataSourceInput(this, dataSource), coreGetNodeFactory(),
PlainXMLModel.INSTANCE, this, false);
+                builder = new BuilderImpl(new PushOMDataSourceInput(this, dataSource), coreGetNodeFactory(),
PlainXMLModel.INSTANCE, this, false, null);
             } else {
                 // Get the XMLStreamReader
                 XMLStreamReader readerFromDS;
@@ -229,7 +228,7 @@ public aspect AxiomSourcedElementSupport
                 } catch (XMLStreamException ex) {
                     throw new OMException("Error obtaining parser from data source for element
" + getPrintableName(), ex);
                 }
-                builder = new StAXOMBuilder(coreGetNodeFactory(), readerFromDS, this);
+                builder = new BuilderImpl(new StAXPullInput(readerFromDS), coreGetNodeFactory(),
PlainXMLModel.INSTANCE, this, true, null);
             }
             isExpanded = true;
             coreSetState(ATTRIBUTES_PENDING);

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/stream/ds/PushOMDataSourceReader.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/stream/ds/PushOMDataSourceReader.java?rev=1734681&r1=1734680&r2=1734681&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/stream/ds/PushOMDataSourceReader.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/stream/ds/PushOMDataSourceReader.java
Sat Mar 12 10:28:31 2016
@@ -56,7 +56,9 @@ final class PushOMDataSourceReader imple
                     writer.setPrefix(ns.getPrefix(), ns.getNamespaceURI());
                 }
             }
+            handler.startFragment();
             dataSource.serialize(new PushOMDataSourceStreamWriter(writer));
+            handler.completed();
         } catch (XMLStreamException ex) {
             throw new StreamException(ex);
         }

Copied: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/builder/SOAPModelBuilderImpl.java
(from r1734655, webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/builder/StAXSOAPModelBuilder.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/builder/SOAPModelBuilderImpl.java?p2=webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/builder/SOAPModelBuilderImpl.java&p1=webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/builder/StAXSOAPModelBuilder.java&r1=1734655&r2=1734681&rev=1734681&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/builder/StAXSOAPModelBuilder.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/builder/SOAPModelBuilderImpl.java
Sat Mar 12 10:28:31 2016
@@ -24,8 +24,8 @@ import org.apache.axiom.core.NodeFactory
 import org.apache.axiom.core.stream.XmlInput;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.impl.builder.Detachable;
+import org.apache.axiom.om.impl.common.builder.BuilderImpl;
 import org.apache.axiom.om.impl.common.builder.BuilderListener;
-import org.apache.axiom.om.impl.common.builder.StAXOMBuilder;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axiom.soap.SOAPMessage;
@@ -36,9 +36,9 @@ import org.apache.axiom.soap.impl.intf.A
 /**
  * Internal implementation class.
  */
-public class StAXSOAPModelBuilder extends StAXOMBuilder implements SOAPModelBuilder {
-    public StAXSOAPModelBuilder(NodeFactory nodeFactory, XmlInput input, Detachable detachable)
{
-        super(nodeFactory, input, detachable, new SOAPModel(), null);
+public class SOAPModelBuilderImpl extends BuilderImpl implements SOAPModelBuilder {
+    public SOAPModelBuilderImpl(XmlInput input, NodeFactory nodeFactory, boolean repairNamespaces,
Detachable detachable) {
+        super(input, nodeFactory, new SOAPModel(), null, true, detachable);
         // The SOAPFactory instance linked to the SOAPMessage is unknown until we reach the
         // SOAPEnvelope. Register a post-processor that does the necessary updates on the
         // SOAPMessage.

Modified: webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java?rev=1734681&r1=1734680&r2=1734681&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
(original)
+++ webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/abdera/parser/stax/FOMBuilder.java
Sat Mar 12 10:28:31 2016
@@ -28,19 +28,19 @@ import org.apache.axiom.core.CoreNode;
 import org.apache.axiom.fom.AbderaNode;
 import org.apache.axiom.fom.impl.FOMNodeFactory;
 import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.impl.common.builder.BuilderImpl;
 import org.apache.axiom.om.impl.common.builder.BuilderListener;
-import org.apache.axiom.om.impl.common.builder.StAXOMBuilder;
 import org.apache.axiom.om.impl.stream.stax.StAXPullInput;
 
 @SuppressWarnings("unchecked")
-public class FOMBuilder extends StAXOMBuilder implements Constants {
+public class FOMBuilder extends BuilderImpl implements Constants {
 
     private final FOMFactory fomfactory;
     private final ParserOptions parserOptions;
 
     public FOMBuilder(final FOMFactory factory, XMLStreamReader parser, ParserOptions parserOptions)
{
-        super(FOMNodeFactory.INSTANCE, new StAXPullInput(new FOMStAXFilter(parser, parserOptions),
false, null), null,
-                factory, null);
+        super(new StAXPullInput(new FOMStAXFilter(parser, parserOptions), false, null), FOMNodeFactory.INSTANCE,
+                factory, null, true, null); // TODO: probably we can use repairNamespaces=false
here
         this.parserOptions = parserOptions;
         this.fomfactory = factory;
         addListener(new BuilderListener() {



Mime
View raw message