ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1694123 - in /webservices/axiom/trunk: aspects/core-aspects/src/main/java/org/apache/axiom/core/ aspects/dom-aspects/src/main/java/org/apache/axiom/dom/ aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/ implementations/axio...
Date Tue, 04 Aug 2015 23:10:51 GMT
Author: veithen
Date: Tue Aug  4 23:10:50 2015
New Revision: 1694123

URL: http://svn.apache.org/r1694123
Log:
Move some of the (OM)Document code to CoreDocument.

Modified:
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentSupport.aj
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocumentSupport.aj
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentSupport.aj?rev=1694123&r1=1694122&r2=1694123&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentSupport.aj
Tue Aug  4 23:10:50 2015
@@ -19,6 +19,11 @@
 package org.apache.axiom.core;
 
 public aspect CoreDocumentSupport {
+    private String CoreDocument.inputEncoding;
+    private String CoreDocument.xmlVersion = "1.0";
+    private String CoreDocument.xmlEncoding;
+    private boolean CoreDocument.standalone;
+    
     public final int CoreDocument.coreGetNodeType() {
         return DOCUMENT_NODE;
     }
@@ -43,4 +48,36 @@ public aspect CoreDocumentSupport {
         }
         return null;
     }
+    
+    public final String CoreDocument.coreGetInputEncoding() {
+        return inputEncoding;
+    }
+    
+    public final void CoreDocument.coreSetInputEncoding(String inputEncoding) {
+        this.inputEncoding = inputEncoding;
+    }
+    
+    public final String CoreDocument.coreGetXmlVersion() {
+        return xmlVersion;
+    }
+    
+    public final void CoreDocument.coreSetXmlVersion(String xmlVersion) {
+        this.xmlVersion = xmlVersion;
+    }
+    
+    public final String CoreDocument.coreGetXmlEncoding() {
+        return xmlEncoding;
+    }
+    
+    public final void CoreDocument.coreSetXmlEncoding(String xmlEncoding) {
+        this.xmlEncoding = xmlEncoding;
+    }
+    
+    public final boolean CoreDocument.coreIsStandalone() {
+        return standalone;
+    }
+    
+    public final void CoreDocument.coreSetStandalone(boolean standalone) {
+        this.standalone = standalone;
+    }
 }

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentSupport.aj?rev=1694123&r1=1694122&r2=1694123&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentSupport.aj
Tue Aug  4 23:10:50 2015
@@ -99,6 +99,30 @@ public aspect DOMDocumentSupport {
         return domConfig;
     }
 
