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 gd...@apache.org on 2005/07/11 17:49:55 UTC
svn commit: r210150 [12/35] - in /webservices/axis/trunk/java: ./ etc/
modules/addressing/
modules/addressing/src/org/apache/axis2/handlers/addressing/
modules/addressing/test-resources/
modules/addressing/test/org/apache/axis2/handlers/addressing/ mod...
Modified: webservices/axis/trunk/java/modules/saaj/src/javax/xml/soap/SOAPMessage.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/javax/xml/soap/SOAPMessage.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/javax/xml/soap/SOAPMessage.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/javax/xml/soap/SOAPMessage.java Mon Jul 11 08:49:30 2005
@@ -16,6 +16,7 @@
package javax.xml.soap;
//import javax.activation.DataHandler;
+
import java.io.IOException;
import java.io.OutputStream;
import java.util.Iterator;
@@ -24,7 +25,7 @@
* <P>The root class for all SOAP messages. As transmitted on the
* "wire", a SOAP message is an XML document or a MIME message
* whose first body part is an XML/SOAP document.</P>
- *
+ * <p/>
* <P>A <CODE>SOAPMessage</CODE> object consists of a SOAP part
* and optionally one or more attachment parts. The SOAP part for
* a <CODE>SOAPMessage</CODE> object is a <CODE>SOAPPart</CODE>
@@ -32,18 +33,18 @@
* identification, and which can contain application-specific
* content. All data in the SOAP Part of a message must be in XML
* format.</P>
- *
+ * <p/>
* <P>A new <CODE>SOAPMessage</CODE> object contains the following
* by default:</P>
- *
+ * <p/>
* <UL>
- * <LI>A <CODE>SOAPPart</CODE> object</LI>
- *
- * <LI>A <CODE>SOAPEnvelope</CODE> object</LI>
- *
- * <LI>A <CODE>SOAPBody</CODE> object</LI>
- *
- * <LI>A <CODE>SOAPHeader</CODE> object</LI>
+ * <LI>A <CODE>SOAPPart</CODE> object</LI>
+ * <p/>
+ * <LI>A <CODE>SOAPEnvelope</CODE> object</LI>
+ * <p/>
+ * <LI>A <CODE>SOAPBody</CODE> object</LI>
+ * <p/>
+ * <LI>A <CODE>SOAPHeader</CODE> object</LI>
* </UL>
* The SOAP part of a message can be retrieved by calling the
* method <CODE>SOAPMessage.getSOAPPart()</CODE>. The <CODE>
@@ -57,7 +58,7 @@
* SOAPBody sb = se.getBody();
* SOAPHeader sh = se.getHeader();
* </PRE>
- *
+ * <p/>
* <P>In addition to the mandatory <CODE>SOAPPart</CODE> object, a
* <CODE>SOAPMessage</CODE> object may contain zero or more <CODE>
* AttachmentPart</CODE> objects, each of which contains
@@ -67,13 +68,13 @@
* <CODE>SOAPMessage</CODE> object. A party that has received a
* <CODE>SOAPMessage</CODE> object can examine its contents by
* retrieving individual attachment parts.</P>
- *
+ * <p/>
* <P>Unlike the rest of a SOAP message, an attachment is not
* required to be in XML format and can therefore be anything from
* simple text to an image file. Consequently, any message content
* that is not in XML format must be in an <CODE>
* AttachmentPart</CODE> object.</P>
- *
+ * <p/>
* <P>A <CODE>MessageFactory</CODE> object creates new <CODE>
* SOAPMessage</CODE> objects. If the <CODE>MessageFactory</CODE>
* object was initialized with a messaging Profile, it produces
@@ -81,19 +82,22 @@
* For example, a <CODE>SOAPMessage</CODE> object created by a
* <CODE>MessageFactory</CODE> object initialized with the ebXML
* Profile will have the appropriate ebXML headers.</P>
+ *
* @see MessageFactory MessageFactory
* @see AttachmentPart AttachmentPart
*/
public abstract class SOAPMessage {
- public SOAPMessage() {}
+ public SOAPMessage() {
+ }
/**
* Retrieves a description of this <CODE>SOAPMessage</CODE>
* object's content.
- * @return a <CODE>String</CODE> describing the content of this
- * message or <CODE>null</CODE> if no description has been
- * set
+ *
+ * @return a <CODE>String</CODE> describing the content of this
+ * message or <CODE>null</CODE> if no description has been
+ * set
* @see #setContentDescription(java.lang.String) setContentDescription(java.lang.String)
*/
public abstract String getContentDescription();
@@ -101,46 +105,50 @@
/**
* Sets the description of this <CODE>SOAPMessage</CODE>
* object's content with the given description.
- * @param description a <CODE>String</CODE>
- * describing the content of this message
+ *
+ * @param description a <CODE>String</CODE>
+ * describing the content of this message
* @see #getContentDescription() getContentDescription()
*/
public abstract void setContentDescription(String description);
/**
* Gets the SOAP part of this <CODE>SOAPMessage</CODE> object.
+ * <p/>
+ * <p/>
+ * <P>If a <CODE>SOAPMessage</CODE> object contains one or
+ * more attachments, the SOAP Part must be the first MIME body
+ * part in the message.</P>
*
- *
- * <P>If a <CODE>SOAPMessage</CODE> object contains one or
- * more attachments, the SOAP Part must be the first MIME body
- * part in the message.</P>
* @return the <CODE>SOAPPart</CODE> object for this <CODE>
- * SOAPMessage</CODE> object
+ * SOAPMessage</CODE> object
*/
public abstract SOAPPart getSOAPPart();
/**
* Removes all <CODE>AttachmentPart</CODE> objects that have
- * been added to this <CODE>SOAPMessage</CODE> object.
- *
- * <P>This method does not touch the SOAP part.</P>
+ * been added to this <CODE>SOAPMessage</CODE> object.
+ * <p/>
+ * <P>This method does not touch the SOAP part.</P>
*/
public abstract void removeAllAttachments();
/**
* Gets a count of the number of attachments in this
* message. This count does not include the SOAP part.
- * @return the number of <CODE>AttachmentPart</CODE> objects
- * that are part of this <CODE>SOAPMessage</CODE>
- * object
+ *
+ * @return the number of <CODE>AttachmentPart</CODE> objects
+ * that are part of this <CODE>SOAPMessage</CODE>
+ * object
*/
public abstract int countAttachments();
/**
* Retrieves all the <CODE>AttachmentPart</CODE> objects
* that are part of this <CODE>SOAPMessage</CODE> object.
- * @return an iterator over all the attachments in this
- * message
+ *
+ * @return an iterator over all the attachments in this
+ * message
*/
public abstract Iterator getAttachments();
@@ -149,11 +157,12 @@
* that have header entries that match the specified headers.
* Note that a returned attachment could have headers in
* addition to those specified.
- * @param headers a <CODE>MimeHeaders</CODE>
- * object containing the MIME headers for which to
- * search
+ *
+ * @param headers a <CODE>MimeHeaders</CODE>
+ * object containing the MIME headers for which to
+ * search
* @return an iterator over all attachments that have a header
- * that matches one of the given headers
+ * that matches one of the given headers
*/
public abstract Iterator getAttachments(MimeHeaders headers);
@@ -162,10 +171,12 @@
* <CODE>SOAPMessage</CODE> object. An <CODE>
* AttachmentPart</CODE> object must be created before it can be
* added to a message.
- * @param attachmentpart an <CODE>
- * AttachmentPart</CODE> object that is to become part of
- * this <CODE>SOAPMessage</CODE> object
+ *
+ * @param attachmentpart an <CODE>
+ * AttachmentPart</CODE> object that is to become part of
+ * this <CODE>SOAPMessage</CODE> object
* @throws java.lang.IllegalArgumentException
+ *
*/
public abstract void addAttachmentPart(AttachmentPart attachmentpart);
@@ -175,9 +186,10 @@
* called with this new <CODE>AttachmentPart</CODE> object as
* the parameter in order for it to become an attachment to this
* <CODE>SOAPMessage</CODE> object.
- * @return a new <CODE>AttachmentPart</CODE> object that can be
- * populated and added to this <CODE>SOAPMessage</CODE>
- * object
+ *
+ * @return a new <CODE>AttachmentPart</CODE> object that can be
+ * populated and added to this <CODE>SOAPMessage</CODE>
+ * object
*/
public abstract AttachmentPart createAttachmentPart();
@@ -211,8 +223,9 @@
* Returns all the transport-specific MIME headers for this
* <CODE>SOAPMessage</CODE> object in a transport-independent
* fashion.
+ *
* @return a <CODE>MimeHeaders</CODE> object containing the
- * <CODE>MimeHeader</CODE> objects
+ * <CODE>MimeHeader</CODE> objects
*/
public abstract MimeHeaders getMimeHeaders();
@@ -220,18 +233,20 @@
* Creates an <CODE>AttachmentPart</CODE> object and
* populates it with the specified data of the specified content
* type.
- * @param content an <CODE>Object</CODE>
- * containing the content for this <CODE>SOAPMessage</CODE>
- * object
- * @param contentType a <CODE>String</CODE>
- * object giving the type of content; examples are
- * "text/xml", "text/plain", and "image/jpeg"
+ *
+ * @param content an <CODE>Object</CODE>
+ * containing the content for this <CODE>SOAPMessage</CODE>
+ * object
+ * @param contentType a <CODE>String</CODE>
+ * object giving the type of content; examples are
+ * "text/xml", "text/plain", and "image/jpeg"
* @return a new <CODE>AttachmentPart</CODE> object that
- * contains the given data
- * @throws java.lang.IllegalArgumentException if the contentType does not match the type of the content
- * object, or if there was no <CODE>
- * DataContentHandler</CODE> object for the given content
- * object
+ * contains the given data
+ * @throws java.lang.IllegalArgumentException
+ * if the contentType does not match the type of the content
+ * object, or if there was no <CODE>
+ * DataContentHandler</CODE> object for the given content
+ * object
* @see DataHandler DataHandler
* @see javax.activation.DataContentHandler DataContentHandler
*/
@@ -247,26 +262,27 @@
/**
* Updates this <CODE>SOAPMessage</CODE> object with all the
- * changes that have been made to it. This method is called
- * automatically when a message is sent or written to by the
- * methods <CODE>ProviderConnection.send</CODE>, <CODE>
- * SOAPConnection.call</CODE>, or <CODE>
- * SOAPMessage.writeTo</CODE>. However, if changes are made to
- * a message that was received or to one that has already been
- * sent, the method <CODE>saveChanges</CODE> needs to be
- * called explicitly in order to save the changes. The method
- * <CODE>saveChanges</CODE> also generates any changes that
- * can be read back (for example, a MessageId in profiles that
- * support a message id). All MIME headers in a message that
- * is created for sending purposes are guaranteed to have
- * valid values only after <CODE>saveChanges</CODE> has been
- * called.
- *
- * <P>In addition, this method marks the point at which the
- * data from all constituent <CODE>AttachmentPart</CODE>
- * objects are pulled into the message.</P>
- * @throws SOAPException if there
- * was a problem saving changes to this message.
+ * changes that have been made to it. This method is called
+ * automatically when a message is sent or written to by the
+ * methods <CODE>ProviderConnection.send</CODE>, <CODE>
+ * SOAPConnection.call</CODE>, or <CODE>
+ * SOAPMessage.writeTo</CODE>. However, if changes are made to
+ * a message that was received or to one that has already been
+ * sent, the method <CODE>saveChanges</CODE> needs to be
+ * called explicitly in order to save the changes. The method
+ * <CODE>saveChanges</CODE> also generates any changes that
+ * can be read back (for example, a MessageId in profiles that
+ * support a message id). All MIME headers in a message that
+ * is created for sending purposes are guaranteed to have
+ * valid values only after <CODE>saveChanges</CODE> has been
+ * called.
+ * <p/>
+ * <P>In addition, this method marks the point at which the
+ * data from all constituent <CODE>AttachmentPart</CODE>
+ * objects are pulled into the message.</P>
+ *
+ * @throws SOAPException if there
+ * was a problem saving changes to this message.
*/
public abstract void saveChanges() throws SOAPException;
@@ -274,86 +290,88 @@
* Indicates whether this <CODE>SOAPMessage</CODE> object
* has had the method <CODE>saveChanges</CODE> called on
* it.
+ *
* @return <CODE>true</CODE> if <CODE>saveChanges</CODE> has
- * been called on this message at least once; <CODE>
- * false</CODE> otherwise.
+ * been called on this message at least once; <CODE>
+ * false</CODE> otherwise.
*/
public abstract boolean saveRequired();
/**
* Writes this <CODE>SOAPMessage</CODE> object to the given
- * output stream. The externalization format is as defined by
- * the SOAP 1.1 with Attachments specification.
+ * output stream. The externalization format is as defined by
+ * the SOAP 1.1 with Attachments specification.
+ * <p/>
+ * <P>If there are no attachments, just an XML stream is
+ * written out. For those messages that have attachments,
+ * <CODE>writeTo</CODE> writes a MIME-encoded byte stream.</P>
*
- * <P>If there are no attachments, just an XML stream is
- * written out. For those messages that have attachments,
- * <CODE>writeTo</CODE> writes a MIME-encoded byte stream.</P>
- * @param out the <CODE>OutputStream</CODE>
- * object to which this <CODE>SOAPMessage</CODE> object will
- * be written
- * @throws SOAPException if there was a problem in
- * externalizing this SOAP message
- * @throws IOException if an I/O error
- * occurs
+ * @param out the <CODE>OutputStream</CODE>
+ * object to which this <CODE>SOAPMessage</CODE> object will
+ * be written
+ * @throws SOAPException if there was a problem in
+ * externalizing this SOAP message
+ * @throws IOException if an I/O error
+ * occurs
*/
public abstract void writeTo(OutputStream out)
- throws SOAPException, IOException;
+ throws SOAPException, IOException;
/**
* Gets the SOAP Body contained in this <code>SOAPMessage</code> object.
*
* @return the <code>SOAPBody</code> object contained by this
- * <code>SOAPMessage</code> object
+ * <code>SOAPMessage</code> object
* @throws SOAPException if the SOAP Body does not exist or cannot be
- * retrieved
+ * retrieved
*/
public SOAPBody getSOAPBody() throws SOAPException {
- throw new UnsupportedOperationException("getSOAPBody must be overridden in subclasses of SOAPMessage");
+ throw new UnsupportedOperationException("getSOAPBody must be overridden in subclasses of SOAPMessage");
}
/**
* Gets the SOAP Header contained in this <code>SOAPMessage</code> object.
*
* @return the <code>SOAPHeader</code> object contained by this
- * <code>SOAPMessage</code> object
- * @throws SOAPException if the SOAP Header does not exist or cannot be
- * retrieved
+ * <code>SOAPMessage</code> object
+ * @throws SOAPException if the SOAP Header does not exist or cannot be
+ * retrieved
*/
public SOAPHeader getSOAPHeader() throws SOAPException {
- throw new UnsupportedOperationException("getSOAPHeader must be overridden in subclasses of SOAPMessage");
+ throw new UnsupportedOperationException("getSOAPHeader must be overridden in subclasses of SOAPMessage");
}
/**
* Associates the specified value with the specified property. If there was
* already a value associated with this property, the old value is replaced.
- * <p>
+ * <p/>
* The valid property names include <code>WRITE_XML_DECLARATION</code> and
* <code>CHARACTER_SET_ENCODING</code>. All of these standard SAAJ
* properties are prefixed by "javax.xml.soap". Vendors may also add
* implementation specific properties. These properties must be prefixed
* with package names that are unique to the vendor.
- * <p>
+ * <p/>
* Setting the property <code>WRITE_XML_DECLARATION</code> to
* <code>"true"</code> will cause an XML Declaration to be written out at
* the start of the SOAP message. The default value of "false" suppresses
* this declaration.
- * <p>
+ * <p/>
* The property <code>CHARACTER_SET_ENCODING</code> defaults to the value
* <code>"utf-8"</code> which causes the SOAP message to be encoded using
* UTF-8. Setting <code>CHARACTER_SET_ENCODING</code> to
* <code>"utf-16"</code> causes the SOAP message to be encoded using UTF-16.
- * <p>
+ * <p/>
* Some implementations may allow encodings in addition to UTF-8 and UTF-16.
* Refer to your vendor's documentation for details.
*
* @param property the property with which the specified value is to be
- * associated
- * @param value the value to be associated with the specified property
+ * associated
+ * @param value the value to be associated with the specified property
* @throws SOAPException if the property name is not recognized
*/
public void setProperty(String property, Object value)
- throws SOAPException {
- throw new UnsupportedOperationException("setProperty must be overridden in subclasses of SOAPMessage");
+ throws SOAPException {
+ throw new UnsupportedOperationException("setProperty must be overridden in subclasses of SOAPMessage");
}
/**
@@ -361,18 +379,22 @@
*
* @param property the name of the property to retrieve
* @return the value of the property or <code>null</code> if no such
- * property exists
- * @throws SOAPException if the property name is not recognized
+ * property exists
+ * @throws SOAPException if the property name is not recognized
*/
public Object getProperty(String property) throws SOAPException {
- throw new UnsupportedOperationException("getProperty must be overridden in subclasses of SOAPMessage");
+ throw new UnsupportedOperationException("getProperty must be overridden in subclasses of SOAPMessage");
}
- /** Specifies the character type encoding for the SOAP Message. */
+ /**
+ * Specifies the character type encoding for the SOAP Message.
+ */
public static final String CHARACTER_SET_ENCODING
= "javax.xml.soap.character-set-encoding";
- /** Specifies whether the SOAP Message should contain an XML declaration. */
+ /**
+ * Specifies whether the SOAP Message should contain an XML declaration.
+ */
public static final String WRITE_XML_DECLARATION
= "javax.xml.soap.write-xml-declaration";
}
Modified: webservices/axis/trunk/java/modules/saaj/src/javax/xml/soap/SOAPPart.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/javax/xml/soap/SOAPPart.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/javax/xml/soap/SOAPPart.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/javax/xml/soap/SOAPPart.java Mon Jul 11 08:49:30 2005
@@ -24,7 +24,7 @@
* SOAP part, so when a <CODE>SOAPMessage</CODE> object is
* created, it will automatically have a <CODE>SOAPPart</CODE>
* object.</P>
- *
+ * <p/>
* <P>A <CODE>SOAPPart</CODE> object is a MIME part and has the
* MIME headers Content-Id, Content-Location, and Content-Type.
* Because the value of Content-Type must be "text/xml", a <CODE>
@@ -34,13 +34,13 @@
* must be in XML format. Content that is not of type "text/xml"
* must be in an <CODE>AttachmentPart</CODE> object rather than in
* the <CODE>SOAPPart</CODE> object.</P>
- *
+ * <p/>
* <P>When a message is sent, its SOAP part must have the MIME
* header Content-Type set to "text/xml". Or, from the other
* perspective, the SOAP part of any message that is received must
* have the MIME header Content-Type with a value of
* "text/xml".</P>
- *
+ * <p/>
* <P>A client can access the <CODE>SOAPPart</CODE> object of a
* <CODE>SOAPMessage</CODE> object by calling the method <CODE>
* SOAPMessage.getSOAPPart</CODE>. The following line of code, in
@@ -49,7 +49,7 @@
* <PRE>
* SOAPPart soapPart = message.getSOAPPart();
* </PRE>
- *
+ * <p/>
* <P>A <CODE>SOAPPart</CODE> object contains a <CODE>
* SOAPEnvelope</CODE> object, which in turn contains a <CODE>
* SOAPBody</CODE> object and a <CODE>SOAPHeader</CODE> object.
@@ -58,23 +58,26 @@
*/
public abstract class SOAPPart implements org.w3c.dom.Document {
- public SOAPPart() {}
+ public SOAPPart() {
+ }
/**
* Gets the <CODE>SOAPEnvelope</CODE> object associated with
* this <CODE>SOAPPart</CODE> object. Once the SOAP envelope is
* obtained, it can be used to get its contents.
+ *
* @return the <CODE>SOAPEnvelope</CODE> object for this <CODE>
- * SOAPPart</CODE> object
- * @throws SOAPException if there is a SOAP error
+ * SOAPPart</CODE> object
+ * @throws SOAPException if there is a SOAP error
*/
public abstract SOAPEnvelope getEnvelope() throws SOAPException;
/**
* Retrieves the value of the MIME header whose name is
* "Content-Id".
- * @return a <CODE>String</CODE> giving the value of the MIME
- * header named "Content-Id"
+ *
+ * @return a <CODE>String</CODE> giving the value of the MIME
+ * header named "Content-Id"
* @see #setContentId(java.lang.String) setContentId(java.lang.String)
*/
public String getContentId() {
@@ -91,8 +94,9 @@
/**
* Retrieves the value of the MIME header whose name is
* "Content-Location".
+ *
* @return a <CODE>String</CODE> giving the value of the MIME
- * header whose name is "Content-Location"
+ * header whose name is "Content-Location"
* @see #setContentLocation(java.lang.String) setContentLocation(java.lang.String)
*/
public String getContentLocation() {
@@ -109,10 +113,12 @@
/**
* Sets the value of the MIME header named "Content-Id" to
* the given <CODE>String</CODE>.
- * @param contentId a <CODE>String</CODE> giving
- * the value of the MIME header "Content-Id"
- * @throws java.lang.IllegalArgumentException if
- * there is a problem in setting the content id
+ *
+ * @param contentId a <CODE>String</CODE> giving
+ * the value of the MIME header "Content-Id"
+ * @throws java.lang.IllegalArgumentException
+ * if
+ * there is a problem in setting the content id
* @see #getContentId() getContentId()
*/
public void setContentId(String contentId) {
@@ -122,11 +128,13 @@
/**
* Sets the value of the MIME header "Content-Location" to
* the given <CODE>String</CODE>.
- * @param contentLocation a <CODE>String</CODE>
- * giving the value of the MIME header
- * "Content-Location"
- * @throws java.lang.IllegalArgumentException if
- * there is a problem in setting the content location.
+ *
+ * @param contentLocation a <CODE>String</CODE>
+ * giving the value of the MIME header
+ * "Content-Location"
+ * @throws java.lang.IllegalArgumentException
+ * if
+ * there is a problem in setting the content location.
* @see #getContentLocation() getContentLocation()
*/
public void setContentLocation(String contentLocation) {
@@ -135,8 +143,9 @@
/**
* Removes all MIME headers that match the given name.
- * @param header a <CODE>String</CODE> giving
- * the name of the MIME header(s) to be removed
+ *
+ * @param header a <CODE>String</CODE> giving
+ * the name of the MIME header(s) to be removed
*/
public abstract void removeMimeHeader(String header);
@@ -150,58 +159,63 @@
* Gets all the values of the <CODE>MimeHeader</CODE> object
* in this <CODE>SOAPPart</CODE> object that is identified by
* the given <CODE>String</CODE>.
- * @param name the name of the header; example:
- * "Content-Type"
+ *
+ * @param name the name of the header; example:
+ * "Content-Type"
* @return a <CODE>String</CODE> array giving all the values for
- * the specified header
+ * the specified header
* @see #setMimeHeader(java.lang.String, java.lang.String) setMimeHeader(java.lang.String, java.lang.String)
*/
public abstract String[] getMimeHeader(String name);
/**
* Changes the first header entry that matches the given
- * header name so that its value is the given value, adding a
- * new header with the given name and value if no existing
- * header is a match. If there is a match, this method clears
- * all existing values for the first header that matches and
- * sets the given value instead. If more than one header has
- * the given name, this method removes all of the matching
- * headers after the first one.
- *
- * <P>Note that RFC822 headers can contain only US-ASCII
- * characters.</P>
- * @param name a <CODE>String</CODE> giving the
- * header name for which to search
- * @param value a <CODE>String</CODE> giving the
- * value to be set. This value will be substituted for the
- * current value(s) of the first header that is a match if
- * there is one. If there is no match, this value will be
- * the value for a new <CODE>MimeHeader</CODE> object.
- * @throws java.lang.IllegalArgumentException if
- * there was a problem with the specified mime header name
- * or value
- * @throws java.lang.IllegalArgumentException if there was a problem with the specified mime header name or value
+ * header name so that its value is the given value, adding a
+ * new header with the given name and value if no existing
+ * header is a match. If there is a match, this method clears
+ * all existing values for the first header that matches and
+ * sets the given value instead. If more than one header has
+ * the given name, this method removes all of the matching
+ * headers after the first one.
+ * <p/>
+ * <P>Note that RFC822 headers can contain only US-ASCII
+ * characters.</P>
+ *
+ * @param name a <CODE>String</CODE> giving the
+ * header name for which to search
+ * @param value a <CODE>String</CODE> giving the
+ * value to be set. This value will be substituted for the
+ * current value(s) of the first header that is a match if
+ * there is one. If there is no match, this value will be
+ * the value for a new <CODE>MimeHeader</CODE> object.
+ * @throws java.lang.IllegalArgumentException
+ * if
+ * there was a problem with the specified mime header name
+ * or value
+ * @throws java.lang.IllegalArgumentException
+ * if there was a problem with the specified mime header name or value
* @see #getMimeHeader(java.lang.String) getMimeHeader(java.lang.String)
*/
public abstract void setMimeHeader(String name, String value);
/**
- * Creates a <CODE>MimeHeader</CODE> object with the specified
- * name and value and adds it to this <CODE>SOAPPart</CODE>
- * object. If a <CODE>MimeHeader</CODE> with the specified
- * name already exists, this method adds the specified value
- * to the already existing value(s).
- *
- * <P>Note that RFC822 headers can contain only US-ASCII
- * characters.</P>
- *
- * @param name a <CODE>String</CODE> giving the
- * header name
- * @param value a <CODE>String</CODE> giving the
- * value to be set or added
- * @throws java.lang.IllegalArgumentException if
- * there was a problem with the specified mime header name
- * or value
+ * Creates a <CODE>MimeHeader</CODE> object with the specified
+ * name and value and adds it to this <CODE>SOAPPart</CODE>
+ * object. If a <CODE>MimeHeader</CODE> with the specified
+ * name already exists, this method adds the specified value
+ * to the already existing value(s).
+ * <p/>
+ * <P>Note that RFC822 headers can contain only US-ASCII
+ * characters.</P>
+ *
+ * @param name a <CODE>String</CODE> giving the
+ * header name
+ * @param value a <CODE>String</CODE> giving the
+ * value to be set or added
+ * @throws java.lang.IllegalArgumentException
+ * if
+ * there was a problem with the specified mime header name
+ * or value
*/
public abstract void addMimeHeader(String name, String value);
@@ -209,41 +223,45 @@
* Retrieves all the headers for this <CODE>SOAPPart</CODE>
* object as an iterator over the <CODE>MimeHeader</CODE>
* objects.
+ *
* @return an <CODE>Iterator</CODE> object with all of the Mime
- * headers for this <CODE>SOAPPart</CODE> object
+ * headers for this <CODE>SOAPPart</CODE> object
*/
public abstract Iterator getAllMimeHeaders();
/**
* Retrieves all <CODE>MimeHeader</CODE> objects that match
* a name in the given array.
- * @param names a <CODE>String</CODE> array with
- * the name(s) of the MIME headers to be returned
+ *
+ * @param names a <CODE>String</CODE> array with
+ * the name(s) of the MIME headers to be returned
* @return all of the MIME headers that match one of the names
- * in the given array, returned as an <CODE>Iterator</CODE>
- * object
+ * in the given array, returned as an <CODE>Iterator</CODE>
+ * object
*/
public abstract Iterator getMatchingMimeHeaders(String names[]);
/**
* Retrieves all <CODE>MimeHeader</CODE> objects whose name
* does not match a name in the given array.
- * @param names a <CODE>String</CODE> array with
- * the name(s) of the MIME headers not to be returned
+ *
+ * @param names a <CODE>String</CODE> array with
+ * the name(s) of the MIME headers not to be returned
* @return all of the MIME headers in this <CODE>SOAPPart</CODE>
- * object except those that match one of the names in the
- * given array. The nonmatching MIME headers are returned as
- * an <CODE>Iterator</CODE> object.
+ * object except those that match one of the names in the
+ * given array. The nonmatching MIME headers are returned as
+ * an <CODE>Iterator</CODE> object.
*/
public abstract Iterator getNonMatchingMimeHeaders(String names[]);
/**
* Sets the content of the <CODE>SOAPEnvelope</CODE> object
* with the data from the given <CODE>Source</CODE> object.
- * @param source javax.xml.transform.Source</CODE> object with the data to
- * be set
- * @throws SOAPException if there is a problem in
- * setting the source
+ *
+ * @param source javax.xml.transform.Source</CODE> object with the data to
+ * be set
+ * @throws SOAPException if there is a problem in
+ * setting the source
* @see #getContent() getContent()
*/
public abstract void setContent(Source source) throws SOAPException;
@@ -251,10 +269,11 @@
/**
* Returns the content of the SOAPEnvelope as a JAXP <CODE>
* Source</CODE> object.
+ *
* @return the content as a <CODE>
- * javax.xml.transform.Source</CODE> object
- * @throws SOAPException if the implementation cannot
- * convert the specified <CODE>Source</CODE> object
+ * javax.xml.transform.Source</CODE> object
+ * @throws SOAPException if the implementation cannot
+ * convert the specified <CODE>Source</CODE> object
* @see #setContent(javax.xml.transform.Source) setContent(javax.xml.transform.Source)
*/
public abstract Source getContent() throws SOAPException;
Modified: webservices/axis/trunk/java/modules/saaj/src/javax/xml/soap/Text.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/javax/xml/soap/Text.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/javax/xml/soap/Text.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/javax/xml/soap/Text.java Mon Jul 11 08:49:30 2005
@@ -17,16 +17,17 @@
/**
* A representation of a node whose value is text. A <CODE>
- * Text</CODE> object may represent text that is content or text
- * that is a comment.
+ * Text</CODE> object may represent text that is content or text
+ * that is a comment.
*/
public interface Text extends Node, org.w3c.dom.Text {
/**
* Retrieves whether this <CODE>Text</CODE> object
* represents a comment.
- * @return <CODE>true</CODE> if this <CODE>Text</CODE> object is
- * a comment; <CODE>false</CODE> otherwise
+ *
+ * @return <CODE>true</CODE> if this <CODE>Text</CODE> object is
+ * a comment; <CODE>false</CODE> otherwise
*/
public abstract boolean isComment();
}
Modified: webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttrImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttrImpl.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttrImpl.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttrImpl.java Mon Jul 11 08:49:30 2005
@@ -21,93 +21,98 @@
/**
* @author Jayachandra
- *
*/
public class AttrImpl extends NodeImpl implements Attr {
-
- private boolean specified = false;
- private OMAttribute omAttr;
- private Element ownerElement=null;
-
- /**
- *
- */
- public AttrImpl() {
- super();
- }
-
- /**
- * @param attrib
- */
- public AttrImpl(OMAttribute attrib, Element owner) {
- super(attrib);
- this.omAttr = attrib;
- this.ownerElement = owner;
- }
-
- /**
- * Method getSpecified
- * Returns true if this attribute value is set by user in the original document,
- * if so far user didn't set some value to this OR if the user removed this
- * attribute (may be by calling removeAttribute() on owner element) the specified
- * value returned should be false
- * @see org.w3c.dom.Attr#getSpecified()
- */
- public boolean getSpecified() {
- return specified;
- }
-
- /**
- * Method setSpecified
- * This method sets the value of the private datamember <code>specified</code>
- * equals to that of the passed input parameter <code>val</code> and returns the
- * final value of <code>specified</code> flag
- * @param val
- * @return boolean
- */
- public boolean setSpecified(boolean val) {
- this.specified = val;
- return specified;
- }
-
- /**
- * Method getName
- * returns the localName of the attribute
- * @return String
- * @see org.w3c.dom.Attr#getName()
- */
- public String getName() {
- return omAttr.getLocalName();
- }
-
- /**
- * Method getOwnerElement
- * returns the <code>Element</code> object to which this attribute is attached
- * @return Element
- * @see org.w3c.dom.Attr#getOwnerElement()
- */
- public Element getOwnerElement() {
- return ownerElement;
- }
-
- /**
- * Method getValue
- * returns the value of this attribute
- * @return String
- */
- public String getValue() {
- return omAttr.getValue();
- }
-
- /**
- * Method setValue
- * This method sets the value of this attribute to the provided input
- * <code>value</code>
- * @param value
- * @return
- */
- public void setValue(String value) {
- omAttr.setValue(value);
- setSpecified(true);
- }
+
+ private boolean specified = false;
+ private OMAttribute omAttr;
+ private Element ownerElement = null;
+
+ /**
+ *
+ */
+ public AttrImpl() {
+ super();
+ }
+
+ /**
+ * @param attrib
+ */
+ public AttrImpl(OMAttribute attrib, Element owner) {
+ super(attrib);
+ this.omAttr = attrib;
+ this.ownerElement = owner;
+ }
+
+ /**
+ * Method getSpecified
+ * Returns true if this attribute value is set by user in the original document,
+ * if so far user didn't set some value to this OR if the user removed this
+ * attribute (may be by calling removeAttribute() on owner element) the specified
+ * value returned should be false
+ *
+ * @see org.w3c.dom.Attr#getSpecified()
+ */
+ public boolean getSpecified() {
+ return specified;
+ }
+
+ /**
+ * Method setSpecified
+ * This method sets the value of the private datamember <code>specified</code>
+ * equals to that of the passed input parameter <code>val</code> and returns the
+ * final value of <code>specified</code> flag
+ *
+ * @param val
+ * @return boolean
+ */
+ public boolean setSpecified(boolean val) {
+ this.specified = val;
+ return specified;
+ }
+
+ /**
+ * Method getName
+ * returns the localName of the attribute
+ *
+ * @return String
+ * @see org.w3c.dom.Attr#getName()
+ */
+ public String getName() {
+ return omAttr.getLocalName();
+ }
+
+ /**
+ * Method getOwnerElement
+ * returns the <code>Element</code> object to which this attribute is attached
+ *
+ * @return Element
+ * @see org.w3c.dom.Attr#getOwnerElement()
+ */
+ public Element getOwnerElement() {
+ return ownerElement;
+ }
+
+ /**
+ * Method getValue
+ * returns the value of this attribute
+ *
+ * @return String
+ */
+ public String getValue() {
+ return omAttr.getValue();
+ }
+
+ /**
+ * Method setValue
+ * This method sets the value of this attribute to the provided input
+ * <code>value</code>
+ *
+ * @param value
+ * @return
+ */
+ public void setValue(String value) {
+ omAttr.setValue(value);
+ setSpecified(true);
+ }
}
Modified: webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailEntryImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailEntryImpl.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailEntryImpl.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailEntryImpl.java Mon Jul 11 08:49:30 2005
@@ -19,32 +19,31 @@
/**
* Class DetailEntryImpl
- *
+ *
* @author Ashutosh Shahi
- * ashutosh.shahi@gmail.com
+ * ashutosh.shahi@gmail.com
*/
public class DetailEntryImpl extends SOAPElementImpl implements DetailEntry {
-
- /**
- * Field detailEntry
- */
- private org.apache.axis2.om.OMElement detailEntry;
-
- /**
- * Constructor DetailEntryImpl
- *
- */
- public DetailEntryImpl(){
-
- }
-
- /**
- * Constructor DetailEntryImpl
- *
- * @param detailEntry
- */
- public DetailEntryImpl(org.apache.axis2.om.OMElement detailEntry){
- this.detailEntry = detailEntry;
- }
+
+ /**
+ * Field detailEntry
+ */
+ private org.apache.axis2.om.OMElement detailEntry;
+
+ /**
+ * Constructor DetailEntryImpl
+ */
+ public DetailEntryImpl() {
+
+ }
+
+ /**
+ * Constructor DetailEntryImpl
+ *
+ * @param detailEntry
+ */
+ public DetailEntryImpl(org.apache.axis2.om.OMElement detailEntry) {
+ this.detailEntry = detailEntry;
+ }
}
Modified: webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailImpl.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailImpl.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailImpl.java Mon Jul 11 08:49:30 2005
@@ -22,93 +22,88 @@
import org.apache.axis2.soap.SOAPFactory;
import org.apache.axis2.soap.SOAPFaultDetail;
-import javax.xml.soap.Detail;
-import javax.xml.soap.DetailEntry;
-import javax.xml.soap.Name;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPFault;
-
+import javax.xml.soap.*;
import java.util.ArrayList;
import java.util.Iterator;
/**
* Class DetailImpl
- *
+ *
* @author Ashutosh Shahi
- * ashutosh.shahi@gmail.com
+ * ashutosh.shahi@gmail.com
*/
public class DetailImpl extends SOAPFaultElementImpl implements Detail {
-
- /**
- * Field detail
- */
- protected SOAPFaultDetail detail;
-
- /**
- * Constructor DetailImpl
- *
- * @param detailName
- * @param parent
- */
- public DetailImpl(SOAPFault parent){
- SOAPFactory soapFactory = OMAbstractFactory.getDefaultSOAPFactory();
- org.apache.axis2.soap.SOAPFault omFault = ((SOAPFaultImpl)parent).getOMFault();
- detail = soapFactory.createSOAPFaultDetail(omFault);
- }
-
- public DetailImpl(SOAPFaultDetail detail){
- this.detail = detail;
- }
-
- /**
- * Method addDetailEntry
- *
- * @param name
- * @return
- * @throws SOAPException
- * @see javax.xml.soap.Detail#addDetailEntry(javax.xml.soap.Name)
- */
- public DetailEntry addDetailEntry(Name name) throws SOAPException {
-
- String localName = name.getLocalName();
- OMFactory omFactory = OMAbstractFactory.getOMFactory();
- OMNamespace ns = omFactory.createOMNamespace(name.getURI(), name.getPrefix());
- OMElement detailEntry = omFactory.createOMElement(localName, ns);
- detail.addDetailEntry(detailEntry);
- return (new DetailEntryImpl(detailEntry));
- }
-
- /**
- * Method addDetailEntry
- *
- * @param detailEntry
- * @return
- */
- protected DetailEntry addDetailEntry(org.apache.axis2.om.OMElement detailEntry){
- detail.addDetailEntry(detailEntry);
- return (new DetailEntryImpl(detailEntry));
- }
-
- /**
- * Method getDetailEntries
- *
- * @return
- * @see javax.xml.soap.Detail#getDetailEntries()
- */
- public Iterator getDetailEntries() {
- // Get the detailEntried which will be omElements
- // convert them to soap DetailEntry and return the iterator
- Iterator detailEntryIter = detail.getAllDetailEntries();
- ArrayList aList = new ArrayList();
- while(detailEntryIter.hasNext()){
- Object o = detailEntryIter.next();
- if(o instanceof org.apache.axis2.om.OMElement){
- OMElement omDetailEntry = (OMElement)o;
- DetailEntry detailEntry = new DetailEntryImpl(omDetailEntry);
- aList.add(detailEntry);
- }
- }
- return aList.iterator();
- }
+
+ /**
+ * Field detail
+ */
+ protected SOAPFaultDetail detail;
+
+ /**
+ * Constructor DetailImpl
+ *
+ * @param detailName
+ * @param parent
+ */
+ public DetailImpl(SOAPFault parent) {
+ SOAPFactory soapFactory = OMAbstractFactory.getDefaultSOAPFactory();
+ org.apache.axis2.soap.SOAPFault omFault = ((SOAPFaultImpl) parent).getOMFault();
+ detail = soapFactory.createSOAPFaultDetail(omFault);
+ }
+
+ public DetailImpl(SOAPFaultDetail detail) {
+ this.detail = detail;
+ }
+
+ /**
+ * Method addDetailEntry
+ *
+ * @param name
+ * @return
+ * @throws SOAPException
+ * @see javax.xml.soap.Detail#addDetailEntry(javax.xml.soap.Name)
+ */
+ public DetailEntry addDetailEntry(Name name) throws SOAPException {
+
+ String localName = name.getLocalName();
+ OMFactory omFactory = OMAbstractFactory.getOMFactory();
+ OMNamespace ns = omFactory.createOMNamespace(name.getURI(), name.getPrefix());
+ OMElement detailEntry = omFactory.createOMElement(localName, ns);
+ detail.addDetailEntry(detailEntry);
+ return (new DetailEntryImpl(detailEntry));
+ }
+
+ /**
+ * Method addDetailEntry
+ *
+ * @param detailEntry
+ * @return
+ */
+ protected DetailEntry addDetailEntry(org.apache.axis2.om.OMElement detailEntry) {
+ detail.addDetailEntry(detailEntry);
+ return (new DetailEntryImpl(detailEntry));
+ }
+
+ /**
+ * Method getDetailEntries
+ *
+ * @return
+ * @see javax.xml.soap.Detail#getDetailEntries()
+ */
+ public Iterator getDetailEntries() {
+ // Get the detailEntried which will be omElements
+ // convert them to soap DetailEntry and return the iterator
+ Iterator detailEntryIter = detail.getAllDetailEntries();
+ ArrayList aList = new ArrayList();
+ while (detailEntryIter.hasNext()) {
+ Object o = detailEntryIter.next();
+ if (o instanceof org.apache.axis2.om.OMElement) {
+ OMElement omDetailEntry = (OMElement) o;
+ DetailEntry detailEntry = new DetailEntryImpl(omDetailEntry);
+ aList.add(detailEntry);
+ }
+ }
+ return aList.iterator();
+ }
}
Modified: webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MessageFactoryImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MessageFactoryImpl.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MessageFactoryImpl.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MessageFactoryImpl.java Mon Jul 11 08:49:30 2005
@@ -24,29 +24,29 @@
/**
* @author Ashutosh Shahi ashutosh.shahi@gmail.com
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
+ * <p/>
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
*/
public class MessageFactoryImpl extends MessageFactory {
- /* (non-Javadoc)
- * @see javax.xml.soap.MessageFactory#createMessage()
- */
- public SOAPMessage createMessage() throws SOAPException {
- SOAPEnvelopeImpl env = new SOAPEnvelopeImpl();
- SOAPMessageImpl message = new SOAPMessageImpl(env);
- return message;
- }
+ /* (non-Javadoc)
+ * @see javax.xml.soap.MessageFactory#createMessage()
+ */
+ public SOAPMessage createMessage() throws SOAPException {
+ SOAPEnvelopeImpl env = new SOAPEnvelopeImpl();
+ SOAPMessageImpl message = new SOAPMessageImpl(env);
+ return message;
+ }
- /* (non-Javadoc)
- * @see javax.xml.soap.MessageFactory#createMessage(javax.xml.soap.MimeHeaders, java.io.InputStream)
- */
- public SOAPMessage createMessage(MimeHeaders mimeheaders,
- InputStream inputstream) throws IOException, SOAPException {
- // TODO Auto-generated method stub
- SOAPMessageImpl message = new SOAPMessageImpl(inputstream, false,mimeheaders);
- return message;
- }
+ /* (non-Javadoc)
+ * @see javax.xml.soap.MessageFactory#createMessage(javax.xml.soap.MimeHeaders, java.io.InputStream)
+ */
+ public SOAPMessage createMessage(MimeHeaders mimeheaders,
+ InputStream inputstream) throws IOException, SOAPException {
+ // TODO Auto-generated method stub
+ SOAPMessageImpl message = new SOAPMessageImpl(inputstream, false, mimeheaders);
+ return message;
+ }
}
Modified: webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MimeHeaders.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MimeHeaders.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MimeHeaders.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MimeHeaders.java Mon Jul 11 08:49:30 2005
@@ -20,9 +20,9 @@
/**
* @author Ashutosh Shahi ashutosh.shahi@gmail.com
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
+ * <p/>
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
*/
public class MimeHeaders extends javax.xml.soap.MimeHeaders {
public MimeHeaders() {
Modified: webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/NodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/NodeImpl.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/NodeImpl.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/NodeImpl.java Mon Jul 11 08:49:30 2005
@@ -31,63 +31,64 @@
* Class NodeImpl
*
* @author Ashutosh Shahi
- * ashutosh.shahi@gmail.com
+ * ashutosh.shahi@gmail.com
*/
public class NodeImpl implements Node {
- /**
- * Field omNode
- */
- protected org.apache.axis2.om.OMNode omNode;
- /**
- * field document
- */
- protected org.w3c.dom.Document document;
-
- //protected CharacterData textRep = null;
-
- /**
- * Constructor NodeImpl
- *
- */
- public NodeImpl(){
-
- }
-
- /**
- * Constructor NodeImpl
- *
- * @param node
- */
- public NodeImpl(OMNode node){
- this.omNode = node;
- }
- /**
- * Constructor NodeImpl
- *
- * @param attrib
- */
- public NodeImpl(OMAttribute attrib){
- //TODO
- // To be implemented
- // Find out a way to construct OMNode from a OMAttribute
- // as OMAttributes are immutable
- }
-
- /**
- * Constructor NodeImpl
- *
- * @param ns
- */
- public NodeImpl(OMNamespace ns){
- //TODO
- // To be implemented
- // Find out a way to construct OMNode from OMNamespace
- // OMNamespace is immutable
- }
+ /**
+ * Field omNode
+ */
+ protected org.apache.axis2.om.OMNode omNode;
+ /**
+ * field document
+ */
+ protected org.w3c.dom.Document document;
+
+ //protected CharacterData textRep = null;
+
+ /**
+ * Constructor NodeImpl
+ */
+ public NodeImpl() {
- /**
+ }
+
+ /**
+ * Constructor NodeImpl
+ *
+ * @param node
+ */
+ public NodeImpl(OMNode node) {
+ this.omNode = node;
+ }
+
+ /**
+ * Constructor NodeImpl
+ *
+ * @param attrib
+ */
+ public NodeImpl(OMAttribute attrib) {
+ //TODO
+ // To be implemented
+ // Find out a way to construct OMNode from a OMAttribute
+ // as OMAttributes are immutable
+ }
+
+ /**
+ * Constructor NodeImpl
+ *
+ * @param ns
+ */
+ public NodeImpl(OMNamespace ns) {
+ //TODO
+ // To be implemented
+ // 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) {
@@ -95,406 +96,424 @@
}
*/
- 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)
- return new NodeImpl(((OMElement)omNode).getFirstChild()).getValue();
- return null;
- }
-
- /**
- * 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);
- }
-
- /**
- * Method getParentElement
- * @see javax.xml.soap.Node#getParentElement()
- */
- public SOAPElement getParentElement() {
-
- OMElement omParent = (OMElement)omNode.getParent();
- return new SOAPElementImpl(omParent);
- }
-
- /**
- * Method detachNode
- * @see javax.xml.soap.Node#detachNode()
- */
- public void detachNode() {
-
- omNode.detach();
- }
-
- /**
- * Method recycleNode
- * @see javax.xml.soap.Node#recycleNode()
- */
- public void recycleNode() {
- // No corresponding implementation in OM
- // There is no implementation in Axis 1.2 also
-
- }
-
- /**
- * 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 = (OMElement)omNode.getParent();
- ((OMText)omNode).discard();
- omNode = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createText(parent, value);
- } else if(omNode.getType() == OMNode.ELEMENT_NODE){
- OMNode firstChild = ((OMElement)omNode).getFirstChild();
- if(firstChild == null ){
- firstChild = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createText((OMElement)omNode, value);
- }
- else if(firstChild.getType() == OMNode.TEXT_NODE){
- ((OMText)firstChild).discard();
- firstChild = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createText((OMElement)omNode, value);
- }
- } else{
- throw new IllegalStateException();
- }
- }
-
- /**
- * Method getNodeType
- * @see org.w3c.dom.Node#getNodeType()
- */
- public short getNodeType() {
-
- return (short)omNode.getType();
- }
-
- /**
- * Method normalize
- * @see org.w3c.dom.Node#normalize()
- */
- public void normalize() {
- // No corresponding function in OM
- //Axis 1.2 also doesn't have any implementation for this
-
- }
-
- /**
- * Method hasAttributes
- * @see org.w3c.dom.Node#hasAttributes()
- */
- public boolean hasAttributes() {
- if(omNode instanceof OMElement){
- Iterator iter = ((OMElement)omNode).getAttributes();
- return (iter.hasNext() ? true : false);
- }
- return false;
- }
-
- /**
- * Method hasChildNodes
- * @see org.w3c.dom.Node#hasChildNodes()
- */
- public boolean hasChildNodes() {
- if(omNode instanceof OMElement){
- Iterator iter = ((OMElement)omNode).getChildren();
- return (iter.hasNext() ? true : false);
- }
- return false;
- }
-
- /**
- * Method getLocalName
- * @see org.w3c.dom.Node#getLocalName()
- */
- public String getLocalName() {
- if(omNode.getType() == ELEMENT_NODE || omNode.getType()
- == ATTRIBUTE_NODE)
- return ((OMElement)omNode).getLocalName();
- // TODO: else if(omNode.getType() == ATTRIBUTE_NODE)
- // return some
- return null;
- }
-
- /**
- * Method getNamespaceURI
- * @see org.w3c.dom.Node#getNamespaceURI()
- */
- public String getNamespaceURI() {
-
- return ((OMElement)omNode).getNamespace().getName();
- }
-
- /**
- * Method getNodeName
- * @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)
- return "#comment";
- else if(omNode.getType() == OMNode.CDATA_SECTION_NODE)
- return "#cdata-section";
- else if(omNode.getType() == OMNode.TEXT_NODE)
- return "#text";
- //TODO else if Attribute Node so something
- // return attribute name
- return null;
- }
-
- /**
- * Method getNodeValue
- * @see org.w3c.dom.Node#getNodeValue()
- */
- public String getNodeValue() throws DOMException {
- // Returns text for a TEXT_NODE, null otherwise
- if(omNode.getType() == OMNode.TEXT_NODE)
- return ((OMText)omNode).getText();
- //TODO else if(omNode.getType() == Attribute)
- else
- return null;
- }
-
- /**
- * Method getPrefix
- * @see org.w3c.dom.Node#getPrefix()
- */
- public String getPrefix() {
- if(omNode.getType() == OMNode.ELEMENT_NODE)
- return ((OMElement)omNode).getNamespace().getPrefix();
- return null;
- }
-
- /**
- * Method setNodeValue
- * @see org.w3c.dom.Node#setNodeValue(java.lang.String)
- */
- public void setNodeValue(String value) throws DOMException {
-
- if(omNode.getType() == OMNode.TEXT_NODE){
- OMElement parent = (OMElement)omNode.getParent();
- ((OMText)omNode).discard();
- omNode = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createText(parent, value);
- }
- }
-
- /**
- * Method setPrefix
- * @see org.w3c.dom.Node#setPrefix(java.lang.String)
- */
- public void setPrefix(String prefix) throws DOMException {
- //TODO - Do for attribute Node
- if(omNode.getType() == OMNode.ELEMENT_NODE /*|| Attribute Node*/){
- OMNamespace ns = ((OMElement)omNode).getNamespace();
- String uri = ns.getName();
- OMNamespace newNs = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createOMNamespace(uri, prefix);
- ((OMElement)omNode).setNamespace(newNs);
- }
-
- }
-
- /**
- * Method setOwnerDocument
- * @param doc
- */
- public void setOwnerDocument(Document doc){
- // method not part of org.w3c.dom.Node, created to set the document
- this.document = doc;
- }
-
- /**
- * Method getOwnerDocument
- * @see org.w3c.dom.Node#getOwnerDocument()
- */
- public Document getOwnerDocument() {
- // return the set document
- return document;
- }
-
- /**
- * Method getAttributes
- * @see org.w3c.dom.Node#getAttributes()
- */
- public NamedNodeMap getAttributes() {
- // Will have to provide an implementation of NamedNodeMap
- // Dropping for now
- // TODO
- Iterator iter = ((OMElement)omNode).getAttributes();
-
- return null;
- }
-
- /**
- * Method getFirstChild
- * @see org.w3c.dom.Node#getFirstChild()
- */
- public org.w3c.dom.Node getFirstChild() {
- //
- OMNode child = ((OMElement)omNode).getFirstChild();
- return new NodeImpl(child);
- }
-
- /**
- * Method getLastChild
- * @see org.w3c.dom.Node#getLastChild()
- */
- public org.w3c.dom.Node getLastChild() {
-
- Iterator children = ((OMElement)omNode).getChildren();
- Object child = null;
- while(children.hasNext()){
- child = children.next();
- }
- if(child instanceof OMNode){
- return new NodeImpl((OMNode)child);
- }
- return null;
- }
-
- /**
- * 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 = (OMElement)omNode.getParent();
- return new NodeImpl(parent);
- }
-
- /**
- * dom Node method
- */
- public org.w3c.dom.Node getPreviousSibling() {
-
- OMNode prevSibling = omNode.getPreviousSibling();
- return new NodeImpl(prevSibling);
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#cloneNode(boolean)
- */
- public org.w3c.dom.Node cloneNode(boolean deep) {
- //TODO
- return null;
- }
-
- /**
- * DOM Node method
- */
- public NodeList getChildNodes() {
- Iterator iter = ((OMElement)omNode).getChildren();
- NodeListImpl list = new NodeListImpl();
- while(iter.hasNext()){
- OMNode omChild = (OMNode)iter.next();
- Node child = new NodeImpl(omChild);
- list.addNode(child);
- }
- return list;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#isSupported(java.lang.String, java.lang.String)
- */
- public boolean isSupported(String arg0, String arg1) {
- //TODO: Not implemented in 1.2 as well
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#appendChild(org.w3c.dom.Node)
- */
- 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);
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.w3c.dom.Node#removeChild(org.w3c.dom.Node)
- */
- public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
- throws DOMException {
- //Check if equals method has been removed from OMNode
- OMNode child = Dom2OmUtils.toOM(oldChild);
- if(omNode.getType() == OMNode.ELEMENT_NODE){
- Iterator iter = ((OMElement)omNode).getChildren();
- while(iter.hasNext()){
- Object nextChild = iter.next();
- if(nextChild instanceof OMNode && nextChild.equals(child)){
- ((OMElement)nextChild).discard();
- return oldChild;
- }
- }
- }
-
- return null;
- }
-
- /**
- * @see org.w3c.dom.Node#insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)
- */
- public org.w3c.dom.Node insertBefore(org.w3c.dom.Node arg0,
- org.w3c.dom.Node arg1) throws DOMException {
-
- return null;
- }
-
- /**
- * @see org.w3c.dom.Node#replaceChild(org.w3c.dom.Node, org.w3c.dom.Node)
- */
- public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
- org.w3c.dom.Node refChild) throws DOMException {
- OMNode newOmChild = Dom2OmUtils.toOM(newChild);
- OMNode refOmChild = Dom2OmUtils.toOM(refChild);
- if(omNode.getType() == OMNode.ELEMENT_NODE){
- Iterator iter = ((OMElement)omNode).getChildren();
- 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))
- return true;
- }
- return false;
- }
+ 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)
+ return new NodeImpl(((OMElement) omNode).getFirstChild()).getValue();
+ return null;
+ }
+
+ /**
+ * 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);
+ }
+
+ /**
+ * Method getParentElement
+ *
+ * @see javax.xml.soap.Node#getParentElement()
+ */
+ public SOAPElement getParentElement() {
+
+ OMElement omParent = (OMElement) omNode.getParent();
+ return new SOAPElementImpl(omParent);
+ }
+
+ /**
+ * Method detachNode
+ *
+ * @see javax.xml.soap.Node#detachNode()
+ */
+ public void detachNode() {
+
+ omNode.detach();
+ }
+
+ /**
+ * Method recycleNode
+ *
+ * @see javax.xml.soap.Node#recycleNode()
+ */
+ public void recycleNode() {
+ // No corresponding implementation in OM
+ // There is no implementation in Axis 1.2 also
+
+ }
+
+ /**
+ * 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 = (OMElement) omNode.getParent();
+ ((OMText) omNode).discard();
+ omNode = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createText(parent, value);
+ } else if (omNode.getType() == OMNode.ELEMENT_NODE) {
+ OMNode firstChild = ((OMElement) omNode).getFirstChild();
+ if (firstChild == null) {
+ firstChild = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createText((OMElement) omNode, value);
+ } else if (firstChild.getType() == OMNode.TEXT_NODE) {
+ ((OMText) firstChild).discard();
+ firstChild = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createText((OMElement) omNode, value);
+ }
+ } else {
+ throw new IllegalStateException();
+ }
+ }
+
+ /**
+ * Method getNodeType
+ *
+ * @see org.w3c.dom.Node#getNodeType()
+ */
+ public short getNodeType() {
+
+ return (short) omNode.getType();
+ }
+
+ /**
+ * Method normalize
+ *
+ * @see org.w3c.dom.Node#normalize()
+ */
+ public void normalize() {
+ // No corresponding function in OM
+ //Axis 1.2 also doesn't have any implementation for this
+
+ }
+
+ /**
+ * Method hasAttributes
+ *
+ * @see org.w3c.dom.Node#hasAttributes()
+ */
+ public boolean hasAttributes() {
+ if (omNode instanceof OMElement) {
+ Iterator iter = ((OMElement) omNode).getAttributes();
+ return (iter.hasNext() ? true : false);
+ }
+ return false;
+ }
+
+ /**
+ * Method hasChildNodes
+ *
+ * @see org.w3c.dom.Node#hasChildNodes()
+ */
+ public boolean hasChildNodes() {
+ if (omNode instanceof OMElement) {
+ Iterator iter = ((OMElement) omNode).getChildren();
+ return (iter.hasNext() ? true : false);
+ }
+ return false;
+ }
+
+ /**
+ * Method getLocalName
+ *
+ * @see org.w3c.dom.Node#getLocalName()
+ */
+ public String getLocalName() {
+ if (omNode.getType() == ELEMENT_NODE || omNode.getType()
+ == ATTRIBUTE_NODE)
+ return ((OMElement) omNode).getLocalName();
+ // TODO: else if(omNode.getType() == ATTRIBUTE_NODE)
+ // return some
+ return null;
+ }
+
+ /**
+ * Method getNamespaceURI
+ *
+ * @see org.w3c.dom.Node#getNamespaceURI()
+ */
+ public String getNamespaceURI() {
+
+ return ((OMElement) omNode).getNamespace().getName();
+ }
+
+ /**
+ * Method getNodeName
+ *
+ * @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)
+ return "#comment";
+ else if (omNode.getType() == OMNode.CDATA_SECTION_NODE)
+ return "#cdata-section";
+ else if (omNode.getType() == OMNode.TEXT_NODE)
+ return "#text";
+ //TODO else if Attribute Node so something
+ // return attribute name
+ return null;
+ }
+
+ /**
+ * Method getNodeValue
+ *
+ * @see org.w3c.dom.Node#getNodeValue()
+ */
+ public String getNodeValue() throws DOMException {
+ // Returns text for a TEXT_NODE, null otherwise
+ if (omNode.getType() == OMNode.TEXT_NODE)
+ return ((OMText) omNode).getText();
+ //TODO else if(omNode.getType() == Attribute)
+ else
+ return null;
+ }
+
+ /**
+ * Method getPrefix
+ *
+ * @see org.w3c.dom.Node#getPrefix()
+ */
+ public String getPrefix() {
+ if (omNode.getType() == OMNode.ELEMENT_NODE)
+ return ((OMElement) omNode).getNamespace().getPrefix();
+ return null;
+ }
+
+ /**
+ * Method setNodeValue
+ *
+ * @see org.w3c.dom.Node#setNodeValue(java.lang.String)
+ */
+ public void setNodeValue(String value) throws DOMException {
+
+ if (omNode.getType() == OMNode.TEXT_NODE) {
+ OMElement parent = (OMElement) omNode.getParent();
+ ((OMText) omNode).discard();
+ omNode = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createText(parent, value);
+ }
+ }
+
+ /**
+ * Method setPrefix
+ *
+ * @see org.w3c.dom.Node#setPrefix(java.lang.String)
+ */
+ public void setPrefix(String prefix) throws DOMException {
+ //TODO - Do for attribute Node
+ if (omNode.getType() == OMNode.ELEMENT_NODE /*|| Attribute Node*/) {
+ OMNamespace ns = ((OMElement) omNode).getNamespace();
+ String uri = ns.getName();
+ OMNamespace newNs = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createOMNamespace(uri, prefix);
+ ((OMElement) omNode).setNamespace(newNs);
+ }
+
+ }
+
+ /**
+ * Method setOwnerDocument
+ *
+ * @param doc
+ */
+ public void setOwnerDocument(Document doc) {
+ // method not part of org.w3c.dom.Node, created to set the document
+ this.document = doc;
+ }
+
+ /**
+ * Method getOwnerDocument
+ *
+ * @see org.w3c.dom.Node#getOwnerDocument()
+ */
+ public Document getOwnerDocument() {
+ // return the set document
+ return document;
+ }
+
+ /**
+ * Method getAttributes
+ *
+ * @see org.w3c.dom.Node#getAttributes()
+ */
+ public NamedNodeMap getAttributes() {
+ // Will have to provide an implementation of NamedNodeMap
+ // Dropping for now
+ // TODO
+ Iterator iter = ((OMElement) omNode).getAttributes();
+
+ return null;
+ }
+
+ /**
+ * Method getFirstChild
+ *
+ * @see org.w3c.dom.Node#getFirstChild()
+ */
+ public org.w3c.dom.Node getFirstChild() {
+ //
+ OMNode child = ((OMElement) omNode).getFirstChild();
+ return new NodeImpl(child);
+ }
+
+ /**
+ * Method getLastChild
+ *
+ * @see org.w3c.dom.Node#getLastChild()
+ */
+ public org.w3c.dom.Node getLastChild() {
+
+ Iterator children = ((OMElement) omNode).getChildren();
+ Object child = null;
+ while (children.hasNext()) {
+ child = children.next();
+ }
+ if (child instanceof OMNode) {
+ return new NodeImpl((OMNode) child);
+ }
+ return null;
+ }
+
+ /**
+ * 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 = (OMElement) omNode.getParent();
+ return new NodeImpl(parent);
+ }
+
+ /**
+ * dom Node method
+ */
+ public org.w3c.dom.Node getPreviousSibling() {
+
+ OMNode prevSibling = omNode.getPreviousSibling();
+ return new NodeImpl(prevSibling);
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#cloneNode(boolean)
+ */
+ public org.w3c.dom.Node cloneNode(boolean deep) {
+ //TODO
+ return null;
+ }
+
+ /**
+ * DOM Node method
+ */
+ public NodeList getChildNodes() {
+ Iterator iter = ((OMElement) omNode).getChildren();
+ NodeListImpl list = new NodeListImpl();
+ while (iter.hasNext()) {
+ OMNode omChild = (OMNode) iter.next();
+ Node child = new NodeImpl(omChild);
+ list.addNode(child);
+ }
+ return list;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#isSupported(java.lang.String, java.lang.String)
+ */
+ public boolean isSupported(String arg0, String arg1) {
+ //TODO: Not implemented in 1.2 as well
+ return false;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#appendChild(org.w3c.dom.Node)
+ */
+ 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);
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.w3c.dom.Node#removeChild(org.w3c.dom.Node)
+ */
+ public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild)
+ throws DOMException {
+ //Check if equals method has been removed from OMNode
+ OMNode child = Dom2OmUtils.toOM(oldChild);
+ if (omNode.getType() == OMNode.ELEMENT_NODE) {
+ Iterator iter = ((OMElement) omNode).getChildren();
+ while (iter.hasNext()) {
+ Object nextChild = iter.next();
+ if (nextChild instanceof OMNode && nextChild.equals(child)) {
+ ((OMElement) nextChild).discard();
+ return oldChild;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ /**
+ * @see org.w3c.dom.Node#insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)
+ */
+ public org.w3c.dom.Node insertBefore(org.w3c.dom.Node arg0,
+ org.w3c.dom.Node arg1) throws DOMException {
+
+ return null;
+ }
+
+ /**
+ * @see org.w3c.dom.Node#replaceChild(org.w3c.dom.Node, org.w3c.dom.Node)
+ */
+ public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild,
+ org.w3c.dom.Node refChild) throws DOMException {
+ OMNode newOmChild = Dom2OmUtils.toOM(newChild);
+ OMNode refOmChild = Dom2OmUtils.toOM(refChild);
+ if (omNode.getType() == OMNode.ELEMENT_NODE) {
+ Iterator iter = ((OMElement) omNode).getChildren();
+ 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))
+ return true;
+ }
+ return false;
+ }
}
Modified: webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/NodeListImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/NodeListImpl.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/NodeListImpl.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/NodeListImpl.java Mon Jul 11 08:49:30 2005
@@ -24,24 +24,23 @@
/**
* @author Ashutosh Shahi
- *
- * TODO To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Style - Code Templates
+ * <p/>
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
*/
public class NodeListImpl implements NodeList {
-
- List mNodes;
-
- public static final NodeList EMPTY_NODELIST = new NodeListImpl(Collections.EMPTY_LIST);
-
- /**
+
+ List mNodes;
+
+ public static final NodeList EMPTY_NODELIST = new NodeListImpl(Collections.EMPTY_LIST);
+
+ /**
* Constructor and Setter is intensionally made package access only.
- *
*/
NodeListImpl() {
mNodes = new ArrayList();
}
-
+
NodeListImpl(List nodes) {
this();
mNodes.addAll(nodes);
@@ -56,10 +55,10 @@
mNodes.add(nodes.item(i));
}
}
-
+
/**
* Interface Implemented
- *
+ *
* @param index
* @return
*/
Modified: webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/PrefixedQName.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/PrefixedQName.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/PrefixedQName.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/PrefixedQName.java Mon Jul 11 08:49:30 2005
@@ -20,13 +20,15 @@
/**
* Class Prefixed QName
- *
+ * <p/>
* Took this implementation from Axis 1.2 code
*/
public class PrefixedQName implements Name {
- /** comment/shared empty string */
+ /**
+ * comment/shared empty string
+ */
private static final String emptyString = "".intern();
-
+
/**
* Field prefix
*/
@@ -35,9 +37,10 @@
* Field qName
*/
private QName qName;
-
+
/**
* Constructor PrefixedQName
+ *
* @param uri
* @param localName
* @param pre
@@ -45,12 +48,13 @@
public PrefixedQName(String uri, String localName, String pre) {
qName = new QName(uri, localName);
prefix = (pre == null)
- ? emptyString
- : pre.intern();
+ ? emptyString
+ : pre.intern();
}
/**
* Constructor qname
+ *
* @param qname
* @return
*/
@@ -61,42 +65,47 @@
/**
* Method getLocalName
+ *
* @return
*/
public String getLocalName() {
return qName.getLocalPart();
}
-
+
/**
* Method getQualifiedName
+ *
* @return
*/
public String getQualifiedName() {
StringBuffer buf = new StringBuffer(prefix);
- if(prefix != emptyString)
+ if (prefix != emptyString)
buf.append(':');
buf.append(qName.getLocalPart());
return buf.toString();
}
-
+
/**
* Method getURI
+ *
* @return
*/
public String getURI() {
return qName.getNamespaceURI();
}
-
+
/**
* Method getPrefix
+ *
* @return
*/
public String getPrefix() {
return prefix;
}
-
+
/**
* Method equals
+ *
* @param obj
* @return
*/
@@ -107,7 +116,7 @@
if (!(obj instanceof PrefixedQName)) {
return false;
}
- if (!qName.equals(((PrefixedQName)obj).qName)) {
+ if (!qName.equals(((PrefixedQName) obj).qName)) {
return false;
}
if (prefix == ((PrefixedQName) obj).prefix) {
@@ -118,14 +127,16 @@
/**
* Method hasCode
+ *
* @return
*/
public int hashCode() {
return prefix.hashCode() + qName.hashCode();
}
-
+
/**
* Method toString
+ *
* @return
*/
public String toString() {
Modified: webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyElementImpl.java?rev=210150&r1=210149&r2=210150&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyElementImpl.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPBodyElementImpl.java Mon Jul 11 08:49:30 2005
@@ -21,27 +21,27 @@
/**
* Class SOAPBodeElementImpl
- *
+ *
* @author Ashutosh Shahi
- * ashutosh.shahi@gmail.com
+ * ashutosh.shahi@gmail.com
*/
public class SOAPBodyElementImpl extends SOAPElementImpl implements
- SOAPBodyElement {
-
- /**
- * Constructor SOAPBodeElementImpl
- *
- */
- public SOAPBodyElementImpl(){
- super();
- }
-
- /**
- * Constructor SOAPBodeElementImpl
- * @param bodyElement
- */
- public SOAPBodyElementImpl(OMElement bodyElement){
- super(bodyElement);
- }
+ SOAPBodyElement {
+
+ /**
+ * Constructor SOAPBodeElementImpl
+ */
+ public SOAPBodyElementImpl() {
+ super();
+ }
+
+ /**
+ * Constructor SOAPBodeElementImpl
+ *
+ * @param bodyElement
+ */
+ public SOAPBodyElementImpl(OMElement bodyElement) {
+ super(bodyElement);
+ }
}