Author: veithen
Date: Sat Sep 19 22:58:50 2015
New Revision: 1704090
URL: http://svn.apache.org/viewvc?rev=1704090&view=rev
Log:
Build node factories dynamically.
Added:
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactoryException.java
(with props)
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactoryImpl.java
(with props)
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/util/
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/util/EdgeRelation.java
(with props)
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/util/TopologicalSort.java
(with props)
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/om/impl/dom/nodetypes.index
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/nodetypes.index
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/soap11/
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/soap11/nodetypes.index
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/soap12/
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/soap12/nodetypes.index
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/om/
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/om/impl/
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/om/impl/llom/
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/om/impl/llom/nodetypes.index
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/nodetypes.index
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/soap11/
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/soap11/nodetypes.index
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/soap12/
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/soap12/nodetypes.index
webservices/axiom/trunk/implementations/fom-impl/src/main/resources/org/
webservices/axiom/trunk/implementations/fom-impl/src/main/resources/org/apache/
webservices/axiom/trunk/implementations/fom-impl/src/main/resources/org/apache/abdera/
webservices/axiom/trunk/implementations/fom-impl/src/main/resources/org/apache/abdera/parser/
webservices/axiom/trunk/implementations/fom-impl/src/main/resources/org/apache/abdera/parser/stax/
webservices/axiom/trunk/implementations/fom-impl/src/main/resources/org/apache/abdera/parser/stax/nodetypes.index
Modified:
webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/DOOMNodeFactory.java
webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/LLOMNodeFactory.java
webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/axiom/fom/impl/FOMNodeFactory.java
Added:
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactoryException.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactoryException.java?rev=1704090&view=auto
==============================================================================
---
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactoryException.java
(added)
+++
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactoryException.java
Sat Sep 19 22:58:50 2015
@@ -0,0 +1,31 @@
+/*
+ * 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.core;
+
+public class NodeFactoryException extends RuntimeException {
+ private static final long serialVersionUID = 1L;
+
+ public NodeFactoryException(String message) {
+ super(message);
+ }
+
+ public NodeFactoryException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
Propchange:
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactoryException.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactoryImpl.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactoryImpl.java?rev=1704090&view=auto
==============================================================================
---
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactoryImpl.java
(added)
+++
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactoryImpl.java
Sat Sep 19 22:58:50 2015
@@ -0,0 +1,128 @@
+/*
+ * 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.core;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.axiom.core.util.EdgeRelation;
+import org.apache.axiom.core.util.TopologicalSort;
+
+public class NodeFactoryImpl implements NodeFactory {
+ private final Map<Class<?>,Constructor<?>> constructorMap;
+
+ public NodeFactoryImpl(ClassLoader cl, String... packages) {
+ List<Class<?>> implementations = new ArrayList<Class<?>>();
+ for (String pkg : packages) {
+ try {
+ BufferedReader in = new BufferedReader(new
InputStreamReader(cl.getResourceAsStream(pkg.replace('.', '/') +
"/nodetypes.index"), "UTF-8"));
+ try {
+ String line;
+ while ((line = in.readLine()) != null) {
+ if (line.startsWith("#")) {
+ continue;
+ }
+ String className = pkg + "." + line;
+ try {
+ implementations.add(cl.loadClass(className));
+ } catch (ClassNotFoundException ex) {
+ throw new NodeFactoryException("Failed to load
class " + className, ex);
+ }
+ }
+ } finally {
+ in.close();
+ }
+ } catch (IOException ex) {
+ throw new NodeFactoryException("Failed to load node type index
for package " + pkg, ex);
+ }
+ }
+ implementations = TopologicalSort.sort(implementations, new
EdgeRelation<Class<?>>() {
+ public boolean isEdge(Class<?> from, Class<?> to) {
+ return to.isAssignableFrom(from);
+ }
+ });
+ Map<Class<?>,Class<?>> interfaceToImplementationMap = new
HashMap<Class<?>,Class<?>>();
+ Map<Class<?>,Constructor<?>> implementationToConstructorMap = new
HashMap<Class<?>,Constructor<?>>();
+ Set<Class<?>> ambiguousInterfaces = new HashSet<Class<?>>();
+ for (Class<?> implementation : implementations) {
+ Set<Class<?>> interfaces = new HashSet<Class<?>>();
+ collectInterfaces(implementation, interfaces);
+ for (Class<?> iface : interfaces) {
+ if (!ambiguousInterfaces.contains(iface)) {
+ Class<?> clazz = interfaceToImplementationMap.get(iface);
+ if (clazz == null ||
implementation.isAssignableFrom(clazz)) {
+ interfaceToImplementationMap.put(iface,
implementation);
+ } else if (!clazz.isAssignableFrom(implementation)) {
+ interfaceToImplementationMap.remove(iface);
+ ambiguousInterfaces.add(iface);
+ }
+ }
+ }
+ try {
+ implementationToConstructorMap.put(implementation,
implementation.getConstructor());
+ } catch (NoSuchMethodException ex) {
+ throw new NodeFactoryException("Failed to get constructor for
" + implementation.getName(), ex);
+ }
+ }
+ constructorMap = new HashMap<Class<?>,Constructor<?>>();
+ for (Map.Entry<Class<?>,Class<?>> entry :
interfaceToImplementationMap.entrySet()) {
+ constructorMap.put(entry.getKey(),
implementationToConstructorMap.get(entry.getValue()));
+ }
+ // TODO: this should eventually go away
+ constructorMap.putAll(implementationToConstructorMap);
+ }
+
+ private static void collectInterfaces(Class<?> clazz, Set<Class<?>>
interfaces) {
+ for (Class<?> iface : clazz.getInterfaces()) {
+ if (interfaces.add(iface)) {
+ collectInterfaces(iface, interfaces);
+ }
+ }
+ Class<?> superclass = clazz.getSuperclass();
+ if (superclass != null) {
+ collectInterfaces(superclass, interfaces);
+ }
+ }
+
+ public final <T extends CoreNode> T createNode(Class<T> type) {
+ Constructor<?> constructor = constructorMap.get(type);
+ if (constructor == null) {
+ throw new NodeFactoryException("Unknown node type " +
type.getName());
+ } else {
+ try {
+ return type.cast(constructor.newInstance());
+ } catch (InvocationTargetException ex) {
+ throw new NodeFactoryException("Caught exception thrown by
constructor", ex.getCause());
+ } catch (InstantiationException ex) {
+ throw new NodeFactoryException("Failed to invoke constructor",
ex);
+ } catch (IllegalAccessException ex) {
+ throw new NodeFactoryException("Failed to invoke constructor",
ex);
+ }
+ }
+ }
+}
Propchange:
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/NodeFactoryImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/util/EdgeRelation.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/util/EdgeRelation.java?rev=1704090&view=auto
==============================================================================
---
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/util/EdgeRelation.java
(added)
+++
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/util/EdgeRelation.java
Sat Sep 19 22:58:50 2015
@@ -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.
+ */
+package org.apache.axiom.core.util;
+
+public interface EdgeRelation<T> {
+ boolean isEdge(T from, T to);
+}
Propchange:
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/util/EdgeRelation.java
------------------------------------------------------------------------------
svn:eol-style = native
Added:
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/util/TopologicalSort.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/util/TopologicalSort.java?rev=1704090&view=auto
==============================================================================
---
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/util/TopologicalSort.java
(added)
+++
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/util/TopologicalSort.java
Sat Sep 19 22:58:50 2015
@@ -0,0 +1,64 @@
+/*
+ * 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.core.util;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Implements topological sorting.
+ */
+public final class TopologicalSort {
+ private TopologicalSort() {}
+
+ private static <T> void visit(Collection<T> vertices, EdgeRelation<? super
T> edgeRelation, List<T> result, Set<T> visited, T vertex) {
+ if (visited.add(vertex)) {
+ for (T vertex2 : vertices) {
+ if (vertex2 != vertex && edgeRelation.isEdge(vertex, vertex2))
{
+ visit(vertices, edgeRelation, result, visited, vertex2);
+ }
+ }
+ result.add(vertex);
+ }
+ }
+
+ /**
+ * Apply topological ordering to a given collection.
+ *
+ * @param <T>
+ * the vertex type
+ * @param vertices
+ * the vertices of the directed acyclic graph
+ * @param edgeRelation
+ * the relation defining the edges of the graph
+ * @return the topologically sorted list of vertices, where the vertices
with no incoming edges
+ * come first
+ */
+ public static <T> List<T> sort(Collection<T> vertices, EdgeRelation<?
super T> edgeRelation) {
+ List<T> result = new ArrayList<T>(vertices.size());
+ Set<T> visited = new HashSet<T>();
+ for (T vertex : vertices) {
+ visit(vertices, edgeRelation, result, visited, vertex);
+ }
+ return result;
+ }
+}
Propchange:
webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/util/TopologicalSort.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified:
webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/DOOMNodeFactory.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/DOOMNodeFactory.java?rev=1704090&r1=1704089&r2=1704090&view=diff
==============================================================================
---
webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/DOOMNodeFactory.java
(original)
+++
webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/DOOMNodeFactory.java
Sat Sep 19 22:58:50 2015
@@ -18,190 +18,17 @@
*/
package org.apache.axiom.om.impl.dom.factory;
-import org.apache.axiom.core.CoreCDATASection;
-import org.apache.axiom.core.CoreCharacterDataNode;
-import org.apache.axiom.core.CoreComment;
-import org.apache.axiom.core.CoreDocument;
-import org.apache.axiom.core.CoreDocumentFragment;
-import org.apache.axiom.core.CoreDocumentTypeDeclaration;
-import org.apache.axiom.core.CoreEntityReference;
-import org.apache.axiom.core.CoreNSAwareAttribute;
-import org.apache.axiom.core.CoreNSAwareElement;
-import org.apache.axiom.core.CoreNSUnawareAttribute;
-import org.apache.axiom.core.CoreNSUnawareElement;
-import org.apache.axiom.core.CoreNamespaceDeclaration;
-import org.apache.axiom.core.CoreNode;
-import org.apache.axiom.core.CoreProcessingInstruction;
-import org.apache.axiom.dom.DOMCDATASection;
-import org.apache.axiom.dom.DOMComment;
-import org.apache.axiom.dom.DOMDocument;
-import org.apache.axiom.dom.DOMDocumentFragment;
-import org.apache.axiom.dom.DOMDocumentType;
-import org.apache.axiom.dom.DOMEntityReference;
-import org.apache.axiom.dom.DOMNSAwareAttribute;
-import org.apache.axiom.dom.DOMNSAwareElement;
-import org.apache.axiom.dom.DOMNSUnawareAttribute;
-import org.apache.axiom.dom.DOMNSUnawareElement;
-import org.apache.axiom.dom.DOMNamespaceDeclaration;
+import org.apache.axiom.core.NodeFactoryImpl;
import org.apache.axiom.dom.DOMNodeFactory;
-import org.apache.axiom.dom.DOMProcessingInstruction;
-import org.apache.axiom.dom.DOMText;
-import org.apache.axiom.om.impl.common.AxiomAttribute;
-import org.apache.axiom.om.impl.common.AxiomCDATASection;
-import org.apache.axiom.om.impl.common.AxiomCharacterDataNode;
-import org.apache.axiom.om.impl.common.AxiomComment;
-import org.apache.axiom.om.impl.common.AxiomDocType;
-import org.apache.axiom.om.impl.common.AxiomDocument;
-import org.apache.axiom.om.impl.common.AxiomElement;
-import org.apache.axiom.om.impl.common.AxiomEntityReference;
-import org.apache.axiom.om.impl.common.AxiomNamespaceDeclaration;
-import org.apache.axiom.om.impl.common.AxiomProcessingInstruction;
-import org.apache.axiom.om.impl.common.AxiomSourcedElement;
-import org.apache.axiom.om.impl.dom.CDATASectionImpl;
-import org.apache.axiom.om.impl.dom.CommentImpl;
-import org.apache.axiom.om.impl.dom.DocumentFragmentImpl;
-import org.apache.axiom.om.impl.dom.DocumentImpl;
-import org.apache.axiom.om.impl.dom.DocumentTypeImpl;
-import org.apache.axiom.om.impl.dom.EntityReferenceImpl;
-import org.apache.axiom.om.impl.dom.NSAwareAttribute;
-import org.apache.axiom.om.impl.dom.NSAwareElement;
-import org.apache.axiom.om.impl.dom.NSUnawareAttribute;
-import org.apache.axiom.om.impl.dom.NSUnawareElement;
-import org.apache.axiom.om.impl.dom.NamespaceDeclaration;
-import org.apache.axiom.om.impl.dom.OMSourcedElementImpl;
-import org.apache.axiom.om.impl.dom.ProcessingInstructionImpl;
-import org.apache.axiom.om.impl.dom.TextImpl;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11Body;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11Envelope;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11Fault;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11FaultCode;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11FaultDetail;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11FaultReason;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11FaultRole;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11Header;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11HeaderBlock;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12Body;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12Envelope;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12Fault;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultCode;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultDetail;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultNode;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultReason;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultRole;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultSubCode;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultText;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultValue;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12Header;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12HeaderBlock;
-import org.apache.axiom.soap.impl.common.AxiomSOAPMessage;
-import org.apache.axiom.soap.impl.dom.SOAPMessageImpl;
-import org.apache.axiom.soap.impl.dom.soap11.SOAP11BodyImpl;
-import org.apache.axiom.soap.impl.dom.soap11.SOAP11EnvelopeImpl;
-import org.apache.axiom.soap.impl.dom.soap11.SOAP11FaultCodeImpl;
-import org.apache.axiom.soap.impl.dom.soap11.SOAP11FaultDetailImpl;
-import org.apache.axiom.soap.impl.dom.soap11.SOAP11FaultImpl;
-import org.apache.axiom.soap.impl.dom.soap11.SOAP11FaultReasonImpl;
-import org.apache.axiom.soap.impl.dom.soap11.SOAP11FaultRoleImpl;
-import org.apache.axiom.soap.impl.dom.soap11.SOAP11HeaderBlockImpl;
-import org.apache.axiom.soap.impl.dom.soap11.SOAP11HeaderImpl;
-import org.apache.axiom.soap.impl.dom.soap12.SOAP12BodyImpl;
-import org.apache.axiom.soap.impl.dom.soap12.SOAP12EnvelopeImpl;
-import org.apache.axiom.soap.impl.dom.soap12.SOAP12FaultCodeImpl;
-import org.apache.axiom.soap.impl.dom.soap12.SOAP12FaultDetailImpl;
-import org.apache.axiom.soap.impl.dom.soap12.SOAP12FaultImpl;
-import org.apache.axiom.soap.impl.dom.soap12.SOAP12FaultNodeImpl;
-import org.apache.axiom.soap.impl.dom.soap12.SOAP12FaultReasonImpl;
-import org.apache.axiom.soap.impl.dom.soap12.SOAP12FaultRoleImpl;
-import org.apache.axiom.soap.impl.dom.soap12.SOAP12FaultSubCodeImpl;
-import org.apache.axiom.soap.impl.dom.soap12.SOAP12FaultTextImpl;
-import org.apache.axiom.soap.impl.dom.soap12.SOAP12FaultValueImpl;
-import org.apache.axiom.soap.impl.dom.soap12.SOAP12HeaderBlockImpl;
-import org.apache.axiom.soap.impl.dom.soap12.SOAP12HeaderImpl;
-public final class DOOMNodeFactory implements DOMNodeFactory {
+public final class DOOMNodeFactory extends NodeFactoryImpl implements
DOMNodeFactory {
public static final DOOMNodeFactory INSTANCE = new DOOMNodeFactory();
- private DOOMNodeFactory() {}
-
- public final <T extends CoreNode> T createNode(Class<T> type) {
- CoreNode node;
- if (type == CoreCDATASection.class || type == AxiomCDATASection.class
|| type == DOMCDATASection.class) {
- node = new CDATASectionImpl();
- } else if (type == CoreCharacterDataNode.class || type ==
AxiomCharacterDataNode.class || type == DOMText.class) {
- node = new TextImpl();
- } else if (type == CoreComment.class || type == AxiomComment.class ||
type == DOMComment.class) {
- node = new CommentImpl();
- } else if (type == CoreDocument.class || type == AxiomDocument.class
|| type == DOMDocument.class) {
- node = new DocumentImpl();
- } else if (type == CoreDocumentFragment.class || type ==
DOMDocumentFragment.class) {
- node = new DocumentFragmentImpl();
- } else if (type == CoreDocumentTypeDeclaration.class || type ==
AxiomDocType.class || type == DOMDocumentType.class) {
- node = new DocumentTypeImpl();
- } else if (type == CoreEntityReference.class || type ==
AxiomEntityReference.class || type == DOMEntityReference.class) {
- node = new EntityReferenceImpl();
- } else if (type == CoreNamespaceDeclaration.class || type ==
AxiomNamespaceDeclaration.class || type == DOMNamespaceDeclaration.class) {
- node = new NamespaceDeclaration();
- } else if (type == CoreNSAwareAttribute.class || type ==
AxiomAttribute.class || type == DOMNSAwareAttribute.class) {
- node = new NSAwareAttribute();
- } else if (type == CoreNSAwareElement.class || type ==
AxiomElement.class || type == DOMNSAwareElement.class) {
- node = new NSAwareElement();
- } else if (type == CoreNSUnawareAttribute.class || type ==
DOMNSUnawareAttribute.class) {
- node = new NSUnawareAttribute();
- } else if (type == CoreNSUnawareElement.class || type ==
DOMNSUnawareElement.class) {
- node = new NSUnawareElement();
- } else if (type == CoreProcessingInstruction.class || type ==
AxiomProcessingInstruction.class || type == DOMProcessingInstruction.class) {
- node = new ProcessingInstructionImpl();
- } else if (type == AxiomSourcedElement.class) {
- node = new OMSourcedElementImpl();
- } else if (type == AxiomSOAPMessage.class) {
- node = new SOAPMessageImpl();
- } else if (type == AxiomSOAP11Envelope.class) {
- node = new SOAP11EnvelopeImpl();
- } else if (type == AxiomSOAP12Envelope.class) {
- node = new SOAP12EnvelopeImpl();
- } else if (type == AxiomSOAP11Header.class) {
- node = new SOAP11HeaderImpl();
- } else if (type == AxiomSOAP12Header.class) {
- node = new SOAP12HeaderImpl();
- } else if (type == AxiomSOAP11HeaderBlock.class) {
- node = new SOAP11HeaderBlockImpl();
- } else if (type == AxiomSOAP12HeaderBlock.class) {
- node = new SOAP12HeaderBlockImpl();
- } else if (type == AxiomSOAP11Body.class) {
- node = new SOAP11BodyImpl();
- } else if (type == AxiomSOAP12Body.class) {
- node = new SOAP12BodyImpl();
- } else if (type == AxiomSOAP11Fault.class) {
- node = new SOAP11FaultImpl();
- } else if (type == AxiomSOAP12Fault.class) {
- node = new SOAP12FaultImpl();
- } else if (type == AxiomSOAP11FaultCode.class) {
- node = new SOAP11FaultCodeImpl();
- } else if (type == AxiomSOAP12FaultCode.class) {
- node = new SOAP12FaultCodeImpl();
- } else if (type == AxiomSOAP12FaultValue.class) {
- node = new SOAP12FaultValueImpl();
- } else if (type == AxiomSOAP12FaultSubCode.class) {
- node = new SOAP12FaultSubCodeImpl();
- } else if (type == AxiomSOAP11FaultReason.class) {
- node = new SOAP11FaultReasonImpl();
- } else if (type == AxiomSOAP12FaultReason.class) {
- node = new SOAP12FaultReasonImpl();
- } else if (type == AxiomSOAP12FaultText.class) {
- node = new SOAP12FaultTextImpl();
- } else if (type == AxiomSOAP12FaultNode.class) {
- node = new SOAP12FaultNodeImpl();
- } else if (type == AxiomSOAP11FaultRole.class) {
- node = new SOAP11FaultRoleImpl();
- } else if (type == AxiomSOAP12FaultRole.class) {
- node = new SOAP12FaultRoleImpl();
- } else if (type == AxiomSOAP11FaultDetail.class) {
- node = new SOAP11FaultDetailImpl();
- } else if (type == AxiomSOAP12FaultDetail.class) {
- node = new SOAP12FaultDetailImpl();
- } else {
- throw new IllegalArgumentException();
- }
- return type.cast(node);
+ private DOOMNodeFactory() {
+ super(DOOMNodeFactory.class.getClassLoader(),
+ "org.apache.axiom.om.impl.dom",
+ "org.apache.axiom.soap.impl.dom",
+ "org.apache.axiom.soap.impl.dom.soap11",
+ "org.apache.axiom.soap.impl.dom.soap12");
}
}
Added:
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/om/impl/dom/nodetypes.index
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/om/impl/dom/nodetypes.index?rev=1704090&view=auto
==============================================================================
---
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/om/impl/dom/nodetypes.index
(added)
+++
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/om/impl/dom/nodetypes.index
Sat Sep 19 22:58:50 2015
@@ -0,0 +1,32 @@
+#
+# 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.
+#
+CDATASectionImpl
+CommentImpl
+DocumentFragmentImpl
+DocumentImpl
+DocumentTypeImpl
+EntityReferenceImpl
+NamespaceDeclaration
+NSAwareAttribute
+NSAwareElement
+NSUnawareAttribute
+NSUnawareElement
+OMSourcedElementImpl
+ProcessingInstructionImpl
+TextImpl
Added:
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/nodetypes.index
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/nodetypes.index?rev=1704090&view=auto
==============================================================================
---
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/nodetypes.index
(added)
+++
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/nodetypes.index
Sat Sep 19 22:58:50 2015
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+SOAPMessageImpl
Added:
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/soap11/nodetypes.index
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/soap11/nodetypes.index?rev=1704090&view=auto
==============================================================================
---
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/soap11/nodetypes.index
(added)
+++
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/soap11/nodetypes.index
Sat Sep 19 22:58:50 2015
@@ -0,0 +1,27 @@
+#
+# 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.
+#
+SOAP11BodyImpl
+SOAP11EnvelopeImpl
+SOAP11FaultCodeImpl
+SOAP11FaultDetailImpl
+SOAP11FaultImpl
+SOAP11FaultReasonImpl
+SOAP11FaultRoleImpl
+SOAP11HeaderBlockImpl
+SOAP11HeaderImpl
Added:
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/soap12/nodetypes.index
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/soap12/nodetypes.index?rev=1704090&view=auto
==============================================================================
---
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/soap12/nodetypes.index
(added)
+++
webservices/axiom/trunk/implementations/axiom-dom/src/main/resources/org/apache/axiom/soap/impl/dom/soap12/nodetypes.index
Sat Sep 19 22:58:50 2015
@@ -0,0 +1,31 @@
+#
+# 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.
+#
+SOAP12BodyImpl
+SOAP12EnvelopeImpl
+SOAP12FaultCodeImpl
+SOAP12FaultDetailImpl
+SOAP12FaultImpl
+SOAP12FaultNodeImpl
+SOAP12FaultReasonImpl
+SOAP12FaultRoleImpl
+SOAP12FaultSubCodeImpl
+SOAP12FaultTextImpl
+SOAP12FaultValueImpl
+SOAP12HeaderBlockImpl
+SOAP12HeaderImpl
Modified:
webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/LLOMNodeFactory.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/LLOMNodeFactory.java?rev=1704090&r1=1704089&r2=1704090&view=diff
==============================================================================
---
webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/LLOMNodeFactory.java
(original)
+++
webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/LLOMNodeFactory.java
Sat Sep 19 22:58:50 2015
@@ -18,165 +18,16 @@
*/
package org.apache.axiom.om.impl.llom.factory;
-import org.apache.axiom.core.CoreCDATASection;
-import org.apache.axiom.core.CoreCharacterDataNode;
-import org.apache.axiom.core.CoreComment;
-import org.apache.axiom.core.CoreDocument;
-import org.apache.axiom.core.CoreDocumentTypeDeclaration;
-import org.apache.axiom.core.CoreEntityReference;
-import org.apache.axiom.core.CoreNSAwareAttribute;
-import org.apache.axiom.core.CoreNSAwareElement;
-import org.apache.axiom.core.CoreNamespaceDeclaration;
-import org.apache.axiom.core.CoreNode;
-import org.apache.axiom.core.CoreProcessingInstruction;
-import org.apache.axiom.core.NodeFactory;
-import org.apache.axiom.om.impl.common.AxiomAttribute;
-import org.apache.axiom.om.impl.common.AxiomCDATASection;
-import org.apache.axiom.om.impl.common.AxiomCharacterDataNode;
-import org.apache.axiom.om.impl.common.AxiomComment;
-import org.apache.axiom.om.impl.common.AxiomDocType;
-import org.apache.axiom.om.impl.common.AxiomDocument;
-import org.apache.axiom.om.impl.common.AxiomElement;
-import org.apache.axiom.om.impl.common.AxiomEntityReference;
-import org.apache.axiom.om.impl.common.AxiomNamespaceDeclaration;
-import org.apache.axiom.om.impl.common.AxiomProcessingInstruction;
-import org.apache.axiom.om.impl.common.AxiomSourcedElement;
-import org.apache.axiom.om.impl.llom.CDATASectionImpl;
-import org.apache.axiom.om.impl.llom.CharacterDataImpl;
-import org.apache.axiom.om.impl.llom.NamespaceDeclaration;
-import org.apache.axiom.om.impl.llom.OMAttributeImpl;
-import org.apache.axiom.om.impl.llom.OMCommentImpl;
-import org.apache.axiom.om.impl.llom.OMDocTypeImpl;
-import org.apache.axiom.om.impl.llom.OMDocumentImpl;
-import org.apache.axiom.om.impl.llom.OMElementImpl;
-import org.apache.axiom.om.impl.llom.OMEntityReferenceImpl;
-import org.apache.axiom.om.impl.llom.OMProcessingInstructionImpl;
-import org.apache.axiom.om.impl.llom.OMSourcedElementImpl;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11Body;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11Envelope;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11Fault;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11FaultCode;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11FaultDetail;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11FaultReason;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11FaultRole;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11Header;
-import org.apache.axiom.soap.impl.common.AxiomSOAP11HeaderBlock;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12Body;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12Envelope;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12Fault;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultCode;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultDetail;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultNode;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultReason;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultRole;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultSubCode;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultText;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12FaultValue;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12Header;
-import org.apache.axiom.soap.impl.common.AxiomSOAP12HeaderBlock;
-import org.apache.axiom.soap.impl.common.AxiomSOAPMessage;
-import org.apache.axiom.soap.impl.llom.SOAPMessageImpl;
-import org.apache.axiom.soap.impl.llom.soap11.SOAP11BodyImpl;
-import org.apache.axiom.soap.impl.llom.soap11.SOAP11EnvelopeImpl;
-import org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultCodeImpl;
-import org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultDetailImpl;
-import org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultImpl;
-import org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultReasonImpl;
-import org.apache.axiom.soap.impl.llom.soap11.SOAP11FaultRoleImpl;
-import org.apache.axiom.soap.impl.llom.soap11.SOAP11HeaderBlockImpl;
-import org.apache.axiom.soap.impl.llom.soap11.SOAP11HeaderImpl;
-import org.apache.axiom.soap.impl.llom.soap12.SOAP12BodyImpl;
-import org.apache.axiom.soap.impl.llom.soap12.SOAP12EnvelopeImpl;
-import org.apache.axiom.soap.impl.llom.soap12.SOAP12FaultCodeImpl;
-import org.apache.axiom.soap.impl.llom.soap12.SOAP12FaultDetailImpl;
-import org.apache.axiom.soap.impl.llom.soap12.SOAP12FaultImpl;
-import org.apache.axiom.soap.impl.llom.soap12.SOAP12FaultNodeImpl;
-import org.apache.axiom.soap.impl.llom.soap12.SOAP12FaultReasonImpl;
-import org.apache.axiom.soap.impl.llom.soap12.SOAP12FaultRoleImpl;
-import org.apache.axiom.soap.impl.llom.soap12.SOAP12FaultSubCodeImpl;
-import org.apache.axiom.soap.impl.llom.soap12.SOAP12FaultTextImpl;
-import org.apache.axiom.soap.impl.llom.soap12.SOAP12FaultValueImpl;
-import org.apache.axiom.soap.impl.llom.soap12.SOAP12HeaderBlockImpl;
-import org.apache.axiom.soap.impl.llom.soap12.SOAP12HeaderImpl;
+import org.apache.axiom.core.NodeFactoryImpl;
-public final class LLOMNodeFactory implements NodeFactory {
+public final class LLOMNodeFactory extends NodeFactoryImpl {
public static LLOMNodeFactory INSTANCE = new LLOMNodeFactory();
- private LLOMNodeFactory() {}
-
- public <T extends CoreNode> T createNode(Class<T> type) {
- CoreNode node;
- if (type == CoreCDATASection.class || type == AxiomCDATASection.class)
{
- node = new CDATASectionImpl();
- } else if (type == CoreCharacterDataNode.class || type ==
AxiomCharacterDataNode.class) {
- node = new CharacterDataImpl();
- } else if (type == CoreComment.class || type == AxiomComment.class) {
- node = new OMCommentImpl();
- } else if (type == CoreDocument.class || type == AxiomDocument.class) {
- node = new OMDocumentImpl();
- } else if (type == CoreDocumentTypeDeclaration.class || type ==
AxiomDocType.class) {
- node = new OMDocTypeImpl();
- } else if (type == CoreEntityReference.class || type ==
AxiomEntityReference.class) {
- node = new OMEntityReferenceImpl();
- } else if (type == CoreNamespaceDeclaration.class || type ==
AxiomNamespaceDeclaration.class) {
- node = new NamespaceDeclaration();
- } else if (type == CoreNSAwareAttribute.class || type ==
AxiomAttribute.class) {
- node = new OMAttributeImpl();
- } else if (type == CoreNSAwareElement.class || type ==
AxiomElement.class) {
- node = new OMElementImpl();
- } else if (type == CoreProcessingInstruction.class || type ==
AxiomProcessingInstruction.class) {
- node = new OMProcessingInstructionImpl();
- } else if (type == AxiomSourcedElement.class) {
- node = new OMSourcedElementImpl();
- } else if (type == AxiomSOAPMessage.class) {
- node = new SOAPMessageImpl();
- } else if (type == AxiomSOAP11Envelope.class) {
- node = new SOAP11EnvelopeImpl();
- } else if (type == AxiomSOAP12Envelope.class) {
- node = new SOAP12EnvelopeImpl();
- } else if (type == AxiomSOAP11Header.class) {
- node = new SOAP11HeaderImpl();
- } else if (type == AxiomSOAP12Header.class) {
- node = new SOAP12HeaderImpl();
- } else if (type == AxiomSOAP11HeaderBlock.class) {
- node = new SOAP11HeaderBlockImpl();
- } else if (type == AxiomSOAP12HeaderBlock.class) {
- node = new SOAP12HeaderBlockImpl();
- } else if (type == AxiomSOAP11Body.class) {
- node = new SOAP11BodyImpl();
- } else if (type == AxiomSOAP12Body.class) {
- node = new SOAP12BodyImpl();
- } else if (type == AxiomSOAP11Fault.class) {
- node = new SOAP11FaultImpl();
- } else if (type == AxiomSOAP12Fault.class) {
- node = new SOAP12FaultImpl();
- } else if (type == AxiomSOAP11FaultCode.class) {
- node = new SOAP11FaultCodeImpl();
- } else if (type == AxiomSOAP12FaultCode.class) {
- node = new SOAP12FaultCodeImpl();
- } else if (type == AxiomSOAP12FaultValue.class) {
- node = new SOAP12FaultValueImpl();
- } else if (type == AxiomSOAP12FaultSubCode.class) {
- node = new SOAP12FaultSubCodeImpl();
- } else if (type == AxiomSOAP11FaultReason.class) {
- node = new SOAP11FaultReasonImpl();
- } else if (type == AxiomSOAP12FaultReason.class) {
- node = new SOAP12FaultReasonImpl();
- } else if (type == AxiomSOAP12FaultText.class) {
- node = new SOAP12FaultTextImpl();
- } else if (type == AxiomSOAP12FaultNode.class) {
- node = new SOAP12FaultNodeImpl();
- } else if (type == AxiomSOAP11FaultRole.class) {
- node = new SOAP11FaultRoleImpl();
- } else if (type == AxiomSOAP12FaultRole.class) {
- node = new SOAP12FaultRoleImpl();
- } else if (type == AxiomSOAP11FaultDetail.class) {
- node = new SOAP11FaultDetailImpl();
- } else if (type == AxiomSOAP12FaultDetail.class) {
- node = new SOAP12FaultDetailImpl();
- } else {
- throw new IllegalArgumentException();
- }
- return type.cast(node);
+ private LLOMNodeFactory() {
+ super(LLOMNodeFactory.class.getClassLoader(),
+ "org.apache.axiom.om.impl.llom",
+ "org.apache.axiom.soap.impl.llom",
+ "org.apache.axiom.soap.impl.llom.soap11",
+ "org.apache.axiom.soap.impl.llom.soap12");
}
}
Added:
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/om/impl/llom/nodetypes.index
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/om/impl/llom/nodetypes.index?rev=1704090&view=auto
==============================================================================
---
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/om/impl/llom/nodetypes.index
(added)
+++
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/om/impl/llom/nodetypes.index
Sat Sep 19 22:58:50 2015
@@ -0,0 +1,29 @@
+#
+# 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.
+#
+CDATASectionImpl
+CharacterDataImpl
+NamespaceDeclaration
+OMAttributeImpl
+OMCommentImpl
+OMDocTypeImpl
+OMDocumentImpl
+OMElementImpl
+OMEntityReferenceImpl
+OMProcessingInstructionImpl
+OMSourcedElementImpl
Added:
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/nodetypes.index
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/nodetypes.index?rev=1704090&view=auto
==============================================================================
---
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/nodetypes.index
(added)
+++
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/nodetypes.index
Sat Sep 19 22:58:50 2015
@@ -0,0 +1,19 @@
+#
+# 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.
+#
+SOAPMessageImpl
Added:
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/soap11/nodetypes.index
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/soap11/nodetypes.index?rev=1704090&view=auto
==============================================================================
---
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/soap11/nodetypes.index
(added)
+++
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/soap11/nodetypes.index
Sat Sep 19 22:58:50 2015
@@ -0,0 +1,27 @@
+#
+# 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.
+#
+SOAP11BodyImpl
+SOAP11EnvelopeImpl
+SOAP11FaultCodeImpl
+SOAP11FaultDetailImpl
+SOAP11FaultImpl
+SOAP11FaultReasonImpl
+SOAP11FaultRoleImpl
+SOAP11HeaderBlockImpl
+SOAP11HeaderImpl
Added:
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/soap12/nodetypes.index
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/soap12/nodetypes.index?rev=1704090&view=auto
==============================================================================
---
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/soap12/nodetypes.index
(added)
+++
webservices/axiom/trunk/implementations/axiom-impl/src/main/resources/org/apache/axiom/soap/impl/llom/soap12/nodetypes.index
Sat Sep 19 22:58:50 2015
@@ -0,0 +1,31 @@
+#
+# 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.
+#
+SOAP12BodyImpl
+SOAP12EnvelopeImpl
+SOAP12FaultCodeImpl
+SOAP12FaultDetailImpl
+SOAP12FaultImpl
+SOAP12FaultNodeImpl
+SOAP12FaultReasonImpl
+SOAP12FaultRoleImpl
+SOAP12FaultSubCodeImpl
+SOAP12FaultTextImpl
+SOAP12FaultValueImpl
+SOAP12HeaderBlockImpl
+SOAP12HeaderImpl
Modified:
webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/axiom/fom/impl/FOMNodeFactory.java
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/axiom/fom/impl/FOMNodeFactory.java?rev=1704090&r1=1704089&r2=1704090&view=diff
==============================================================================
---
webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/axiom/fom/impl/FOMNodeFactory.java
(original)
+++
webservices/axiom/trunk/implementations/fom-impl/src/main/java/org/apache/axiom/fom/impl/FOMNodeFactory.java
Sat Sep 19 22:58:50 2015
@@ -18,126 +18,12 @@
*/
package org.apache.axiom.fom.impl;
-import org.apache.abdera.parser.stax.FOMAttribute;
-import org.apache.abdera.parser.stax.FOMCDATASection;
-import org.apache.abdera.parser.stax.FOMCategories;
-import org.apache.abdera.parser.stax.FOMCategory;
-import org.apache.abdera.parser.stax.FOMCharacterDataNode;
-import org.apache.abdera.parser.stax.FOMCollection;
-import org.apache.abdera.parser.stax.FOMComment;
-import org.apache.abdera.parser.stax.FOMContent;
-import org.apache.abdera.parser.stax.FOMControl;
-import org.apache.abdera.parser.stax.FOMDateTime;
-import org.apache.abdera.parser.stax.FOMDiv;
-import org.apache.abdera.parser.stax.FOMDocType;
-import org.apache.abdera.parser.stax.FOMDocument;
-import org.apache.abdera.parser.stax.FOMElement;
-import org.apache.abdera.parser.stax.FOMEntityReference;
-import org.apache.abdera.parser.stax.FOMEntry;
-import org.apache.abdera.parser.stax.FOMExtensibleElement;
-import org.apache.abdera.parser.stax.FOMFeed;
-import org.apache.abdera.parser.stax.FOMGenerator;
-import org.apache.abdera.parser.stax.FOMIRI;
-import org.apache.abdera.parser.stax.FOMLink;
-import org.apache.abdera.parser.stax.FOMMultipartCollection;
-import org.apache.abdera.parser.stax.FOMNamespaceDeclaration;
-import org.apache.abdera.parser.stax.FOMPerson;
-import org.apache.abdera.parser.stax.FOMProcessingInstruction;
-import org.apache.abdera.parser.stax.FOMService;
-import org.apache.abdera.parser.stax.FOMSource;
-import org.apache.abdera.parser.stax.FOMText;
-import org.apache.abdera.parser.stax.FOMWorkspace;
-import org.apache.axiom.core.CoreCDATASection;
-import org.apache.axiom.core.CoreCharacterDataNode;
-import org.apache.axiom.core.CoreComment;
-import org.apache.axiom.core.CoreDocument;
-import org.apache.axiom.core.CoreDocumentTypeDeclaration;
-import org.apache.axiom.core.CoreEntityReference;
-import org.apache.axiom.core.CoreNSAwareAttribute;
-import org.apache.axiom.core.CoreNSAwareElement;
-import org.apache.axiom.core.CoreNamespaceDeclaration;
-import org.apache.axiom.core.CoreNode;
-import org.apache.axiom.core.CoreProcessingInstruction;
-import org.apache.axiom.core.NodeFactory;
-import org.apache.axiom.om.impl.common.AxiomAttribute;
-import org.apache.axiom.om.impl.common.AxiomCDATASection;
-import org.apache.axiom.om.impl.common.AxiomCharacterDataNode;
-import org.apache.axiom.om.impl.common.AxiomComment;
-import org.apache.axiom.om.impl.common.AxiomDocType;
-import org.apache.axiom.om.impl.common.AxiomDocument;
-import org.apache.axiom.om.impl.common.AxiomElement;
-import org.apache.axiom.om.impl.common.AxiomEntityReference;
-import org.apache.axiom.om.impl.common.AxiomNamespaceDeclaration;
-import org.apache.axiom.om.impl.common.AxiomProcessingInstruction;
+import org.apache.axiom.core.NodeFactoryImpl;
-public final class FOMNodeFactory implements NodeFactory {
+public final class FOMNodeFactory extends NodeFactoryImpl {
public static final FOMNodeFactory INSTANCE = new FOMNodeFactory();
- private FOMNodeFactory() {}
-
- public <T extends CoreNode> T createNode(Class<T> type) {
- CoreNode node;
- if (type == CoreCDATASection.class || type == AxiomCDATASection.class
|| type == FOMCDATASection.class) {
- node = new FOMCDATASection();
- } else if (type == CoreCharacterDataNode.class || type ==
AxiomCharacterDataNode.class || type == FOMCharacterDataNode.class) {
- node = new FOMCharacterDataNode();
- } else if (type == CoreComment.class || type == AxiomComment.class ||
type == FOMComment.class) {
- node = new FOMComment();
- } else if (type == CoreDocument.class || type == AxiomDocument.class
|| type == FOMDocument.class) {
- node = new FOMDocument();
- } else if (type == CoreDocumentTypeDeclaration.class || type ==
AxiomDocType.class) {
- node = new FOMDocType();
- } else if (type == CoreEntityReference.class || type ==
AxiomEntityReference.class) {
- node = new FOMEntityReference();
- } else if (type == CoreNamespaceDeclaration.class || type ==
AxiomNamespaceDeclaration.class) {
- node = new FOMNamespaceDeclaration();
- } else if (type == CoreNSAwareAttribute.class || type ==
AxiomAttribute.class || type == FOMAttribute.class) {
- node = new FOMAttribute();
- } else if (type == CoreNSAwareElement.class || type ==
AxiomElement.class || type == FOMElement.class) {
- node = new FOMElement();
- } else if (type == CoreProcessingInstruction.class || type ==
AxiomProcessingInstruction.class || type == FOMProcessingInstruction.class) {
- node = new FOMProcessingInstruction();
- } else if (type == FOMCategories.class) {
- node = new FOMCategories();
- } else if (type == FOMCategory.class) {
- node = new FOMCategory();
- } else if (type == FOMCollection.class) {
- node = new FOMCollection();
- } else if (type == FOMContent.class) {
- node = new FOMContent();
- } else if (type == FOMControl.class) {
- node = new FOMControl();
- } else if (type == FOMDateTime.class) {
- node = new FOMDateTime();
- } else if (type == FOMDiv.class) {
- node = new FOMDiv();
- } else if (type == FOMEntry.class) {
- node = new FOMEntry();
- } else if (type == FOMExtensibleElement.class) {
- node = new FOMExtensibleElement();
- } else if (type == FOMFeed.class) {
- node = new FOMFeed();
- } else if (type == FOMGenerator.class) {
- node = new FOMGenerator();
- } else if (type == FOMIRI.class) {
- node = new FOMIRI();
- } else if (type == FOMLink.class) {
- node = new FOMLink();
- } else if (type == FOMMultipartCollection.class) {
- node = new FOMMultipartCollection();
- } else if (type == FOMPerson.class) {
- node = new FOMPerson();
- } else if (type == FOMService.class) {
- node = new FOMService();
- } else if (type == FOMSource.class) {
- node = new FOMSource();
- } else if (type == FOMText.class) {
- node = new FOMText();
- } else if (type == FOMWorkspace.class) {
- node = new FOMWorkspace();
- } else {
- throw new IllegalArgumentException(type.getName() + " not
supported");
- }
- return type.cast(node);
+ private FOMNodeFactory() {
+ super(FOMNodeFactory.class.getClassLoader(),
"org.apache.abdera.parser.stax");
}
}
Added:
webservices/axiom/trunk/implementations/fom-impl/src/main/resources/org/apache/abdera/parser/stax/nodetypes.index
URL:
http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/fom-impl/src/main/resources/org/apache/abdera/parser/stax/nodetypes.index?rev=1704090&view=auto
==============================================================================
---
webservices/axiom/trunk/implementations/fom-impl/src/main/resources/org/apache/abdera/parser/stax/nodetypes.index
(added)
+++
webservices/axiom/trunk/implementations/fom-impl/src/main/resources/org/apache/abdera/parser/stax/nodetypes.index
Sat Sep 19 22:58:50 2015
@@ -0,0 +1,47 @@
+#
+# 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.
+#
+FOMAttribute
+FOMCDATASection
+FOMCategories
+FOMCategory
+FOMCharacterDataNode
+FOMCollection
+FOMComment
+FOMContent
+FOMControl
+FOMDateTime
+FOMDiv
+FOMDocType
+FOMDocument
+FOMElement
+FOMEntityReference
+FOMEntry
+FOMExtensibleElement
+FOMFeed
+FOMGenerator
+FOMIRI
+FOMLink
+FOMMultipartCollection
+FOMNamespaceDeclaration
+FOMPerson
+FOMProcessingInstruction
+FOMService
+FOMSource
+FOMText
+FOMWorkspace