+    public final String DOMDocument.getInputEncoding() {
+        return coreGetInputEncoding();
+    }
+
+    public final String DOMDocument.getXmlVersion() {
+        return coreGetXmlVersion();
+    }
+
+    public final void DOMDocument.setXmlVersion(String version) {
+        coreSetXmlVersion(version);
+    }
+
+    public final String DOMDocument.getXmlEncoding() {
+        return coreGetXmlEncoding();
+    }
+
+    public final boolean DOMDocument.getXmlStandalone() {
+        return coreIsStandalone();
+    }
+
+    public final void DOMDocument.setXmlStandalone(boolean standalone) {
+        coreSetStandalone(standalone);
+    }
+
     public final void DOMDocument.normalizeDocument() {
         if (domConfig.isEnabled(DOMConfigurationImpl.SPLIT_CDATA_SECTIONS)
                 || domConfig.isEnabled(DOMConfigurationImpl.WELLFORMED)) {

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocumentSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocumentSupport.aj?rev=1694123&r1=1694122&r2=1694123&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocumentSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocumentSupport.aj
Tue Aug  4 23:10:50 2015
@@ -74,4 +74,38 @@ public aspect AxiomDocumentSupport {
         serializer.serializeChildren(this, format, cache);
         serializer.writeEndDocument();
     }
+
+    public final String AxiomDocument.getCharsetEncoding() {
+        String inputEncoding = coreGetInputEncoding();
+        return inputEncoding == null ? "UTF-8" : inputEncoding;
+    }
+
+    public final void AxiomDocument.setCharsetEncoding(String charsetEncoding) {
+        coreSetInputEncoding(charsetEncoding);
+    }
+
+    public final String AxiomDocument.getXMLVersion() {
+        return coreGetXmlVersion();
+    }
+
+    public final void AxiomDocument.setXMLVersion(String xmlVersion) {
+        coreSetXmlVersion(xmlVersion);
+    }
+
+    public final String AxiomDocument.getXMLEncoding() {
+        return coreGetXmlEncoding();
+    }
+
+    public final void AxiomDocument.setXMLEncoding(String xmlEncoding) {
+        coreSetXmlEncoding(xmlEncoding);
+    }
+
+    public final String AxiomDocument.isStandalone() {
+        return coreIsStandalone() ? "yes" : "no";
+    }
+
+    public final void AxiomDocument.setStandalone(String standalone) {
+        coreSetStandalone("yes".equalsIgnoreCase(standalone));
+    }
+
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java?rev=1694123&r1=1694122&r2=1694123&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
Tue Aug  4 23:10:50 2015
@@ -49,14 +49,6 @@ import java.util.Iterator;
 import java.util.Vector;
 
 public class DocumentImpl extends ParentNode implements DOMDocument, AxiomDocument {
-    private String xmlVersion;
-
-    private String xmlEncoding;
-    
-    private boolean xmlStandalone = false;
-    
-    private String charEncoding;
-
     private Vector idAttrs;
 
     protected Hashtable identifiers;
@@ -236,41 +228,6 @@ public class DocumentImpl extends Parent
 
     }
 
-    // /
-    // /OMDocument Methods
-    // /
-    public String getCharsetEncoding() {
-        return this.charEncoding;
-    }
-
-    public String getXMLVersion() {
-        return this.xmlVersion;
-    }
-
-    public String isStandalone() {
-        return (this.xmlStandalone) ? "yes" : "no";
-    }
-
-    public void setCharsetEncoding(String charsetEncoding) {
-        this.charEncoding = charsetEncoding;
-    }
-
-    public void setStandalone(String isStandalone) {
-        this.xmlStandalone = "yes".equalsIgnoreCase(isStandalone);
-    }
-
-    public void setXMLVersion(String version) {
-        this.xmlVersion = version;
-    }
-
-    public String getXMLEncoding() {
-        return xmlEncoding;
-    }
-
-    public void setXMLEncoding(String encoding) {
-        this.xmlEncoding = encoding;
-    }
-    
     protected void addIdAttr(Attr attr) {
         if (this.idAttrs == null) {
             this.idAttrs = new Vector();
@@ -310,27 +267,11 @@ public class DocumentImpl extends Parent
         throw new UnsupportedOperationException("TODO");
     }
 
-    public String getInputEncoding() {
-        return charEncoding;
-    }
-
     public boolean getStrictErrorChecking() {
         // TODO TODO
         throw new UnsupportedOperationException("TODO");
     }
 
-    public String getXmlEncoding() {
-        return xmlEncoding;
-    }
-
-    public boolean getXmlStandalone() {
-        return this.xmlStandalone;
-    }
-
-    public String getXmlVersion() {
-        return getXMLVersion();
-    }
-
     public Node renameNode(Node node, String namespaceURI, String qualifiedName)
             throws DOMException {
         // TODO TODO
@@ -347,14 +288,6 @@ public class DocumentImpl extends Parent
         throw new UnsupportedOperationException("TODO");
     }
 
-    public void setXmlStandalone(boolean standalone) throws DOMException {
-        this.xmlStandalone = standalone;
-    }
-
-    public void setXmlVersion(String version) throws DOMException {
-        setXMLVersion(version);
-    }
-
     ParentNode shallowClone(OMCloneOptions options, ParentNode targetParent, boolean namespaceRepairing)
{
         DocumentImpl clone;
         if (options.isPreserveModel()) {
@@ -362,10 +295,10 @@ public class DocumentImpl extends Parent
         } else {
             clone = new DocumentImpl(getOMFactory());
         }
-        clone.xmlVersion = xmlVersion;
-        clone.xmlEncoding = xmlEncoding;
-        clone.xmlStandalone = xmlStandalone;
-        clone.charEncoding = charEncoding;
+        clone.coreSetXmlVersion(coreGetXmlVersion());
+        clone.coreSetXmlEncoding(coreGetXmlEncoding());
+        clone.coreSetStandalone(coreIsStandalone());
+        clone.coreSetInputEncoding(coreGetInputEncoding());
         return clone;
     }
 

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java?rev=1694123&r1=1694122&r2=1694123&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
Tue Aug  4 23:10:50 2015
@@ -32,16 +32,6 @@ import java.util.Iterator;
 
 /** Class OMDocumentImpl */
 public class OMDocumentImpl extends OMSerializableImpl implements AxiomDocument {
-    /** Field charSetEncoding Default : UTF-8 */
-    protected String charSetEncoding = "UTF-8";
-
-    /** Field xmlVersion */
-    protected String xmlVersion = "1.0";
-    
-    protected String xmlEncoding;
-
-    protected String isStandalone;
-
     /**
      * Create a <code>OMDocument</code> given the <code>OMFactory</code>
      *
@@ -68,38 +58,6 @@ public class OMDocumentImpl extends OMSe
     protected void checkDocumentElement(OMElement element) {
     }
 
-    public String getCharsetEncoding() {
-        return charSetEncoding;
-    }
-
-    public void setCharsetEncoding(String charEncoding) {
-        this.charSetEncoding = charEncoding;
-    }
-
-    public String isStandalone() {
-        return isStandalone;
-    }
-
-    public void setStandalone(String isStandalone) {
-        this.isStandalone = isStandalone;
-    }
-
-    public String getXMLVersion() {
-        return xmlVersion;
-    }
-
-    public void setXMLVersion(String xmlVersion) {
-        this.xmlVersion = xmlVersion;
-    }
-
-    public String getXMLEncoding() {
-        return xmlEncoding;
-    }
-
-    public void setXMLEncoding(String encoding) {
-        this.xmlEncoding = encoding;
-    }
-
     void notifyChildComplete() {
         if (getState() == INCOMPLETE && getBuilder() == null) {
             Iterator iterator = getChildren();
@@ -124,10 +82,10 @@ public class OMDocumentImpl extends OMSe
         } else {
             targetDocument = getOMFactory().createOMDocument();
         }
-        targetDocument.setXMLVersion(xmlVersion);
-        targetDocument.setXMLEncoding(xmlEncoding);
-        targetDocument.setCharsetEncoding(charSetEncoding);
-        targetDocument.setStandalone(isStandalone);
+        targetDocument.setXMLVersion(getXMLVersion());
+        targetDocument.setXMLEncoding(getXMLEncoding());
+        targetDocument.setCharsetEncoding(getCharsetEncoding());
+        targetDocument.setStandalone(isStandalone());
         for (Iterator it = getChildren(); it.hasNext(); ) {
             ((OMNodeImpl)it.next()).clone(options, targetDocument);
         }



Mime
View raw message