axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ruchi...@apache.org
Subject svn commit: r320685 - in /webservices/axis2/trunk/java/modules: integration/ xml/src/org/apache/axis2/om/ xml/src/org/apache/axis2/om/impl/dom/ xml/src/org/apache/axis2/om/impl/dom/factory/ xml/src/org/apache/axis2/om/impl/llom/ xml/src/org/apache/axis...
Date Thu, 13 Oct 2005 08:12:16 GMT
Author: ruchithf
Date: Thu Oct 13 01:11:41 2005
New Revision: 320685

URL: http://svn.apache.org/viewcvs?rev=320685&view=rev
Log:
An update to the OM-DOM impl

Modified:
    webservices/axis2/trunk/java/modules/integration/maven.xml
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMDocument.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMFactory.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttrImpl.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/CharacterImpl.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DocumentImpl.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ElementImpl.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NamespaceImpl.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NodeImpl.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ParentNode.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/TextImpl.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/factory/OMDOMFactory.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMDocumentImpl.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/builder/StAXOMBuilder.java
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPMessageImpl.java
    webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/llom/OMDocumentSerilizationTest.java

Modified: webservices/axis2/trunk/java/modules/integration/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/maven.xml?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/maven.xml Thu Oct 13 01:11:41 2005
@@ -410,6 +410,13 @@
 	<jar jarfile="target/test-resources/complete_service_repo/services/PingPort.aar" 
 	    basedir="../security/target/interop/classes" />
 
+
+	<!-- Repository for RPCInOutTest -->
+        <mkdir dir="target/test-resources/rpc_repo"/>
+        <copy file="../addressing/target/addressing.mar"
+            tofile="target/test-resources/rpc_repo/modules/addressing.mar"/>	
+
+
     <!-- Standard repository -->
     <mkdir dir="target/Repository"/>
         <mkdir dir="target/Repository/services"/>

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMDocument.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMDocument.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMDocument.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMDocument.java Thu Oct
13 01:11:41 2005
@@ -37,13 +37,13 @@
 	 * Returns the document element
 	 * @return
 	 */
-	public OMElement getDocumentElement();
+	public OMElement getDocumentOMElement();
 	
 	/**
 	 * Sets the document element of the XML document
 	 * @param rootElement
 	 */
-	public void setDocumentElement(OMElement rootElement);
+	public void setDocumentOMElement(OMElement rootElement);
 	
 	/**
 	 * Returns the XML version

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMFactory.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMFactory.java (original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/OMFactory.java Thu Oct
13 01:11:41 2005
@@ -35,7 +35,7 @@
      * @return
      */
     public OMElement createOMElement(String localName, OMNamespace ns);
-    public OMElement createOMElement(String localName, OMNamespace ns, OMContainer parent);
+    public OMElement createOMElement(String localName, OMNamespace ns, OMContainer parent)
throws OMException;
 
     /**
      * @param localName

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttrImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttrImpl.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttrImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/AttrImpl.java
Thu Oct 13 01:11:41 2005
@@ -38,10 +38,18 @@
 	private String attrName;
 	private TextImpl attrValue;
 	
+	private NamespaceImpl namespace;
+	
 	private boolean specified;
 	
 	protected AttrImpl(DocumentImpl ownerDocument) {
 		super(ownerDocument);
+	}
+	
+	public AttrImpl(String localName, OMNamespace ns, String value) {
+		this.attrName = localName;
+		this.attrValue = new TextImpl(value);
+		this.namespace = (NamespaceImpl)ns;
 	}
 
 	///

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/CharacterImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/CharacterImpl.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/CharacterImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/CharacterImpl.java
Thu Oct 13 01:11:41 2005
@@ -20,7 +20,7 @@
 import org.w3c.dom.DOMException;
 
 /**
- * This implements the OMCharater operations which are to be
+ * This implements the OMText operations which are to be
  * inherited by TextImpl, CommentImpl, CDATASectionImpl
  * 
  * @author Ruchith Fernando (ruchith.fernando@gmail.com)
@@ -29,6 +29,9 @@
 		OMText, CharacterData {
 
 	protected StringBuffer textValue;
+	
+	protected CharacterImpl() {
+	}
 	
 	/**
 	 * @param ownerNode

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DocumentImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DocumentImpl.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DocumentImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/DocumentImpl.java
Thu Oct 13 01:11:41 2005
@@ -16,6 +16,8 @@
 package org.apache.axis2.om.impl.dom;
 
 import org.apache.axis2.om.OMContainer;
+import org.apache.axis2.om.OMDocument;
+import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.OMException;
 import org.apache.axis2.om.OMNode;
 import org.apache.axis2.om.impl.OMOutputImpl;
@@ -42,7 +44,7 @@
 /**
  * @author Ruchith Fernando (ruchith.fernando@gmail.com)
  */
