You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ja...@apache.org on 2005/06/28 10:38:09 UTC
svn commit: r202145 - in /webservices/axis/trunk/java/modules:
saaj/src/org/apache/axis/saaj/ xml/src/org/apache/axis/om/
xml/src/org/apache/axis/om/impl/llom/
xml/src/org/apache/axis/om/impl/llom/builder/
xml/src/org/apache/axis/om/impl/llom/factory/ ...
Author: jayachandra
Date: Tue Jun 28 01:38:07 2005
New Revision: 202145
URL: http://svn.apache.org/viewcvs?rev=202145&view=rev
Log:
In reference to API changes discussed and finalized (see http://marc.theaimsgroup.com/?l=axis-dev&m=111987873030270&w=2) I've made the following refactorings.
To whomsoever this may have effect, please review the changes done and give your comments
modified saaj/src/org/apache/axis/saaj/NodeImpl.java
modified saaj/src/org/apache/axis/saaj/SOAPElementImpl.java
modified saaj/src/org/apache/axis/saaj/TextImpl.java
modified xml/src/org/apache/axis/om/impl/llom/builder/SAXOMBuilder.java
modified xml/src/org/apache/axis/om/impl/llom/builder/StAXBuilder.java
modified xml/src/org/apache/axis/om/impl/llom/builder/StAXOMBuilder.java
modified xml/src/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java
modified xml/src/org/apache/axis/om/impl/llom/mtom/MTOMStAXSOAPModelBuilder.java
modified xml/src/org/apache/axis/om/impl/llom/OMDocument.java
modified xml/src/org/apache/axis/om/impl/llom/OMElementImpl.java
modified xml/src/org/apache/axis/om/impl/llom/OMNavigator.java
modified xml/src/org/apache/axis/om/impl/llom/OMNodeImpl.java
modified xml/src/org/apache/axis/om/impl/llom/OMTextImpl.java
added xml/src/org/apache/axis/om/OMContainer.java
modified xml/src/org/apache/axis/om/OMElement.java
modified xml/src/org/apache/axis/om/OMFactory.java
modified xml/src/org/apache/axis/om/OMNode.java
modified xml/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java
s.
modif
Added:
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMContainer.java
Modified:
webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/NodeImpl.java
webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/SOAPElementImpl.java
webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/TextImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMElement.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMFactory.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMNode.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMDocument.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMElementImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMNavigator.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMNodeImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMTextImpl.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/SAXOMBuilder.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXBuilder.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXOMBuilder.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/mtom/MTOMStAXSOAPModelBuilder.java
webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java
Modified: webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/NodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/NodeImpl.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/NodeImpl.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/NodeImpl.java Tue Jun 28 01:38:07 2005
@@ -35,12 +35,12 @@
/**
* Class NodeImpl
- *
+ *
* @author Ashutosh Shahi
* ashutosh.shahi@gmail.com
*/
public class NodeImpl implements Node {
-
+
/**
* Field omNode
*/
@@ -49,20 +49,20 @@
* field document
*/
protected org.w3c.dom.Document document;
-
+
//protected CharacterData textRep = null;
-
+
/**
* Constructor NodeImpl
*
*/
public NodeImpl(){
-
+
}
-
+
/**
* Constructor NodeImpl
- *
+ *
* @param node
*/
public NodeImpl(OMNode node){
@@ -70,7 +70,7 @@
}
/**
* Constructor NodeImpl
- *
+ *
* @param attrib
*/
public NodeImpl(OMAttribute attrib){
@@ -79,10 +79,10 @@
// Find out a way to construct OMNode from a OMAttribute
// as OMAttributes are immutable
}
-
+
/**
* Constructor NodeImpl
- *
+ *
* @param ns
*/
public NodeImpl(OMNamespace ns){
@@ -91,27 +91,27 @@
// Find out a way to construct OMNode from OMNamespace
// OMNamespace is immutable
}
-
+
/**
* constructor which adopts the name and NS of the char data, and its text
* @param text
*/
/* public NodeImpl(CharacterData text) {
-
+
}
*/
-
+
public OMNode getOMNode(){
return omNode;
}
-
+
/**
* Method getValue
- *
+ *
* @see javax.xml.soap.Node#getValue()
*/
public String getValue() {
-
+
if(omNode.getType() == OMNode.TEXT_NODE)
return ((OMText)omNode).getText();
else if(omNode.getType() == OMNode.ELEMENT_NODE)
@@ -122,11 +122,11 @@
/**
* Method setParentElement
* @param parent
- *
+ *
* @see javax.xml.soap.Node#setParentElement(javax.xml.soap.SOAPElement)
*/
public void setParentElement(SOAPElement parent) throws SOAPException {
-
+
OMElement omParent = ((SOAPElementImpl)parent).getOMElement();
omNode.setParent(omParent);
}
@@ -136,8 +136,8 @@
* @see javax.xml.soap.Node#getParentElement()
*/
public SOAPElement getParentElement() {
-
- OMElement omParent = omNode.getParent();
+
+ OMElement omParent = (OMElement)omNode.getParent();
return new SOAPElementImpl(omParent);
}
@@ -146,7 +146,7 @@
* @see javax.xml.soap.Node#detachNode()
*/
public void detachNode() {
-
+
omNode.detach();
}
@@ -163,13 +163,13 @@
/**
* Method setValue
* @param value
- *
+ *
* @see javax.xml.soap.Node#setValue(java.lang.String)
*/
public void setValue(String value) {
-
+
if(omNode.getType() == OMNode.TEXT_NODE){
- OMElement parent = omNode.getParent();
+ OMElement parent = (OMElement)omNode.getParent();
((OMText)omNode).discard();
omNode = org.apache.axis.om.OMAbstractFactory.getOMFactory().createText(parent, value);
} else if(omNode.getType() == OMNode.ELEMENT_NODE){
@@ -180,7 +180,7 @@
else if(firstChild.getType() == OMNode.TEXT_NODE){
((OMText)firstChild).discard();
firstChild = org.apache.axis.om.OMAbstractFactory.getOMFactory().createText((OMElement)omNode, value);
- }
+ }
} else{
throw new IllegalStateException();
}
@@ -191,7 +191,7 @@
* @see org.w3c.dom.Node#getNodeType()
*/
public short getNodeType() {
-
+
return (short)omNode.getType();
}
@@ -247,7 +247,7 @@
* @see org.w3c.dom.Node#getNamespaceURI()
*/
public String getNamespaceURI() {
-
+
return ((OMElement)omNode).getNamespace().getName();
}
@@ -256,7 +256,7 @@
* @see org.w3c.dom.Node#getNodeName()
*/
public String getNodeName() {
-
+
if(omNode.getType() == OMNode.ELEMENT_NODE )
return ((OMElement)omNode).getLocalName();
else if(omNode.getType() == OMNode.COMMENT_NODE)
@@ -298,9 +298,9 @@
* @see org.w3c.dom.Node#setNodeValue(java.lang.String)
*/
public void setNodeValue(String value) throws DOMException {
-
+
if(omNode.getType() == OMNode.TEXT_NODE){
- OMElement parent = omNode.getParent();
+ OMElement parent = (OMElement)omNode.getParent();
((OMText)omNode).discard();
omNode = org.apache.axis.om.OMAbstractFactory.getOMFactory().createText(parent, value);
}
@@ -329,7 +329,7 @@
// method not part of org.w3c.dom.Node, created to set the document
this.document = doc;
}
-
+
/**
* Method getOwnerDocument
* @see org.w3c.dom.Node#getOwnerDocument()
@@ -348,7 +348,7 @@
// Dropping for now
// TODO
Iterator iter = ((OMElement)omNode).getAttributes();
-
+
return null;
}
@@ -367,7 +367,7 @@
* @see org.w3c.dom.Node#getLastChild()
*/
public org.w3c.dom.Node getLastChild() {
-
+
Iterator children = ((OMElement)omNode).getChildren();
Object child = null;
while(children.hasNext()){
@@ -383,15 +383,15 @@
* dom Node method
*/
public org.w3c.dom.Node getNextSibling() {
-
+
OMNode sibling = omNode.getNextSibling();
return new NodeImpl(sibling);
}
-
+
public org.w3c.dom.Node getParentNode() {
-
- OMElement parent = omNode.getParent();
+
+ OMElement parent = (OMElement)omNode.getParent();
return new NodeImpl(parent);
}
@@ -399,7 +399,7 @@
* dom Node method
*/
public org.w3c.dom.Node getPreviousSibling() {
-
+
OMNode prevSibling = omNode.getPreviousSibling();
return new NodeImpl(prevSibling);
}
@@ -439,7 +439,7 @@
*/
public org.w3c.dom.Node appendChild(org.w3c.dom.Node node)
throws DOMException {
-
+
OMNode child = Dom2OmUtils.toOM(node);
if(omNode.getType() == OMNode.ELEMENT_NODE)
((OMElement)omNode).addChild(child);
@@ -463,7 +463,7 @@
}
}
}
-
+
return null;
}
@@ -472,7 +472,7 @@
*/
public org.w3c.dom.Node insertBefore(org.w3c.dom.Node arg0,
org.w3c.dom.Node arg1) throws DOMException {
-
+
return null;
}
@@ -488,13 +488,13 @@
while(iter.hasNext()){
Object nextChild = iter.next();
if(nextChild instanceof OMNode && nextChild.equals(refOmChild)){
-
+
}
}
}
return null;
}
-
+
public boolean equals(Object o){
if(o instanceof NodeImpl){
if(this.omNode.equals(((NodeImpl)o).omNode))
Modified: webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/SOAPElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/SOAPElementImpl.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/SOAPElementImpl.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/SOAPElementImpl.java Tue Jun 28 01:38:07 2005
@@ -22,6 +22,7 @@
import javax.xml.soap.SOAPException;
import org.apache.axis.om.OMText;
+import org.apache.axis.om.OMContainer;
import org.w3c.dom.Attr;
import org.w3c.dom.DOMException;
import org.w3c.dom.NodeList;
@@ -163,7 +164,7 @@
* @throws SOAPException
* @see javax.xml.soap.SOAPElement#addTextNode(java.lang.String)
*/
- public SOAPElement addTextNode(String text) throws SOAPException {
+ public SOAPElement addTextNode(String text) throws SOAPException {
//We need to create an OMText node and add that to
//the omElement delegate member that we have with us. All this OMElement's setText() does
omElement.setText(text);
@@ -180,7 +181,7 @@
* @see javax.xml.soap.SOAPElement#addAttribute(javax.xml.soap.Name, java.lang.String)
*/
public SOAPElement addAttribute(Name name, String value)
- throws SOAPException {
+ throws SOAPException {
org.apache.axis.om.OMNamespace omNS = org.apache.axis.om.OMAbstractFactory.getOMFactory().createOMNamespace(name.getURI(), name.getPrefix());
//TODO:
//The namespace of the attribute must be within the scope of the SOAPElement
@@ -210,7 +211,7 @@
* @see javax.xml.soap.SOAPElement#getAttributeValue(javax.xml.soap.Name)
*/
public String getAttributeValue(Name name) {
- //This method is waiting on the finalization of the name for a method
+ //This method is waiting on the finalization of the name for a method
//in OMElement that returns a OMAttribute from an input QName
return omElement.getFirstAttribute( new QName(name.getURI(),name.getLocalName(),name.getPrefix())).getValue();
}
@@ -240,11 +241,11 @@
* @return
* @see javax.xml.soap.SOAPElement#getNamespaceURI(java.lang.String)
*/
- public String getNamespaceURI(String prefix) {
+ public String getNamespaceURI(String prefix) {
//Lets get all the inscope namespaces of this SOAPElement and iterate over them,
//whenever the prefix mathces break and return the corresponding URI.
Iterator nsIter = omElement.getAllDeclaredNamespaces();
-
+
//loop over to see a prefix matching namespace.
while(nsIter.hasNext()) {
Object o = nsIter.next();
@@ -259,11 +260,11 @@
/**
* method getNamespacePrefixes
- * This method returns an iterator over all the declared namespaces prefix names.
+ * This method returns an iterator over all the declared namespaces prefix names.
* @return Iterator
* @see javax.xml.soap.SOAPElement#getNamespacePrefixes()
*/
- public Iterator getNamespacePrefixes() {
+ public Iterator getNamespacePrefixes() {
//Get all declared namespace, make a list of their prefixes and return an iterator over that list
ArrayList prefixList = new ArrayList();
Iterator nsIter = omElement.getAllDeclaredNamespaces();
@@ -282,7 +283,7 @@
* @return
* @see javax.xml.soap.SOAPElement#getElementName()
*/
- public Name getElementName() {
+ public Name getElementName() {
QName qName = omElement.getQName();
return (Name)(new PrefixedQName(qName.getNamespaceURI(), qName.getLocalPart(), qName.getPrefix()));
}
@@ -340,7 +341,7 @@
arrayList.add(childElement);
}
//javax.xml.soap.Node childElement = new NodeImpl((org.apache.axis.om.OMNode)o);
-
+
}
}
return arrayList.iterator();
@@ -398,12 +399,12 @@
public void removeContents() {
//We will get all the children and iteratively call the detach() on all of 'em.
Iterator childIter = omElement.getChildren();
-
+
while(childIter.hasNext()) {
Object o = childIter.next();
- if(o instanceof org.apache.axis.om.OMNode)
- ((org.apache.axis.om.OMNode)o).detach();
- }
+ if(o instanceof org.apache.axis.om.OMNode)
+ ((org.apache.axis.om.OMNode)o).detach();
+ }
}
/**
@@ -414,7 +415,7 @@
public Iterator getVisibleNamespacePrefixes() {
//I'll recursively return all the declared namespaces till this node, including its parents etc.
Iterator namespacesIter = omElement.getAllDeclaredNamespaces();
- ArrayList returnList = new ArrayList();
+ ArrayList returnList = new ArrayList();
while(namespacesIter.hasNext()) {
Object o = namespacesIter.next();
if (o instanceof org.apache.axis.om.OMNamespace) {
@@ -424,9 +425,9 @@
}//taken care of adding namespaces of this node.
//now we have to take care of adding the namespaces that are in the scope till the level of
//this nodes' parent.
- org.apache.axis.om.OMElement parent = omElement.getParent();
- if (parent!=null) {
- Iterator parentScopeNamespacesIter = parent.getAllDeclaredNamespaces();
+ org.apache.axis.om.OMContainer parent = omElement.getParent();
+ if (parent!=null && parent instanceof org.apache.axis.om.OMElement) {
+ Iterator parentScopeNamespacesIter = ((org.apache.axis.om.OMElement)parent).getAllDeclaredNamespaces();
while(parentScopeNamespacesIter.hasNext()) {
Object o = parentScopeNamespacesIter.next();
if (o instanceof org.apache.axis.om.OMNamespace) {
@@ -434,7 +435,7 @@
returnList.add(soapNode);
}
}
- }
+ }
return returnList.iterator();
}
@@ -455,7 +456,7 @@
public void removeAttribute(String localName) throws DOMException {
//just got a localName, so assuming the namespace to be that of element
Name elementQualifiedName = this.getElementName();
- //now try to remove that Attribute from this SOAPElement
+ //now try to remove that Attribute from this SOAPElement
this.removeAttribute(new PrefixedQName(elementQualifiedName.getURI(), localName, elementQualifiedName.getPrefix()));
}
@@ -478,13 +479,13 @@
return false;
}
- /**
+ /**
* method getAttribute
* This method retrieves the value of an attribute having specified localname.
* In case of an element having multiple attributes with same localname but declared
* in different namespaces, use of this method is unadvised.
* @param name
- * @return String
+ * @return String
* @see org.w3c.dom.Element#getAttribute(java.lang.String)
*/
public String getAttribute(String name) {
@@ -503,17 +504,17 @@
*/
public void removeAttributeNS(String namespaceURI, String localName) throws DOMException {
Name name = new PrefixedQName(namespaceURI, localName, null);
- this.removeAttribute(name);
+ this.removeAttribute(name);
}
/**
* Method setAttribute
* This method creates and adds an attribute with the given localName and value
- * into the underlying OM. It uses the namespace of omElement datamember of this SOAPElement for the
+ * into the underlying OM. It uses the namespace of omElement datamember of this SOAPElement for the
* newly added attribute.
* @param localName
* @param value
- * @return
+ * @return
* @see org.w3c.dom.Element#setAttribute(java.lang.String, java.lang.String)
*/
public void setAttribute(String localName, String value) throws DOMException {
@@ -525,7 +526,7 @@
/**
* method hasAttributeNS
- * This method returns true when an attribute with a given local name and
+ * This method returns true when an attribute with a given local name and
* namespace URI is specified on this element or has a default value, false
* otherwise.
* @param namespaceURI
@@ -544,7 +545,7 @@
return false;
}
- /**
+ /**
* method getAttributeNode
* This method retrieves an attribute node by the specified localname
* @param name
@@ -560,7 +561,7 @@
//wrap it into a org.w3c.dom.Attr object and return
return (new org.apache.axis.saaj.AttrImpl(omAttr, this));
}
- }
+ }
return null;
}
@@ -570,7 +571,7 @@
* @param Attr
* The attribute node that should be removed.
* @return Attr
- * The removed attribute node
+ * The removed attribute node
* @see org.w3c.dom.Element#removeAttributeNode(org.w3c.dom.Attr)
*/
public Attr removeAttributeNode(Attr oldAttr) throws DOMException {
@@ -602,7 +603,7 @@
/**
* Method setAttributeNode
* This method creates and adds an attribute corresponding to the supplied <code>Attr</code>
- * object into the underlying OM. The attribute added is created against it's own namespace
+ * object into the underlying OM. The attribute added is created against it's own namespace
* @param attr - a dom Attr object
* @return Attr - a dom Attr object corresponding to the added attribute.
* @see org.w3c.dom.Element#setAttributeNodeNS(org.w3c.dom.Attr)
@@ -616,10 +617,10 @@
/**
* Method getElementsByTagName
- * Returns a NodeList of all the descendant Elements with the given local
+ * Returns a NodeList of all the descendant Elements with the given local
* name, in the order in which they are encountered in a preorder traversal
* of this Element tree.
- * Current SOAPElement MAY not feature in the returned NodeList, only
+ * Current SOAPElement MAY not feature in the returned NodeList, only
* the descendant elements matching the criterion should be added.
* @param localName
* @return NodeList
@@ -630,7 +631,7 @@
NodeListImpl returnList;
if (childIter==null)
return null;
- else {
+ else {
returnList = new NodeListImpl();
while(childIter.hasNext()) {
NodeList list = getElementsByTagNamePreOrder((SOAPElement)childIter.next(), localName);
@@ -640,7 +641,7 @@
}
return (NodeList)returnList;
}
-
+
private NodeList getElementsByTagNamePreOrder(SOAPElement child, String localName) {
NodeListImpl returnList = new NodeListImpl();
//We are doing preorder, so see if root itself is a match and place it first in the order
@@ -700,19 +701,19 @@
Iterator attrIter = omElement.getAttributes();
while(attrIter.hasNext()) {
org.apache.axis.om.OMAttribute omAttr = (org.apache.axis.om.OMAttribute)(attrIter.next());
- if (omAttr.getLocalName().equals(localName) && omAttr.getNamespace().getName().equals(namespaceURI)) {
- return (new org.apache.axis.saaj.AttrImpl(omAttr, this));
+ if (omAttr.getLocalName().equals(localName) && omAttr.getNamespace().getName().equals(namespaceURI)) {
+ return (new org.apache.axis.saaj.AttrImpl(omAttr, this));
}
}
return null;
}
/**
- * getElementsByTagNameNS
- * Returns a NodeList of all the descendant Elements with a given local
- * name and namespace URI in the order in which they are encountered in a
+ * getElementsByTagNameNS
+ * Returns a NodeList of all the descendant Elements with a given local
+ * name and namespace URI in the order in which they are encountered in a
* preorder traversal of this Element tree.
- * Current SOAPElement MAY not feature in the returned NodeList, only
+ * Current SOAPElement MAY not feature in the returned NodeList, only
* the descendant elements matching the criterion should be added.
* @param namespaceURI
* @param localName
@@ -724,7 +725,7 @@
NodeListImpl returnList;
if (childIter==null)
return null;
- else {
+ else {
returnList = new NodeListImpl();
while(childIter.hasNext()) {
NodeList list = getElementsByTagNameNSPreOrder((SOAPElement)childIter.next(), namespaceURI, localName);
@@ -734,7 +735,7 @@
}
return (NodeList)returnList;
}
-
+
private NodeList getElementsByTagNameNSPreOrder(SOAPElement child, String namespaceURI, String localName) {
NodeListImpl returnList = new NodeListImpl();
//We are doing preorder, so see if root itself is a match and place it first in the order
Modified: webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/TextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/TextImpl.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/TextImpl.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/org/apache/axis/saaj/TextImpl.java Tue Jun 28 01:38:07 2005
@@ -32,45 +32,45 @@
public class TextImpl extends NodeImpl implements Text {
private OMText omText;
-
+
public TextImpl(String s){
//super();
omNode = omText = org.apache.axis.om.OMAbstractFactory.getOMFactory().createText(s);
}
-
+
public TextImpl(SOAPElementImpl parent, String s) throws SOAPException{
//super();
//super.setParentElement(parent);
OMElement par = parent.getOMElement();
omNode = omText = org.apache.axis.om.OMAbstractFactory.getOMFactory().createText(par, s);
}
-
+
public TextImpl(org.w3c.dom.CharacterData data){
if ( data == null ){
throw new IllegalArgumentException( "Text value may not be null." );
}
omText = org.apache.axis.om.OMAbstractFactory.getOMFactory().createText(data.getData());
}
-
+
/*Overridden Method*/
public SOAPElement getParentElement() {
- OMElement parent = omText.getParent();
+ OMElement parent = (OMElement)omText.getParent();
return new SOAPElementImpl(parent);
}
-
+
/*Overridden Method*/
public void setParentElement(SOAPElement parent) throws SOAPException {
OMElement omParent = ((SOAPElementImpl)parent).getOMElement();
omText.setParent(omParent);
}
-
+
/*Overridden Method*/
public String getValue() {
return omText.getText();
}
-
+
public boolean isComment() {
-
+
String temp = omText.getText();
if(temp.startsWith("<!--") && temp.endsWith("-->"))
return true;
@@ -81,10 +81,10 @@
* Implementation of DOM TEXT Interface
* *************************************************************
*/
-
-
+
+
public org.w3c.dom.Text splitText(int offset) throws DOMException {
-
+
String temp = omText.getText();
int length = temp.length();
String tailData = temp.substring(offset);
@@ -104,33 +104,33 @@
return tailText;
}
-
+
public int getLength() {
-
+
return omText.getText().length();
}
-
+
public void deleteData(int offset, int count) throws DOMException {
-
+
String temp = omText.getText();
StringBuffer subString = new StringBuffer(temp.substring(0,offset));
if(temp.length() - offset >= count - offset)
subString = subString.append(temp.substring(offset+count));
temp = subString.toString();
omText = org.apache.axis.om.OMAbstractFactory.getOMFactory().createText(temp);
-
+
}
-
+
public String getData() throws DOMException {
-
+
return omText.getText();
}
-
+
public String substringData(int offset, int count) throws DOMException {
-
+
String temp = omText.getText();
if(temp.length() - offset >= count - offset)
return temp.substring(offset, count);
@@ -138,19 +138,19 @@
return temp.substring(offset);
}
-
+
public void replaceData(int offset, int count, String arg)
throws DOMException {
-
+
deleteData(offset, count);
StringBuffer temp = new StringBuffer(omText.getText());
temp.append(arg);
omText = org.apache.axis.om.OMAbstractFactory.getOMFactory().createText(temp.toString());
}
-
+
public void insertData(int offset, String arg) throws DOMException {
-
+
if(offset < 0 || offset > omText.getText().length())
throw new DOMException(DOMException.INDEX_SIZE_ERR, "");
StringBuffer temp = new StringBuffer(omText.getText().substring(0, offset));
@@ -158,18 +158,18 @@
omText = org.apache.axis.om.OMAbstractFactory.getOMFactory().createText(temp.toString());
}
-
+
public void appendData(String arg) throws DOMException {
-
+
StringBuffer temp = new StringBuffer(omText.getText());
temp = temp.append(arg);
omText = org.apache.axis.om.OMAbstractFactory.getOMFactory().createText(temp.toString());
}
-
+
public void setData(String arg) throws DOMException {
-
+
omText = org.apache.axis.om.OMAbstractFactory.getOMFactory().createText(arg);
}
Added: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMContainer.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMContainer.java?rev=202145&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMContainer.java (added)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMContainer.java Tue Jun 28 01:38:07 2005
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed 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.axis.om;
+
+import java.util.Iterator;
+import javax.xml.namespace.QName;
+
+public interface OMContainer {
+
+ public void addChild (OMNode omNode);
+
+ public Iterator getChildrenWithName (QName elementQName) throws OMException;
+
+ public OMElement getFirstChildWithName (QName elementQName) throws OMException;
+
+ public Iterator getChildren();
+
+ public void setFirstChild(OMNode omNode);
+
+ public OMNode getFirstChild();
+
+ public boolean isComplete();
+
+ public void setComplete(boolean state);
+
+ public void buildNext();
+}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMElement.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMElement.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMElement.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMElement.java Tue Jun 28 01:38:07 2005
@@ -22,7 +22,7 @@
/**
* Interface OMElement
*/
-public interface OMElement extends OMNode {
+public interface OMElement extends OMNode, OMContainer {
/**
* This will add child to the element. One must preserve the order of children, in this operation
* Tip : appending the new child is prefered
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMFactory.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMFactory.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMFactory.java Tue Jun 28 01:38:07 2005
@@ -36,7 +36,7 @@
* @return
*/
public OMElement createOMElement(String localName, OMNamespace ns,
- OMElement parent,
+ OMContainer parent,
OMXMLParserWrapper builder);
/**
@@ -64,7 +64,7 @@
* @return
* @throws OMException
*/
- public OMElement createOMElement(QName qname, OMElement parent)
+ public OMElement createOMElement(QName qname, OMContainer parent)
throws OMException;
/**
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMNode.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMNode.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMNode.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/OMNode.java Tue Jun 28 01:38:07 2005
@@ -53,14 +53,14 @@
* @return
* @throws OMException
*/
- public OMElement getParent() throws OMException;
+ public OMContainer getParent() throws OMException;
/**
* Method setParent
*
* @param element
*/
- public void setParent(OMElement element);
+ public void setParent(OMContainer element);
/**
* This will give the next sibling. This can be an OMAttribute for OMAttribute or OMText or OMELement for others.
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMDocument.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMDocument.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMDocument.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMDocument.java Tue Jun 28 01:38:07 2005
@@ -15,17 +15,41 @@
*/
package org.apache.axis.om.impl.llom;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMContainer;
+import org.apache.axis.om.OMException;
+import org.apache.axis.om.OMNode;
import org.apache.axis.om.OMXMLParserWrapper;
+import org.apache.axis.om.impl.llom.traverse.OMChildrenIterator;
+import org.apache.axis.om.impl.llom.traverse.OMChildrenQNameIterator;
/**
* Class OMDocument
*/
-public class OMDocument {
+public class OMDocument implements OMContainer {
/**
* Field rootElement
*/
private OMElement rootElement;
+
+ /**
+ * Field firstChild
+ */
+ protected OMNode firstChild;
+
+ /**
+ * Field lastChild
+ */
+ private OMNode lastChild;
+
+ /**
+ * Field done
+ */
+ protected boolean done = false;
/**
* Field parserWrapper
@@ -67,5 +91,127 @@
*/
public void setRootElement(OMElement rootElement) {
this.rootElement = rootElement;
+ }
+
+ /**
+ * this will indicate whether parser has parsed this information item completely or not.
+ * If somethings info are not available in the item, one has to check this attribute to make sure that, this
+ * item has been parsed completely or not.
+ *
+ * @return
+ */
+ public boolean isComplete() {
+ return done;
+ }
+
+ /**
+ * Method setComplete
+ *
+ * @param state
+ */
+ public void setComplete(boolean state) {
+ this.done = state;
+ }
+
+ /**
+ * This will force the parser to proceed, if parser has not yet finished with the XML input
+ */
+ public void buildNext() {
+ parserWrapper.next();
+ }
+
+ /**
+ * This will add child to the element. One can decide whether he append the child or he adds to the
+ * front of the children list
+ *
+ * @param child
+ */
+ public void addChild(OMNode child) {
+ addChild((OMNodeImpl) child);
+ }
+
+ /**
+ * Method addChild
+ *
+ * @param child
+ */
+ private void addChild(OMNodeImpl child) {
+ if (firstChild == null) {
+ firstChild = child;
+ child.setPreviousSibling(null);
+ } else {
+ child.setPreviousSibling(lastChild);
+ lastChild.setNextSibling(child);
+ }
+ child.setNextSibling(null);
+ child.setParent(this);
+ lastChild = child;
+
+ }
+
+ /**
+ * This returns a collection of this element.
+ * Children can be of types OMElement, OMText.
+ *
+ * @return
+ */
+ public Iterator getChildren() {
+ return new OMChildrenIterator(getFirstChild());
+ }
+
+ /**
+ * This will search for children with a given QName and will return an iterator to traverse through
+ * the OMNodes.
+ * This QName can contain any combination of prefix, localname and URI
+ *
+ * @param elementQName
+ * @return
+ * @throws org.apache.axis.om.OMException
+ * @throws OMException
+ */
+ public Iterator getChildrenWithName(QName elementQName) throws OMException {
+ return new OMChildrenQNameIterator((OMNodeImpl) getFirstChild(),
+ elementQName);
+ }
+
+ /**
+ * Method getFirstChild
+ *
+ * @return
+ */
+ public OMNode getFirstChild() {
+ while ((firstChild == null) && !done) {
+ buildNext();
+ }
+ return firstChild;
+ }
+
+ /**
+ * Method getFirstChildWithName
+ *
+ * @param elementQName
+ * @return
+ * @throws OMException
+ */
+ public OMElement getFirstChildWithName(QName elementQName) throws OMException {
+ OMChildrenQNameIterator omChildrenQNameIterator =
+ new OMChildrenQNameIterator((OMNodeImpl) getFirstChild(),
+ elementQName);
+ OMNode omNode = null;
+ if (omChildrenQNameIterator.hasNext()) {
+ omNode = (OMNode) omChildrenQNameIterator.next();
+ }
+
+ return ((omNode != null) && (OMNode.ELEMENT_NODE == omNode.getType())) ? (OMElement) omNode : null;
+
+ }
+
+ /**
+ * Method setFirstChild
+ *
+ * @param firstChild
+ */
+ public void setFirstChild(OMNode firstChild) {
+ this.firstChild = firstChild;
}
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMElementImpl.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMElementImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMElementImpl.java Tue Jun 28 01:38:07 2005
@@ -26,6 +26,7 @@
import org.apache.axis.om.OMAttribute;
import org.apache.axis.om.OMConstants;
import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMContainer;
import org.apache.axis.om.OMException;
import org.apache.axis.om.OMNamespace;
import org.apache.axis.om.OMNode;
@@ -85,7 +86,7 @@
* @param parent
* @param builder
*/
- public OMElementImpl(String localName, OMNamespace ns, OMElement parent,
+ public OMElementImpl(String localName, OMNamespace ns, OMContainer parent,
OMXMLParserWrapper builder) {
super(parent);
this.localName = localName;
@@ -100,7 +101,7 @@
* @param parent
* @param parent
*/
- protected OMElementImpl(OMElement parent) {
+ protected OMElementImpl(OMContainer parent) {
super(parent);
this.done = true;
}
@@ -120,7 +121,7 @@
}
}
- public OMElementImpl(String localName, OMNamespace ns, OMElement parent) {
+ public OMElementImpl(String localName, OMNamespace ns, OMContainer parent) {
super(parent);
this.localName = localName;
this.done = true;
@@ -136,7 +137,7 @@
* @param parent
* @throws OMException
*/
- public OMElementImpl(QName qname, OMElement parent) throws OMException {
+ public OMElementImpl(QName qname, OMContainer parent) throws OMException {
super(parent);
this.localName = qname.getLocalPart();
this.done = true;
@@ -149,7 +150,7 @@
* @param qname
* @param parent
*/
- private void handleNamespace(QName qname, OMElement parent) {
+ private void handleNamespace(QName qname, OMContainer parent) {
OMNamespace ns;
// first try to find a namespace from the scope
@@ -336,7 +337,17 @@
// go up to check with ancestors
if (parent != null) {
- return parent.findNamespace(uri, prefix);
+ //Comment by Jaya:
+ //For the OMDocument there won't be any explicit namespace
+ //declarations, so going up the parent chain till the document
+ //element should be enough.
+ //If at a later point community decides that some standard
+ //namespaces, like 'xml' which every XML w/ namespaces document
+ //is supposed to contain implicitly, should go into OMDocument then
+ //this 'if' block needs to be revisited.
+ if( parent instanceof OMElement) {
+ return ((OMElementImpl)parent).findNamespace(uri, prefix);
+ }
}
return null;
}
@@ -664,7 +675,7 @@
if (this.nextSibling != null) {
nextSibling.serialize(omOutput);
} else if (this.parent != null) {
- if (!this.parent.done) {
+ if (!this.parent.isComplete()) {
builder.setCache(cache);
builder.next();
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMNavigator.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMNavigator.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMNavigator.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMNavigator.java Tue Jun 28 01:38:07 2005
@@ -18,6 +18,7 @@
import org.apache.axis.om.OMElement;
import org.apache.axis.om.OMNode;
+import org.apache.axis.om.OMContainer;
/**
* Refer to the testClass to find out how to use
@@ -132,11 +133,12 @@
}
} else {
OMNode nextSibling = ((OMNodeImpl) next).nextSibling;
- OMNode parent = next.getParent();
+ //OMNode parent = next.getParent();
+ OMContainer parent = next.getParent();
if (nextSibling != null) {
next = nextSibling;
} else if ((parent != null) && parent.isComplete()) {
- next = parent;
+ next = (OMNodeImpl)parent;
backtracked = true;
} else {
next = null;
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMNodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMNodeImpl.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMNodeImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMNodeImpl.java Tue Jun 28 01:38:07 2005
@@ -16,6 +16,7 @@
package org.apache.axis.om.impl.llom;
import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMContainer;
import org.apache.axis.om.OMException;
import org.apache.axis.om.OMNode;
import org.apache.axis.om.OMXMLParserWrapper;
@@ -27,7 +28,7 @@
/**
* Field parent
*/
- protected OMElementImpl parent;
+ protected OMContainer parent;
/**
* Field nextSibling
@@ -64,9 +65,14 @@
*
* @param parent
*/
- public OMNodeImpl(OMElement parent) {
- if ((parent != null) && (parent.getType() == OMNode.ELEMENT_NODE)) {
- this.parent = (OMElementImpl) parent;
+ public OMNodeImpl(OMContainer parent) {
+ //if ((parent != null) && (parent.getType() == OMNode.ELEMENT_NODE)) {
+ //Comment by Jaya:
+ //OMContainer is only implemented by OMElement and OMDocument which are
+ //quite well deemed to act as parents, so checking the type of parent
+ //is not necessary.
+ if ((parent != null)) {
+ this.parent = parent;
parent.addChild(this);
}
}
@@ -79,7 +85,7 @@
* @throws org.apache.axis.om.OMException
* @throws OMException
*/
- public OMElement getParent() throws OMException {
+ public OMContainer getParent() throws OMException {
return parent;
}
@@ -88,18 +94,19 @@
*
* @param element
*/
- public void setParent(OMElement element) {
+ public void setParent(OMContainer element) {
- if( ((OMElement)this.parent) == element){
+ if( (this.parent) == element){
return;
}
- if (element instanceof OMNodeImpl) {//todo fix me
- if(this.parent != null){
- this.detach();
- }
- this.parent = (OMElementImpl) element;
+ //If we are asked to assign a new parent in place
+ //of an existing one. We should detach this node
+ //from the aegis of previous parent.
+ if(this.parent != null){
+ this.detach();
}
+ this.parent = element;
}
/**
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMTextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMTextImpl.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMTextImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/OMTextImpl.java Tue Jun 28 01:38:07 2005
@@ -435,8 +435,8 @@
if (done) {
this.detach();
} else {
- builder.discard(this.parent);
+ builder.discard((OMElement)this.parent);
}
}
-}
\ No newline at end of file
+}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/SAXOMBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/SAXOMBuilder.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/SAXOMBuilder.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/SAXOMBuilder.java Tue Jun 28 01:38:07 2005
@@ -113,9 +113,9 @@
public void endElement(String arg0, String arg1, String arg2)
throws SAXException {
if (lastNode.isComplete()) {
- OMElement parent = lastNode.getParent();
+ OMContainer parent = lastNode.getParent();
parent.setComplete(true);
- lastNode = parent;
+ lastNode = (OMNode)parent;
} else {
OMElement e = (OMElement) lastNode;
e.setComplete(true);
@@ -134,7 +134,7 @@
}
OMNode node;
if (lastNode.isComplete()) {
- node = factory.createText(lastNode.getParent(), new String(ch,
+ node = factory.createText((OMElement)lastNode.getParent(), new String(ch,
start, length));
lastNode.setNextSibling(node);
node.setPreviousSibling(lastNode);
@@ -163,4 +163,4 @@
public OMElement getRootElement() {
return root;
}
-}
\ No newline at end of file
+}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXBuilder.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXBuilder.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXBuilder.java Tue Jun 28 01:38:07 2005
@@ -140,7 +140,7 @@
}
OMNode node;
if (lastNode.isComplete()) {
- node = omfactory.createText(lastNode.getParent(), parser.getText());
+ node = omfactory.createText((OMElement)lastNode.getParent(), parser.getText());
lastNode.setNextSibling(node);
node.setPreviousSibling(lastNode);
} else {
@@ -188,7 +188,7 @@
if (lastNode != null) {
lastNode.setNextSibling(null);
} else {
- OMElement parent = elementImpl.getParent();
+ OMElement parent = (OMElement)elementImpl.getParent();
if (parent == null) {
throw new OMException();
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXOMBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXOMBuilder.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXOMBuilder.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/builder/StAXOMBuilder.java Tue Jun 28 01:38:07 2005
@@ -129,7 +129,7 @@
break;
case XMLStreamConstants.END_ELEMENT:
if (lastNode.isComplete()) {
- OMElement parent = lastNode.getParent();
+ OMElement parent = (OMElement)lastNode.getParent();
parent.setComplete(true);
lastNode = parent;
} else {
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/factory/OMLinkedListImplFactory.java Tue Jun 28 01:38:07 2005
@@ -54,7 +54,7 @@
* @return
*/
public OMElement createOMElement(String localName, OMNamespace ns,
- OMElement parent,
+ OMContainer parent,
OMXMLParserWrapper builder) {
OMElementImpl element = new OMElementImpl(localName, ns, parent,
builder);
@@ -84,7 +84,7 @@
* @return
* @throws OMException
*/
- public OMElement createOMElement(QName qname, OMElement parent)
+ public OMElement createOMElement(QName qname, OMContainer parent)
throws OMException {
return new OMElementImpl(qname, parent);
}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/mtom/MTOMStAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/mtom/MTOMStAXSOAPModelBuilder.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/mtom/MTOMStAXSOAPModelBuilder.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/om/impl/llom/mtom/MTOMStAXSOAPModelBuilder.java Tue Jun 28 01:38:07 2005
@@ -99,7 +99,7 @@
}
if (lastNode.isComplete()) {
- node = new OMTextImpl(contentID, lastNode.getParent(), this);
+ node = new OMTextImpl(contentID, (OMElement) lastNode.getParent(), this);
lastNode.setNextSibling(node);
node.setPreviousSibling(lastNode);
} else {
@@ -114,7 +114,7 @@
if (lastNode == null) {
node = constructNode(null, elementName, true);
} else if (lastNode.isComplete()) {
- node = constructNode(lastNode.getParent(), elementName, false);
+ node = constructNode((OMElement)lastNode.getParent(), elementName, false);
lastNode.setNextSibling(node);
node.setPreviousSibling(lastNode);
} else {
@@ -135,4 +135,4 @@
public DataHandler getDataHandler(String blobContentID) throws OMException {
return mimeHelper.getDataHandler(blobContentID);
}
-}
\ No newline at end of file
+}
Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java?rev=202145&r1=202144&r2=202145&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis/soap/impl/llom/builder/StAXSOAPModelBuilder.java Tue Jun 28 01:38:07 2005
@@ -163,7 +163,7 @@
if (lastNode == null) {
node = constructNode(null, elementName, true);
} else if (lastNode.isComplete()) {
- node = constructNode(lastNode.getParent(), elementName, false);
+ node = constructNode((OMElement)lastNode.getParent(), elementName, false);
lastNode.setNextSibling(node);
node.setPreviousSibling(lastNode);
} else {
@@ -306,7 +306,7 @@
break;
case XMLStreamConstants.END_ELEMENT:
if (lastNode.isComplete()) {
- OMElement parent = lastNode.getParent();
+ OMElement parent = (OMElement)lastNode.getParent();
// //added
// /*check whether all mandatory fault elements are present