You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2011/10/29 17:20:02 UTC

svn commit: r1194904 - in /webservices/commons/trunk/modules/axiom/modules: axiom-api/src/main/java/org/apache/axiom/om/ axiom-api/src/main/java/org/apache/axiom/om/dom/ axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/

Author: veithen
Date: Sat Oct 29 15:20:02 2011
New Revision: 1194904

URL: http://svn.apache.org/viewvc?rev=1194904&view=rev
Log:
Added an API that allows to get a DocumentBuilderFactory for an Axiom implementation that supports DOM (without the need to directly depend on that implementation).

Added:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/DOMMetaFactory.java   (with props)
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/package.html   (with props)
Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAbstractFactory.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMMetaFactory.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAbstractFactory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAbstractFactory.java?rev=1194904&r1=1194903&r2=1194904&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAbstractFactory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAbstractFactory.java Sat Oct 29 15:20:02 2011
@@ -19,6 +19,7 @@
 
 package org.apache.axiom.om;
 
+import org.apache.axiom.om.dom.DOMMetaFactory;
 import org.apache.axiom.soap.SOAPFactory;
 
 /**
@@ -65,7 +66,8 @@ public class OMAbstractFactory {
     public static final String FEATURE_DEFAULT = "default";
     
     /**
-     * Feature for Axiom implementations that implement DOM in addition to the Axiom API.
+     * Feature for Axiom implementations that implement DOM in addition to the Axiom API. The
+     * {@link OMMetaFactory} for such an Axiom implementation must implement {@link DOMMetaFactory}.
      */
     public static final String FEATURE_DOM = "dom";
     

Added: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/DOMMetaFactory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/DOMMetaFactory.java?rev=1194904&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/DOMMetaFactory.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/DOMMetaFactory.java Sat Oct 29 15:20:02 2011
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.om.dom;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMMetaFactory;
+
+/**
+ * Extension interface for {@link OMMetaFactory} implementations that support
+ * {@link OMAbstractFactory#FEATURE_DOM}.
+ */
+public interface DOMMetaFactory extends OMMetaFactory {
+    /**
+     * Create a new {@link DocumentBuilderFactory}. Since Axiom doesn't support non namespace aware
+     * processing, the returned factory is always configured with <code>namespaceAware</code> set to
+     * <code>true</code> (in contrast to the default settings used by
+     * {@link DocumentBuilderFactory#newInstance()}).
+     * 
+     * @return the factory instance
+     */
+    DocumentBuilderFactory newDocumentBuilderFactory();
+}

Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/DOMMetaFactory.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/package.html
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/package.html?rev=1194904&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/package.html (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/package.html Sat Oct 29 15:20:02 2011
@@ -0,0 +1,23 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements. See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership. The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied. See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+<html>
+<body>
+Contains extension interfaces for Axiom implementations that support DOM.
+</body>
+</html>
\ No newline at end of file

Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/dom/package.html
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMMetaFactory.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMMetaFactory.java?rev=1194904&r1=1194903&r2=1194904&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMMetaFactory.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMMetaFactory.java Sat Oct 29 15:20:02 2011
@@ -19,8 +19,12 @@
 
 package org.apache.axiom.om.impl.dom.factory;
 
+import javax.xml.parsers.DocumentBuilderFactory;
+
 import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.dom.DOMMetaFactory;
 import org.apache.axiom.om.impl.common.factory.AbstractOMMetaFactory;
+import org.apache.axiom.om.impl.dom.jaxp.DOOMDocumentBuilderFactory;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axiom.soap.impl.dom.soap11.SOAP11Factory;
 import org.apache.axiom.soap.impl.dom.soap12.SOAP12Factory;
@@ -32,7 +36,7 @@ import org.apache.axiom.soap.impl.dom.so
  * Therefore {@link #getOMFactory()}, {@link #getSOAP11Factory()} and
  * {@link #getSOAP12Factory()} will return a new instance on every invocation.
  */
-public class OMDOMMetaFactory extends AbstractOMMetaFactory {
+public class OMDOMMetaFactory extends AbstractOMMetaFactory implements DOMMetaFactory {
     public OMFactory getOMFactory() {
         return new OMDOMFactory(this);
     }
@@ -44,4 +48,8 @@ public class OMDOMMetaFactory extends Ab
     public SOAPFactory getSOAP12Factory() {
         return new SOAP12Factory(this);
     }
+
+    public DocumentBuilderFactory newDocumentBuilderFactory() {
+        return new DOOMDocumentBuilderFactory();
+    }
 }