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/08/27 23:48:55 UTC
svn commit: r1162446 - in
/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om:
OMAttribute.java OMElement.java OMInformationItem.java
OMNamedInformationItem.java OMSerializable.java
Author: veithen
Date: Sat Aug 27 21:48:55 2011
New Revision: 1162446
URL: http://svn.apache.org/viewvc?rev=1162446&view=rev
Log:
Extracted super-interfaces defining methods shared by multiple information item types.
Added:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMInformationItem.java (with props)
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNamedInformationItem.java (with props)
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAttribute.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMSerializable.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAttribute.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAttribute.java?rev=1162446&r1=1162445&r2=1162446&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAttribute.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMAttribute.java Sat Aug 27 21:48:55 2011
@@ -19,16 +19,8 @@
package org.apache.axiom.om;
-import javax.xml.namespace.QName;
-
/** Interface OMAttribute */
-public interface OMAttribute {
- /** @return Returns localName. */
- String getLocalName();
-
- /** @param localName */
- void setLocalName(String localName);
-
+public interface OMAttribute extends OMNamedInformationItem {
/** @return Returns String. */
String getAttributeValue();
@@ -44,15 +36,6 @@ public interface OMAttribute {
/** @param omNamespace */
void setOMNamespace(OMNamespace omNamespace);
- /** @return Returns OMNamespace. */
- OMNamespace getNamespace();
-
- /** @return Returns javax.xml.namespace.QName */
- QName getQName();
-
- /** Returns the OMFactory that created this object */
- OMFactory getOMFactory();
-
/**
* Returns the owner element of this attribute
* @return OMElement - The owner element
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java?rev=1162446&r1=1162445&r2=1162446&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMElement.java Sat Aug 27 21:48:55 2011
@@ -77,7 +77,7 @@ import java.util.Iterator;
* WSCOMMONS-517]
* </ul>
*/
-public interface OMElement extends OMNode, OMContainer {
+public interface OMElement extends OMNode, OMContainer, OMNamedInformationItem {
/**
* Returns a filtered list of children - just the elements.
@@ -354,27 +354,6 @@ public interface OMElement extends OMNod
QName getTextAsQName();
/**
- * Returns the local name of the element.
- *
- * @return Returns the local name of the element.
- */
- String getLocalName();
-
- /**
- * Method setLocalName
- *
- * @param localName
- */
- void setLocalName(String localName);
-
- /**
- * Get the namespace this element is part of.
- *
- * @return the namespace of this element, or <code>null</code> if the element has no namespace
- */
- OMNamespace getNamespace();
-
- /**
* Get the namespace URI of the element. Note that the contract of this method is identical to
* DOM's {@link org.w3c.dom.Node#getNamespaceURI()} (when called on an
* {@link org.w3c.dom.Element}).
@@ -407,14 +386,6 @@ public interface OMElement extends OMNod
*/
void setNamespaceWithNoFindInCurrentScope(OMNamespace namespace);
-
- /**
- * Gets the QName of this node.
- *
- * @return Returns the {@link QName} for the element.
- */
- QName getQName();
-
/**
* This is a convenience method only. This will basically serialize the given OMElement to a
* String but will build the OMTree in the memory
Added: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMInformationItem.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMInformationItem.java?rev=1162446&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMInformationItem.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMInformationItem.java Sat Aug 27 21:48:55 2011
@@ -0,0 +1,30 @@
+/*
+ * 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;
+
+/**
+ * Represents an information item in an XML document. This is the super-interface for all
+ * information items known by Axiom.
+ */
+public interface OMInformationItem {
+ /**
+ * Get the {@link OMFactory} that created this information item.
+ */
+ OMFactory getOMFactory();
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMInformationItem.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNamedInformationItem.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNamedInformationItem.java?rev=1162446&view=auto
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNamedInformationItem.java (added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNamedInformationItem.java Sat Aug 27 21:48:55 2011
@@ -0,0 +1,56 @@
+/*
+ * 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;
+
+import javax.xml.namespace.QName;
+
+/**
+ * Represents an information item that has a name, more precisely a namespace URI, a local name and
+ * a prefix. This applies to elements and attributes.
+ */
+public interface OMNamedInformationItem extends OMInformationItem {
+ /**
+ * Get the local name of the information item.
+ *
+ * @return the local name of the information item
+ */
+ String getLocalName();
+
+ /**
+ * Method setLocalName
+ *
+ * @param localName
+ */
+ void setLocalName(String localName);
+
+ /**
+ * Get the namespace this information item is part of.
+ *
+ * @return the namespace of this information item, or <code>null</code> if the information item
+ * has no namespace
+ */
+ OMNamespace getNamespace();
+
+ /**
+ * Get the QName of this information item.
+ *
+ * @return the {@link QName} for the information item
+ */
+ QName getQName();
+}
Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMNamedInformationItem.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMSerializable.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMSerializable.java?rev=1162446&r1=1162445&r2=1162446&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMSerializable.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMSerializable.java Sat Aug 27 21:48:55 2011
@@ -39,12 +39,7 @@ import javax.xml.stream.XMLStreamWriter;
* {@link XMLStreamWriter}.</li>
* </ul>
*/
-public interface OMSerializable {
- /**
- * Returns the OMFactory that created this object
- */
- OMFactory getOMFactory();
-
+public interface OMSerializable extends OMInformationItem {
/**
* Indicates whether parser has parsed this information item completely or not. If some info are
* not available in the item, one has to check this attribute to make sure that, this item has been