ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1728801 - in /webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common: builder/BuilderHandler.java builder/StAXOMBuilder.java factory/SAXOMBuilder.java
Date Sat, 06 Feb 2016 09:42:04 GMT
Author: veithen
Date: Sat Feb  6 09:42:04 2016
New Revision: 1728801

URL: http://svn.apache.org/viewvc?rev=1728801&view=rev
Log:
Create documents in BuilderHandler.

Modified:
    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/StAXOMBuilder.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.java

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=1728801&r1=1728800&r2=1728801&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 Feb  6 09:42:04 2016
@@ -43,7 +43,7 @@ import org.apache.commons.logging.LogFac
 public final class BuilderHandler {
     private static final Log log = LogFactory.getLog(BuilderHandler.class);
     
-    public final NodeFactory nodeFactory;
+    private final NodeFactory nodeFactory;
     public final Model model;
     private final OMXMLParserWrapper builder;
     public AxiomContainer target;
@@ -94,6 +94,17 @@ public final class BuilderHandler {
         postProcessNode(node);
     }
     
+    public void startDocument(String inputEncoding, String xmlVersion, String xmlEncoding,
boolean standalone) {
+        document = nodeFactory.createNode(model.getDocumentType());
+        document.coreSetInputEncoding(inputEncoding);
+        document.coreSetXmlVersion(xmlVersion);
+        document.coreSetXmlEncoding(xmlEncoding);
+        document.coreSetStandalone(standalone);
+        document.coreSetBuilder(builder);
+        postProcessNode(document);
+        target = document;
+    }
+    
     public void createDocumentTypeDeclaration(String rootName, String publicId, String systemId,
             String internalSubset) {
         AxiomDocType node = nodeFactory.createNode(AxiomDocType.class);

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java?rev=1728801&r1=1728800&r2=1728801&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/builder/StAXOMBuilder.java
Sat Feb  6 09:42:04 2016
@@ -478,16 +478,7 @@ public class StAXOMBuilder implements Bu
     
     private void createDocumentIfNecessary() {
         if (handler.document == null && parser.getEventType() == XMLStreamReader.START_DOCUMENT)
{
-            handler.document = handler.nodeFactory.createNode(handler.model.getDocumentType());
-            if (charEncoding != null) {
-                handler.document.setCharsetEncoding(charEncoding);
-            }
-            handler.document.setXMLVersion(parser.getVersion());
-            handler.document.setXMLEncoding(parser.getCharacterEncodingScheme());
-            handler.document.setStandalone(parser.isStandalone() ? "yes" : "no");
-            handler.document.coreSetBuilder(this);
-            handler.target = handler.document;
-            handler.postProcessNode(handler.document);
+            handler.startDocument(charEncoding, parser.getVersion(), parser.getCharacterEncodingScheme(),
parser.isStandalone());
         }
     }
     

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.java?rev=1728801&r1=1728800&r2=1728801&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/SAXOMBuilder.java
Sat Feb  6 09:42:04 2016
@@ -50,9 +50,7 @@ public class SAXOMBuilder extends OMCont
     }
     
     protected void doStartDocument() {
-        handler.document = handler.nodeFactory.createNode(handler.model.getDocumentType());
-        handler.document.coreSetBuilder(this);
-        handler.target = handler.document;
+        handler.startDocument(null, "1.0", null, true);
     }
 
     protected void doEndDocument() {



Mime
View raw message