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 di...@apache.org on 2005/09/15 21:07:03 UTC
svn commit: r289289 [87/134] - in /webservices/axis2/trunk/java: ./ etc/
modules/addressing/ modules/addressing/src/META-INF/
modules/addressing/src/org/apache/axis2/handlers/addressing/
modules/addressing/test-resources/ modules/addressing/test/org/ap...
Modified: webservices/axis2/trunk/java/modules/saaj/src/javax/xml/soap/SOAPPart.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/javax/xml/soap/SOAPPart.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/javax/xml/soap/SOAPPart.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/javax/xml/soap/SOAPPart.java Thu Sep 15 11:52:11 2005
@@ -1,280 +1,280 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package javax.xml.soap;
-
-import javax.xml.transform.Source;
-import java.util.Iterator;
-
-/**
- * <P>The container for the SOAP-specific portion of a <CODE>
- * SOAPMessage</CODE> object. All messages are required to have a
- * 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>
- * SOAPPart</CODE> object automatically has a MIME header of
- * Content-Type with its value set to "text/xml". The value must
- * be "text/xml" because content in the SOAP part of a message
- * 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
- * which <CODE>message</CODE> is a <CODE>SOAPMessage</CODE>
- * object, retrieves the SOAP part of a message.</P>
- * <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.
- * The <CODE>SOAPPart</CODE> method <CODE>getEnvelope</CODE> can
- * be used to retrieve the <CODE>SOAPEnvelope</CODE> object.</P>
- */
-public abstract class SOAPPart implements org.w3c.dom.Document {
-
- 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
- */
- 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"
- * @see #setContentId(java.lang.String) setContentId(java.lang.String)
- */
- public String getContentId() {
-
- String as[] = getMimeHeader("Content-Id");
-
- if (as != null && as.length > 0) {
- return as[0];
- } else {
- return null;
- }
- }
-
- /**
- * 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"
- * @see #setContentLocation(java.lang.String) setContentLocation(java.lang.String)
- */
- public String getContentLocation() {
-
- String as[] = getMimeHeader("Content-Location");
-
- if (as != null && as.length > 0) {
- return as[0];
- } else {
- return null;
- }
- }
-
- /**
- * 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
- * @see #getContentId() getContentId()
- */
- public void setContentId(String contentId) {
- setMimeHeader("Content-Id", contentId);
- }
-
- /**
- * 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.
- * @see #getContentLocation() getContentLocation()
- */
- public void setContentLocation(String contentLocation) {
- setMimeHeader("Content-Location", contentLocation);
- }
-
- /**
- * 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
- */
- public abstract void removeMimeHeader(String header);
-
- /**
- * Removes all the <CODE>MimeHeader</CODE> objects for this
- * <CODE>SOAPEnvelope</CODE> object.
- */
- public abstract void removeAllMimeHeaders();
-
- /**
- * 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"
- * @return a <CODE>String</CODE> array giving all the values for
- * 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/>
- * <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/>
- * <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);
-
- /**
- * 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
- */
- 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
- * @return all of the MIME headers that match one of the names
- * 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
- * @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.
- */
- 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
- * @see #getContent() getContent()
- */
- public abstract void setContent(Source source) throws SOAPException;
-
- /**
- * 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
- * @see #setContent(javax.xml.transform.Source) setContent(javax.xml.transform.Source)
- */
- public abstract Source getContent() throws SOAPException;
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.soap;
+
+import javax.xml.transform.Source;
+import java.util.Iterator;
+
+/**
+ * <P>The container for the SOAP-specific portion of a <CODE>
+ * SOAPMessage</CODE> object. All messages are required to have a
+ * 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>
+ * SOAPPart</CODE> object automatically has a MIME header of
+ * Content-Type with its value set to "text/xml". The value must
+ * be "text/xml" because content in the SOAP part of a message
+ * 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
+ * which <CODE>message</CODE> is a <CODE>SOAPMessage</CODE>
+ * object, retrieves the SOAP part of a message.</P>
+ * <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.
+ * The <CODE>SOAPPart</CODE> method <CODE>getEnvelope</CODE> can
+ * be used to retrieve the <CODE>SOAPEnvelope</CODE> object.</P>
+ */
+public abstract class SOAPPart implements org.w3c.dom.Document {
+
+ 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
+ */
+ 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"
+ * @see #setContentId(java.lang.String) setContentId(java.lang.String)
+ */
+ public String getContentId() {
+
+ String as[] = getMimeHeader("Content-Id");
+
+ if (as != null && as.length > 0) {
+ return as[0];
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * 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"
+ * @see #setContentLocation(java.lang.String) setContentLocation(java.lang.String)
+ */
+ public String getContentLocation() {
+
+ String as[] = getMimeHeader("Content-Location");
+
+ if (as != null && as.length > 0) {
+ return as[0];
+ } else {
+ return null;
+ }
+ }
+
+ /**
+ * 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
+ * @see #getContentId() getContentId()
+ */
+ public void setContentId(String contentId) {
+ setMimeHeader("Content-Id", contentId);
+ }
+
+ /**
+ * 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.
+ * @see #getContentLocation() getContentLocation()
+ */
+ public void setContentLocation(String contentLocation) {
+ setMimeHeader("Content-Location", contentLocation);
+ }
+
+ /**
+ * 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
+ */
+ public abstract void removeMimeHeader(String header);
+
+ /**
+ * Removes all the <CODE>MimeHeader</CODE> objects for this
+ * <CODE>SOAPEnvelope</CODE> object.
+ */
+ public abstract void removeAllMimeHeaders();
+
+ /**
+ * 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"
+ * @return a <CODE>String</CODE> array giving all the values for
+ * 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/>
+ * <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/>
+ * <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);
+
+ /**
+ * 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
+ */
+ 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
+ * @return all of the MIME headers that match one of the names
+ * 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
+ * @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.
+ */
+ 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
+ * @see #getContent() getContent()
+ */
+ public abstract void setContent(Source source) throws SOAPException;
+
+ /**
+ * 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
+ * @see #setContent(javax.xml.transform.Source) setContent(javax.xml.transform.Source)
+ */
+ public abstract Source getContent() throws SOAPException;
+}
Propchange: webservices/axis2/trunk/java/modules/saaj/src/javax/xml/soap/SOAPPart.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/saaj/src/javax/xml/soap/Text.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/javax/xml/soap/Text.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/javax/xml/soap/Text.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/javax/xml/soap/Text.java Thu Sep 15 11:52:11 2005
@@ -1,33 +1,33 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package javax.xml.soap;
-
-/**
- * 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.
- */
-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
- */
- public abstract boolean isComment();
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package javax.xml.soap;
+
+/**
+ * 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.
+ */
+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
+ */
+ public abstract boolean isComment();
+}
Propchange: webservices/axis2/trunk/java/modules/saaj/src/javax/xml/soap/Text.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttachmentPartImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttachmentPartImpl.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttachmentPartImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttachmentPartImpl.java Thu Sep 15 11:52:11 2005
@@ -1,188 +1,188 @@
-package org.apache.axis2.saaj;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.Iterator;
-
-import javax.activation.DataHandler;
-import javax.activation.UnsupportedDataTypeException;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPException;
-
-import org.apache.axis2.om.OMText;
-import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.axis2.util.SessionUtils;
-
-public class AttachmentPartImpl extends AttachmentPart {
-
- /**
- * Bulds a new <code>AttachmentPart</code>.
- */
- public AttachmentPartImpl() {
- setMimeHeader(HTTPConstants.HEADER_CONTENT_ID, SessionUtils.generateSessionId());
- }
-
- /**
- * Bulds a new <code>AttachmentPart</code> with a <code>DataHandler</code>.
- *
- * @param dh the <code>DataHandler</code>
- */
- public AttachmentPartImpl(javax.activation.DataHandler dh) {
- setMimeHeader(HTTPConstants.HEADER_CONTENT_ID,
- SessionUtils.generateSessionId());
- dataHandler = dh;
- if(dh != null) {
- setMimeHeader(HTTPConstants.HEADER_CONTENT_TYPE, dh.getContentType());
- omText = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createText(dataHandler, true);
- }
- }
-
- public OMText getOMText() throws SOAPException{
- if(omText == null){
- throw new SOAPException("OMText set to null");
- }
- return omText;
- }
-
- public int getSize() throws SOAPException {
- if (dataHandler == null) {
- return 0;
- }
- ByteArrayOutputStream bout = new ByteArrayOutputStream();
- try {
- dataHandler.writeTo(bout);
- } catch (java.io.IOException ex) {
- throw new SOAPException(ex);
- }
- return bout.size();
- }
-
- public void clearContent() {
-
- dataHandler = null;
- omText = null;
- }
-
- public Object getContent() throws SOAPException {
- if(dataHandler==null) {
- throw new SOAPException("No content is present in this AttachmentPart");
- }
- try {
- String ContentType = dataHandler.getContentType();
- if(ContentType.equals("text/plain") ||
- ContentType.equals("text/xml") ||
- ContentType.equals("text/html")) {
- //For these content types underlying DataContentHandler surely does
- //the conversion to appropriate java object and we will return that java object
- return dataHandler.getContent();
- } else {
- try {
- return dataHandler.getContent();
- }catch (UnsupportedDataTypeException e) {
- //If the underlying DataContentHandler can't handle the object contents,
- //we will return an inputstream of raw bytes represneting the content data
- return dataHandler.getDataSource().getInputStream();
- }
- }
- } catch(Exception e) {
- throw new SOAPException(e);
- }
- }
-
- public void setContent(Object object, String contentType) {
-
- DataHandler dh = new DataHandler(object, contentType);
- this.setDataHandler(dh);
- }
-
- public DataHandler getDataHandler() throws SOAPException {
- if (dataHandler==null) {
- throw new SOAPException("No Content present in the Attachment part");
- }
- return dataHandler;
- }
-
- public void setDataHandler(DataHandler datahandler) {
-
- this.dataHandler = datahandler;
- if(datahandler != null) {
- setMimeHeader(HTTPConstants.HEADER_CONTENT_TYPE, datahandler.getContentType());
- omText = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createText(dataHandler, true);
- }
- }
-
- public void removeMimeHeader(String header) {
-
- mimeHeaders.removeHeader(header);
- }
-
- public void removeAllMimeHeaders() {
-
- mimeHeaders.removeAllHeaders();
- }
-
- public String[] getMimeHeader(String name) {
-
- return mimeHeaders.getHeader(name);
- }
-
- public void setMimeHeader(String name, String value) {
-
- mimeHeaders.setHeader(name, value);
- }
-
- public void addMimeHeader(String name, String value) {
-
- mimeHeaders.addHeader(name, value);
- }
-
- public Iterator getAllMimeHeaders() {
-
- return mimeHeaders.getAllHeaders();
- }
-
- public Iterator getMatchingMimeHeaders(String[] names) {
-
- return mimeHeaders.getMatchingHeaders(names);
- }
-
- public Iterator getNonMatchingMimeHeaders(String[] names) {
-
- return mimeHeaders.getNonMatchingHeaders(names);
- }
-
- public boolean matches(javax.xml.soap.MimeHeaders headers) {
- for (Iterator i = headers.getAllHeaders(); i.hasNext();) {
- javax.xml.soap.MimeHeader hdr = (javax.xml.soap.MimeHeader) i.next();
- String values[] = mimeHeaders.getHeader(hdr.getName());
- boolean found = false;
- if (values != null) {
- for (int j = 0; j < values.length; j++) {
- if (!hdr.getValue().equalsIgnoreCase(values[j])) {
- continue;
- }
- found = true;
- break;
- }
- }
- if (!found) {
- return false;
- }
- }
- return true;
- }
-
- //Should we make it private?
- DataHandler dataHandler;
-
- /**
- * Field mimeHeaders.
- */
- private MimeHeaders mimeHeaders = new MimeHeaders();
-
- //private Object contentObject;
-
- private OMText omText;
-
-}
+package org.apache.axis2.saaj;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.activation.DataHandler;
+import javax.activation.UnsupportedDataTypeException;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPException;
+
+import org.apache.axis2.om.OMText;
+import org.apache.axis2.transport.http.HTTPConstants;
+import org.apache.axis2.util.SessionUtils;
+
+public class AttachmentPartImpl extends AttachmentPart {
+
+ /**
+ * Bulds a new <code>AttachmentPart</code>.
+ */
+ public AttachmentPartImpl() {
+ setMimeHeader(HTTPConstants.HEADER_CONTENT_ID, SessionUtils.generateSessionId());
+ }
+
+ /**
+ * Bulds a new <code>AttachmentPart</code> with a <code>DataHandler</code>.
+ *
+ * @param dh the <code>DataHandler</code>
+ */
+ public AttachmentPartImpl(javax.activation.DataHandler dh) {
+ setMimeHeader(HTTPConstants.HEADER_CONTENT_ID,
+ SessionUtils.generateSessionId());
+ dataHandler = dh;
+ if(dh != null) {
+ setMimeHeader(HTTPConstants.HEADER_CONTENT_TYPE, dh.getContentType());
+ omText = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createText(dataHandler, true);
+ }
+ }
+
+ public OMText getOMText() throws SOAPException{
+ if(omText == null){
+ throw new SOAPException("OMText set to null");
+ }
+ return omText;
+ }
+
+ public int getSize() throws SOAPException {
+ if (dataHandler == null) {
+ return 0;
+ }
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ try {
+ dataHandler.writeTo(bout);
+ } catch (java.io.IOException ex) {
+ throw new SOAPException(ex);
+ }
+ return bout.size();
+ }
+
+ public void clearContent() {
+
+ dataHandler = null;
+ omText = null;
+ }
+
+ public Object getContent() throws SOAPException {
+ if(dataHandler==null) {
+ throw new SOAPException("No content is present in this AttachmentPart");
+ }
+ try {
+ String ContentType = dataHandler.getContentType();
+ if(ContentType.equals("text/plain") ||
+ ContentType.equals("text/xml") ||
+ ContentType.equals("text/html")) {
+ //For these content types underlying DataContentHandler surely does
+ //the conversion to appropriate java object and we will return that java object
+ return dataHandler.getContent();
+ } else {
+ try {
+ return dataHandler.getContent();
+ }catch (UnsupportedDataTypeException e) {
+ //If the underlying DataContentHandler can't handle the object contents,
+ //we will return an inputstream of raw bytes represneting the content data
+ return dataHandler.getDataSource().getInputStream();
+ }
+ }
+ } catch(Exception e) {
+ throw new SOAPException(e);
+ }
+ }
+
+ public void setContent(Object object, String contentType) {
+
+ DataHandler dh = new DataHandler(object, contentType);
+ this.setDataHandler(dh);
+ }
+
+ public DataHandler getDataHandler() throws SOAPException {
+ if (dataHandler==null) {
+ throw new SOAPException("No Content present in the Attachment part");
+ }
+ return dataHandler;
+ }
+
+ public void setDataHandler(DataHandler datahandler) {
+
+ this.dataHandler = datahandler;
+ if(datahandler != null) {
+ setMimeHeader(HTTPConstants.HEADER_CONTENT_TYPE, datahandler.getContentType());
+ omText = org.apache.axis2.om.OMAbstractFactory.getOMFactory().createText(dataHandler, true);
+ }
+ }
+
+ public void removeMimeHeader(String header) {
+
+ mimeHeaders.removeHeader(header);
+ }
+
+ public void removeAllMimeHeaders() {
+
+ mimeHeaders.removeAllHeaders();
+ }
+
+ public String[] getMimeHeader(String name) {
+
+ return mimeHeaders.getHeader(name);
+ }
+
+ public void setMimeHeader(String name, String value) {
+
+ mimeHeaders.setHeader(name, value);
+ }
+
+ public void addMimeHeader(String name, String value) {
+
+ mimeHeaders.addHeader(name, value);
+ }
+
+ public Iterator getAllMimeHeaders() {
+
+ return mimeHeaders.getAllHeaders();
+ }
+
+ public Iterator getMatchingMimeHeaders(String[] names) {
+
+ return mimeHeaders.getMatchingHeaders(names);
+ }
+
+ public Iterator getNonMatchingMimeHeaders(String[] names) {
+
+ return mimeHeaders.getNonMatchingHeaders(names);
+ }
+
+ public boolean matches(javax.xml.soap.MimeHeaders headers) {
+ for (Iterator i = headers.getAllHeaders(); i.hasNext();) {
+ javax.xml.soap.MimeHeader hdr = (javax.xml.soap.MimeHeader) i.next();
+ String values[] = mimeHeaders.getHeader(hdr.getName());
+ boolean found = false;
+ if (values != null) {
+ for (int j = 0; j < values.length; j++) {
+ if (!hdr.getValue().equalsIgnoreCase(values[j])) {
+ continue;
+ }
+ found = true;
+ break;
+ }
+ }
+ if (!found) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+ //Should we make it private?
+ DataHandler dataHandler;
+
+ /**
+ * Field mimeHeaders.
+ */
+ private MimeHeaders mimeHeaders = new MimeHeaders();
+
+ //private Object contentObject;
+
+ private OMText omText;
+
+}
Propchange: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttachmentPartImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttrImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttrImpl.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttrImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttrImpl.java Thu Sep 15 11:52:11 2005
@@ -1,119 +1,119 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis2.saaj;
-
-import org.apache.axis2.om.OMAttribute;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * @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);
- }
-
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.saaj;
+
+import org.apache.axis2.om.OMAttribute;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+
+/**
+ * @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);
+ }
+
+}
Propchange: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/AttrImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailEntryImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailEntryImpl.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailEntryImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailEntryImpl.java Thu Sep 15 11:52:11 2005
@@ -1,50 +1,50 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis2.saaj;
-
-import javax.xml.soap.DetailEntry;
-
-/**
- * Class DetailEntryImpl
- *
- * @author Ashutosh Shahi
- * 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) {
- super(detailEntry);
- this.detailEntry = detailEntry;
- }
-
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.saaj;
+
+import javax.xml.soap.DetailEntry;
+
+/**
+ * Class DetailEntryImpl
+ *
+ * @author Ashutosh Shahi
+ * 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) {
+ super(detailEntry);
+ this.detailEntry = detailEntry;
+ }
+
+}
Propchange: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailEntryImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailImpl.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailImpl.java Thu Sep 15 11:52:11 2005
@@ -1,111 +1,111 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis2.saaj;
-
-import org.apache.axis2.om.OMAbstractFactory;
-import org.apache.axis2.om.OMElement;
-import org.apache.axis2.om.OMFactory;
-import org.apache.axis2.om.OMNamespace;
-import org.apache.axis2.soap.SOAPFactory;
-import org.apache.axis2.soap.SOAPFaultDetail;
-
-import javax.xml.soap.*;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-/**
- * Class DetailImpl
- *
- * @author Ashutosh Shahi
- * 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();
- }
-
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.saaj;
+
+import org.apache.axis2.om.OMAbstractFactory;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.OMFactory;
+import org.apache.axis2.om.OMNamespace;
+import org.apache.axis2.soap.SOAPFactory;
+import org.apache.axis2.soap.SOAPFaultDetail;
+
+import javax.xml.soap.*;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+/**
+ * Class DetailImpl
+ *
+ * @author Ashutosh Shahi
+ * 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();
+ }
+
+}
Propchange: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/DetailImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MessageFactoryImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MessageFactoryImpl.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MessageFactoryImpl.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MessageFactoryImpl.java Thu Sep 15 11:52:11 2005
@@ -1,52 +1,52 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis2.saaj;
-
-import javax.xml.soap.MessageFactory;
-import javax.xml.soap.MimeHeaders;
-import javax.xml.soap.SOAPException;
-import javax.xml.soap.SOAPMessage;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * @author Ashutosh Shahi ashutosh.shahi@gmail.com
- * <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();
- return new SOAPMessageImpl(env);
- }
-
- /* (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 {
- return new SOAPMessageImpl(inputstream,
- false,
- mimeheaders);
- }
-
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.saaj;
+
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * @author Ashutosh Shahi ashutosh.shahi@gmail.com
+ * <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();
+ return new SOAPMessageImpl(env);
+ }
+
+ /* (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 {
+ return new SOAPMessageImpl(inputstream,
+ false,
+ mimeheaders);
+ }
+
+}
Propchange: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MessageFactoryImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MimeHeaders.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MimeHeaders.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MimeHeaders.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MimeHeaders.java Thu Sep 15 11:52:11 2005
@@ -1,48 +1,48 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.axis2.saaj;
-
-import javax.xml.soap.MimeHeader;
-import java.util.Iterator;
-
-/**
- * @author Ashutosh Shahi ashutosh.shahi@gmail.com
- * <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() {
- }
-
- public MimeHeaders(javax.xml.soap.MimeHeaders h) {
- Iterator iterator = h.getAllHeaders();
- while (iterator.hasNext()) {
- MimeHeader hdr = (MimeHeader) iterator.next();
- addHeader(hdr.getName(), hdr.getValue());
- }
- }
-
- private int getHeaderSize() {
- int size = 0;
- Iterator iterator = getAllHeaders();
- while (iterator.hasNext()) {
- iterator.next();
- size++;
- }
- return size;
- }
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.axis2.saaj;
+
+import javax.xml.soap.MimeHeader;
+import java.util.Iterator;
+
+/**
+ * @author Ashutosh Shahi ashutosh.shahi@gmail.com
+ * <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() {
+ }
+
+ public MimeHeaders(javax.xml.soap.MimeHeaders h) {
+ Iterator iterator = h.getAllHeaders();
+ while (iterator.hasNext()) {
+ MimeHeader hdr = (MimeHeader) iterator.next();
+ addHeader(hdr.getName(), hdr.getValue());
+ }
+ }
+
+ private int getHeaderSize() {
+ int size = 0;
+ Iterator iterator = getAllHeaders();
+ while (iterator.hasNext()) {
+ iterator.next();
+ size++;
+ }
+ return size;
+ }
+}
Propchange: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/MimeHeaders.java
------------------------------------------------------------------------------
svn:eol-style = native