-public class DocumentImpl extends ParentNode implements Document {
+public class DocumentImpl extends ParentNode implements Document, OMDocument {
 
 	
     protected Hashtable identifiers;
@@ -54,7 +56,7 @@
 		super(ownerDocument);
 	}
 
-	protected DocumentImpl() {
+	public DocumentImpl() {
 		
 	}
 	
@@ -205,5 +207,60 @@
 		//TODO
 		throw new UnsupportedOperationException("TODO");
 	}
+	
+	///
+	///OMDocument Methods
+	///
+	public String getCharsetEncoding() {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	public String getXMLVersion() {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	public String isStandalone() {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	public void serialize(OMOutputImpl omOutput, boolean includeXMLDeclaration) throws XMLStreamException
{
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	public void serializeAndConsume(OMOutputImpl omOutput, boolean includeXMLDeclaration) throws
XMLStreamException {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	public void setCharsetEncoding(String charsetEncoding) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	public void setDocumentOMElement(OMElement rootElement) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	public void setStandalone(String isStandalone) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	public void setXMLVersion(String version) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	public OMElement getDocumentOMElement() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+	
+	
 
 }

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ElementImpl.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ElementImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ElementImpl.java
Thu Oct 13 01:11:41 2005
@@ -15,7 +15,11 @@
  */
 package org.apache.axis2.om.impl.dom;
 
+import org.apache.axis2.om.OMAttribute;
+import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.OMException;
+import org.apache.axis2.om.OMNamespace;
+import org.apache.axis2.om.OMXMLParserWrapper;
 import org.apache.axis2.om.impl.OMOutputImpl;
 import org.w3c.dom.Attr;
 import org.w3c.dom.DOMException;
@@ -23,13 +27,17 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 
 /**
  * @author Ruchith Fernando (ruchith.fernando@gmail.com)
  */
-public class ElementImpl extends ParentNode implements Element {
+public class ElementImpl extends ParentNode implements Element,OMElement {
 	
 	private NamespaceImpl namespace;
 	private String tagName;
@@ -43,7 +51,7 @@
 	}
 	
 	/**
-	 * Create a  new element with the 
+	 * Create a  new element with the namespace
 	 * @param ownerDocument
 	 * @param tagName
 	 * @param ns
@@ -54,6 +62,12 @@
 		this.namespace = ns;
 	}
 	
+	public ElementImpl(DocumentImpl ownerDocument, String tagName, NamespaceImpl ns, OMXMLParserWrapper
builder) {
+		super(ownerDocument);
+		this.tagName = tagName;
+		this.namespace = ns;
+		this.builder = builder;
+	}
 	
 	///
 	///org.w3c.dom.Node methods
@@ -247,12 +261,193 @@
 
 	public void serializeAndConsume(OMOutputImpl omOutput) throws XMLStreamException {
 		//TODO
-		throw new UnsupportedOperationException("TODO");// TODO Auto-generated method stub
-		
+		throw new UnsupportedOperationException("TODO");
 	}
 
 	public void serializeAndConsume(XMLStreamWriter xmlWriter) throws XMLStreamException {
 		//TODO
 		throw new UnsupportedOperationException("TODO");
 	}
-}
+
+	
+	///
+	///OmElement methods
+	///
+
+	/**
+	 * @see org.apache.axis2.om.OMElement#addAttribute(org.apache.axis2.om.OMAttribute)
+	 */
+	public OMAttribute addAttribute(OMAttribute attr) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/**
+	 * @see org.apache.axis2.om.OMElement#addAttribute(java.lang.String, java.lang.String, org.apache.axis2.om.OMNamespace)
+	 */
+	public OMAttribute addAttribute(String attributeName, String value, OMNamespace ns) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/**
+	 * @see org.apache.axis2.om.OMElement#declareNamespace(org.apache.axis2.om.OMNamespace)
+	 */
+	public OMNamespace declareNamespace(OMNamespace namespace) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/**
+	 * @see org.apache.axis2.om.OMElement#declareNamespace(java.lang.String, java.lang.String)
+	 */
+	public OMNamespace declareNamespace(String uri, String prefix) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/**
+	 * @see org.apache.axis2.om.OMElement#findNamespace(java.lang.String, java.lang.String)
+	 */
+	public OMNamespace findNamespace(String uri, String prefix) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/**
+	 * @see org.apache.axis2.om.OMElement#getAllAttributes()
+	 */
+	public Iterator getAllAttributes() {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/**
+	 * @see org.apache.axis2.om.OMElement#getAllDeclaredNamespaces()
+	 */
+	public Iterator getAllDeclaredNamespaces() throws OMException {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#getAttribute(javax.xml.namespace.QName)
+	 */
+	public OMAttribute getAttribute(QName qname) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#getBuilder()
+	 */
+	public OMXMLParserWrapper getBuilder() {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#getChildElements()
+	 */
+	public Iterator getChildElements() {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#getFirstAttribute(javax.xml.namespace.QName)
+	 */
+	public OMAttribute getFirstAttribute(QName qname) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#getFirstElement()
+	 */
+	public OMElement getFirstElement() {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#getNamespace()
+	 */
+	public OMNamespace getNamespace() throws OMException {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#getQName()
+	 */
+	public QName getQName() {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#getText()
+	 */
+	public String getText() {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#getXMLStreamReader()
+	 */
+	public XMLStreamReader getXMLStreamReader() {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#getXMLStreamReaderWithoutCaching()
+	 */
+	public XMLStreamReader getXMLStreamReaderWithoutCaching() {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#removeAttribute(org.apache.axis2.om.OMAttribute)
+	 */
+	public void removeAttribute(OMAttribute attr) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#setBuilder(org.apache.axis2.om.OMXMLParserWrapper)
+	 */
+	public void setBuilder(OMXMLParserWrapper wrapper) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#setLocalName(java.lang.String)
+	 */
+	public void setLocalName(String localName) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#setNamespace(org.apache.axis2.om.OMNamespace)
+	 */
+	public void setNamespace(OMNamespace namespace) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+
+	/* (non-Javadoc)
+	 * @see org.apache.axis2.om.OMElement#setText(java.lang.String)
+	 */
+	public void setText(String text) {
+		//TODO
+		throw new UnsupportedOperationException("TODO");
+	}
+	
+}
\ No newline at end of file

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NamespaceImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NamespaceImpl.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NamespaceImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NamespaceImpl.java
Thu Oct 13 01:11:41 2005
@@ -29,6 +29,11 @@
 		this.nsUri = uri;
 	}
 	
+	public NamespaceImpl(String uri, String prefix) {
+		this.nsUri = uri;
+		this.nsPrefix = prefix;
+	}
+	
 	/* (non-Javadoc)
 	 * @see org.apache.axis2.om.OMNamespace#equals(java.lang.String, java.lang.String)
 	 */

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NodeImpl.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NodeImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/NodeImpl.java
Thu Oct 13 01:11:41 2005
@@ -443,5 +443,9 @@
 		if(!done)
 			this.builder.next();
 	}
-
+	
+	protected void SetOwnerDocument(DocumentImpl document) {
+		this.ownerNode = document;
+	}
+	
 }

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ParentNode.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ParentNode.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ParentNode.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/ParentNode.java
Thu Oct 13 01:11:41 2005
@@ -31,7 +31,7 @@
 /**
  * @author Ruchith Fernando (ruchith.fernando@gmail.com)
  */
-public abstract class ParentNode extends ChildNode implements OMContainerEx{
+public abstract class ParentNode extends ChildNode implements OMContainerEx {
 
 
 	protected ChildNode firstChild;

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/TextImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/TextImpl.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/TextImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/TextImpl.java
Thu Oct 13 01:11:41 2005
@@ -30,6 +30,54 @@
  */
 public class TextImpl extends CharacterImpl implements Text {
 
+	
+	private String mimeType;
+	
+	private boolean optimize;
+	
+	private boolean isBinary;
+	
+    /**
+     * Field dataHandler contains the DataHandler
+     * Declaring as Object to remove the depedency on 
+     * Javax.activation.DataHandler
+     */
+    private Object dataHandlerObject = null;
+	
+	/**
+	 * Create a text node with the given text
+	 * required by the OMDOMFactory
+	 * The owner document should be set properly when
+	 * appending this to a DOM tree
+	 * @param text
+	 */
+	public TextImpl(String text) {
+		this.textValue = new StringBuffer(text);
+	}
+	
+	public TextImpl(String text, String mimeType, boolean optimize) {
+		this(text,mimeType,optimize,true);
+	}
+	
+	public TextImpl(String text, String mimeType, boolean optimize, boolean isBinary) {
+		this(text);
+		this.mimeType = mimeType;
+		this.optimize = optimize;
+		this.isBinary = isBinary;
+	}
+	
+
+    /**
+     * @param dataHandler
+     * @param optimize    To send binary content. Created progrmatically.
+     */
+    public TextImpl(Object dataHandler, boolean optimize) {
+        this.dataHandlerObject = dataHandler;
+        this.isBinary = true;
+        this.optimize = optimize;
+        done = true;
+    }
+	
 	/**
 	 * @param ownerNode
 	 */
@@ -45,6 +93,19 @@
 		super(ownerNode, value);
 	}
 
+	/**
+	 * @param ownerNode
+	 * @param value
+	 */
+	public TextImpl(DocumentImpl ownerNode, String value, String mimeType, boolean optimize)
{
+		this(ownerNode,value);
+		this.mimeType = mimeType;
+		this.optimize = optimize;
+        this.isBinary = true;
+        done = true;
+	}
+
+	
 	/**
 	 * Breaks this node into two nodes at the specified offset, keeping both 
 	 * in the tree as siblings. After being split, this node will contain all 

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/factory/OMDOMFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/factory/OMDOMFactory.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/factory/OMDOMFactory.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/dom/factory/OMDOMFactory.java
Thu Oct 13 01:11:41 2005
@@ -27,79 +27,174 @@
 import org.apache.axis2.om.OMProcessingInstruction;
 import org.apache.axis2.om.OMText;
 import org.apache.axis2.om.OMXMLParserWrapper;
+import org.apache.axis2.om.impl.dom.AttrImpl;
+import org.apache.axis2.om.impl.dom.DocumentFragmentimpl;
+import org.apache.axis2.om.impl.dom.DocumentImpl;
+import org.apache.axis2.om.impl.dom.ElementImpl;
+import org.apache.axis2.om.impl.dom.NamespaceImpl;
+import org.apache.axis2.om.impl.dom.OMDOMException;
+import org.apache.axis2.om.impl.dom.ParentNode;
+import org.apache.axis2.om.impl.dom.TextImpl;
+import org.w3c.dom.Node;
 
 import javax.xml.namespace.QName;
 
 public class OMDOMFactory implements OMFactory {
-
+	
 	public OMDocument createOMDocument() {
-		// TODO
-		throw new UnsupportedOperationException("TODO");
+		return new DocumentImpl();
 	}
 
 	public OMElement createOMElement(String localName, OMNamespace ns) {
-		// TODO
-		throw new UnsupportedOperationException("TODO");
-	}
-
-	public OMElement createOMElement(String localName, OMNamespace ns, OMContainer parent) {
-		// TODO
-		throw new UnsupportedOperationException("TODO");
+		return new ElementImpl(new DocumentImpl(), localName, (NamespaceImpl)ns);
 	}
 
+	public OMElement createOMElement(String localName, OMNamespace ns, OMContainer parent) throws
OMDOMException{
+		switch(((ParentNode)parent).getNodeType()) {
+			case Node.ELEMENT_NODE : // We are adding a new child to an elem
+				ElementImpl parentElem = (ElementImpl)parent;
+				ElementImpl elem = new ElementImpl((DocumentImpl)parentElem.getOwnerDocument(),localName,(NamespaceImpl)ns);
+				parentElem.appendChild(elem);
+				return elem;
+			case Node.DOCUMENT_NODE :
+				DocumentImpl docImpl = (DocumentImpl) parent;
+				ElementImpl elem2 = new ElementImpl(docImpl,localName,(NamespaceImpl)ns);
+				return elem2;
+				
+			case Node.DOCUMENT_FRAGMENT_NODE :
+				DocumentFragmentimpl docFragImpl = (DocumentFragmentimpl)parent;
+				ElementImpl elem3 = new ElementImpl((DocumentImpl)docFragImpl.getOwnerDocument(),localName,
(NamespaceImpl)ns);
+				return elem3;
+			default:
+				throw new OMDOMException("The parent container can only be an ELEMENT, DOCUMENT or a
DOCUMENT FRAGMENT");
+		}
+	}
+
+	/**
+	 * Creating an OMElement with the builder
+	 */
 	public OMElement createOMElement(String localName, OMNamespace ns, OMContainer parent, OMXMLParserWrapper
builder) {
-		// TODO
-		throw new UnsupportedOperationException("TODO");
-	}
-
+		switch(((ParentNode)parent).getNodeType()) {
+			case Node.ELEMENT_NODE: // We are adding a new child to an elem
+				ElementImpl parentElem = (ElementImpl) parent;
+				ElementImpl elem = new ElementImpl((DocumentImpl) parentElem
+						.getOwnerDocument(), localName, (NamespaceImpl) ns, builder);
+				parentElem.appendChild(elem);
+				return elem;
+			case Node.DOCUMENT_NODE:
+				DocumentImpl docImpl = (DocumentImpl) parent;
+				ElementImpl elem2 = new ElementImpl(docImpl, localName,
+						(NamespaceImpl) ns, builder);
+				return elem2;
+	
+			case Node.DOCUMENT_FRAGMENT_NODE:
+				DocumentFragmentimpl docFragImpl = (DocumentFragmentimpl) parent;
+				ElementImpl elem3 = new ElementImpl((DocumentImpl) docFragImpl
+						.getOwnerDocument(), localName, (NamespaceImpl) ns, builder);
+				return elem3;
+			default:
+				throw new OMDOMException(
+						"The parent container can only be an ELEMENT, DOCUMENT or a DOCUMENT FRAGMENT");
+		}
+	}
+
+	/**
+	 * Create an OMElement
+	 * @see org.apache.axis2.om.OMFactory#createOMElement(java.lang.String, java.lang.String,
java.lang.String)
+	 */
 	public OMElement createOMElement(String localName, String namespaceURI, String namespacePrefix)
{
-		// TODO
-		throw new UnsupportedOperationException("TODO");
+		NamespaceImpl ns = new NamespaceImpl(namespaceURI,namespacePrefix);
+		return this.createOMElement(localName, ns);
 	}
 
+	/**
+	 * Create a new OMDOM Element node and add it to the given parent
+	 * @see #createOMElement(String, OMNamespace, OMContainer)
+	 * @see org.apache.axis2.om.OMFactory#createOMElement(javax.xml.namespace.QName, org.apache.axis2.om.OMContainer)
+	 */
 	public OMElement createOMElement(QName qname, OMContainer parent) throws OMException {
-		// TODO
-		throw new UnsupportedOperationException("TODO");
+		NamespaceImpl ns;
+		if(qname.getPrefix() != null) {
+			ns = new NamespaceImpl(qname.getNamespaceURI(), qname.getPrefix());
+		} else {
+			ns = new NamespaceImpl(qname.getNamespaceURI());
+		}
+		return createOMElement(qname.getLocalPart(),ns,parent);
 	}
 
+	/**
+	 * Create a new OMNamespace
+	 * @see org.apache.axis2.om.OMFactory#createOMNamespace(java.lang.String, java.lang.String)
+	 */
 	public OMNamespace createOMNamespace(String uri, String prefix) {
-		// TODO
-		throw new UnsupportedOperationException("TODO");
+		return new NamespaceImpl(uri,prefix);
 	}
 
+	/**
+	 * Create a new OMDOM Text node with the given value and append it to the 
+	 * given parent element
+	 * @see org.apache.axis2.om.OMFactory#createText(org.apache.axis2.om.OMElement, java.lang.String)
+	 */
 	public OMText createText(OMElement parent, String text) {
-		// TODO
-		throw new UnsupportedOperationException("TODO");
+			ElementImpl parentElem = (ElementImpl) parent;
+			TextImpl txt = new TextImpl((DocumentImpl) parentElem.getOwnerDocument(), text);
+			parentElem.addChild(txt);
+			return txt;
 	}
 
+	/**
+	 * Create a OMDOM Text node carrying the given value
+	 * 
+	 * @see org.apache.axis2.om.OMFactory#createText(java.lang.String)
+	 */
 	public OMText createText(String s) {
-		// TODO
-		throw new UnsupportedOperationException("TODO");
-	}
-
-	public OMText createText(String s, int type) {
-		// TODO
-		throw new UnsupportedOperationException("TODO");
-	}
-
-	public OMText createText(String s, String mimeType, boolean optimize) {
-		// TODO
-		throw new UnsupportedOperationException("TODO");
+		return new TextImpl(s);
 	}
 
+	/**
+	 * Create a Character node of the given type
+	 * @see org.apache.axis2.om.OMFactory#createText(java.lang.String, int)
+	 */
+	public OMText createText(String text, int type) {
+		switch (type) {
+			case Node.TEXT_NODE:
+				return new TextImpl(text);
+			default:
+				throw new OMDOMException("Only Text nodes are supported right now");
+		}
+	}
+
+	/**
+	 * Create a new OMDOM Text node with that has the value of the given text
+	 * value along with the MTOM optimization parameters and return it
+	 * @see org.apache.axis2.om.OMFactory#createText(java.lang.String, java.lang.String, boolean)
+	 */
+	public OMText createText(String text, String mimeType, boolean optimize) {
+		return new TextImpl(text, mimeType, optimize);
+	}
+
+	/**
+	 * Create a new OMDOM Text node with the given datahandler and the give 
+	 * MTOM optimization configuration and return it
+	 * @see org.apache.axis2.om.OMFactory#createText(java.lang.Object, boolean)
+	 */
 	public OMText createText(Object dataHandler, boolean optimize) {
-		// TODO
-		throw new UnsupportedOperationException("TODO");
+		return new TextImpl(dataHandler, optimize);
 	}
 
+	/**
+	 * Create an OMDOM Text node, add it to the give parent element and return it 
+	 * @see org.apache.axis2.om.OMFactory#createText(org.apache.axis2.om.OMElement, java.lang.String,
java.lang.String, boolean)
+	 */
 	public OMText createText(OMElement parent, String s, String mimeType, boolean optimize)
{
-		// TODO
-		throw new UnsupportedOperationException("TODO");
+		TextImpl text = new TextImpl((DocumentImpl)((ElementImpl)parent).getOwnerDocument(),s,
mimeType, optimize);
+		parent.addChild(text);
+		return text;
 	}
 
+	
 	public OMAttribute createOMAttribute(String localName, OMNamespace ns, String value) {
-		// TODO
-		throw new UnsupportedOperationException("TODO");
+		return new AttrImpl(localName,ns, value);
 	}
 
 	public OMDocType createOMDocType(OMContainer parent, String content) {

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMDocumentImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMDocumentImpl.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMDocumentImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMDocumentImpl.java
Thu Oct 13 01:11:41 2005
@@ -102,7 +102,7 @@
      *
      * @return
      */
-    public OMElement getDocumentElement() {
+    public OMElement getDocumentOMElement() {
         while (rootElement == null) {
             parserWrapper.next();
         }
@@ -114,7 +114,7 @@
      *
      * @param rootElement
      */
-    public void setDocumentElement(OMElement rootElement) {
+    public void setDocumentOMElement(OMElement rootElement) {
         this.rootElement = rootElement;
     }
 

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/builder/StAXOMBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/builder/StAXOMBuilder.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/builder/StAXOMBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/builder/StAXOMBuilder.java
Thu Oct 13 01:11:41 2005
@@ -99,7 +99,7 @@
         String elementName = parser.getLocalName();
         if (lastNode == null) {
             node = omfactory.createOMElement(elementName, null, null, this);
-            document.setDocumentElement(node);
+            document.setDocumentOMElement(node);
             document.addChild(node);
         } else if (lastNode.isComplete()) {
             node = omfactory.createOMElement(elementName, null,
@@ -286,7 +286,7 @@
      * @return root element
      */
     public OMElement getDocumentElement() {
-        return document.getDocumentElement();
+        return document.getDocumentOMElement();
     }
 
     /**

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPMessageImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPMessageImpl.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPMessageImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPMessageImpl.java
Thu Oct 13 01:11:41 2005
@@ -42,7 +42,7 @@
 
 
     public SOAPEnvelope getSOAPEnvelope() throws SOAPProcessingException {
-        return (SOAPEnvelope) getDocumentElement();
+        return (SOAPEnvelope) getDocumentOMElement();
     }
 
     public void setSOAPEnvelope(SOAPEnvelope envelope) throws SOAPProcessingException {
@@ -50,7 +50,7 @@
         this.rootElement = envelope;
     }
 
-    public void setDocumentElement(OMElement rootElement) {
+    public void setDocumentOMElement(OMElement rootElement) {
         throw new UnsupportedOperationException("This is not allowed. Use set SOAPEnvelope
instead");
     }
 

Modified: webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/llom/OMDocumentSerilizationTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/llom/OMDocumentSerilizationTest.java?rev=320685&r1=320684&r2=320685&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/llom/OMDocumentSerilizationTest.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/llom/OMDocumentSerilizationTest.java
Thu Oct 13 01:11:41 2005
@@ -54,7 +54,7 @@
 		documentElement.addChild(child1);
 		
 		document = factory.createOMDocument();
-		document.setDocumentElement(documentElement);
+		document.setDocumentOMElement(documentElement);
 		
 	}
 	



Mime
View raw message