KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > soap > SOAPFactoryImpl


1 /*
2  * Copyright 2002-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.axis.soap;
17
18 import org.apache.axis.message.Detail;
19 import org.apache.axis.message.MessageElement;
20 import org.apache.axis.message.PrefixedQName;
21
22 import javax.xml.soap.Name JavaDoc;
23 import javax.xml.soap.SOAPElement JavaDoc;
24 import javax.xml.soap.SOAPException JavaDoc;
25
26 /**
27  * SOAP Element Factory implementation
28  *
29  * @author Davanum Srinivas (dims@yahoo.com)
30  */

31 public class SOAPFactoryImpl extends javax.xml.soap.SOAPFactory JavaDoc {
32     /**
33      * Create a <CODE>SOAPElement</CODE> object initialized with
34      * the given <CODE>Name</CODE> object.
35      * @param name a <CODE>Name</CODE> object with
36      * the XML name for the new element
37      * @return the new <CODE>SOAPElement</CODE> object that was
38      * created
39      * @throws SOAPException if there is an error in
40      * creating the <CODE>SOAPElement</CODE> object
41      */

42     public SOAPElement JavaDoc createElement(Name name) throws SOAPException JavaDoc {
43         return new MessageElement(name);
44     }
45
46     /**
47      * Create a <CODE>SOAPElement</CODE> object initialized with
48      * the given local name.
49      * @param localName a <CODE>String</CODE> giving
50      * the local name for the new element
51      * @return the new <CODE>SOAPElement</CODE> object that was
52      * created
53      * @throws SOAPException if there is an error in
54      * creating the <CODE>SOAPElement</CODE> object
55      */

56     public SOAPElement JavaDoc createElement(String JavaDoc localName) throws SOAPException JavaDoc {
57         return new MessageElement("",localName);
58     }
59
60     /**
61      * Create a new <CODE>SOAPElement</CODE> object with the
62      * given local name, prefix and uri.
63      * @param localName a <CODE>String</CODE> giving
64      * the local name for the new element
65      * @param prefix the prefix for this <CODE>
66      * SOAPElement</CODE>
67      * @param uri a <CODE>String</CODE> giving the
68      * URI of the namespace to which the new element
69      * belongs
70      * @return the new <CODE>SOAPElement</CODE> object that was
71      * created
72      * @throws SOAPException if there is an error in
73      * creating the <CODE>SOAPElement</CODE> object
74      */

75     public SOAPElement JavaDoc createElement(
76             String JavaDoc localName, String JavaDoc prefix, String JavaDoc uri) throws SOAPException JavaDoc {
77         return new MessageElement(localName, prefix, uri);
78     }
79
80     public javax.xml.soap.Detail JavaDoc createDetail()
81             throws SOAPException JavaDoc {
82         return new Detail();
83     }
84
85     public Name createName(String JavaDoc localName, String JavaDoc prefix, String JavaDoc uri)
86             throws SOAPException JavaDoc {
87         return new PrefixedQName(uri,localName,prefix);
88     }
89
90     public Name createName(String JavaDoc localName)
91             throws SOAPException JavaDoc {
92         return new PrefixedQName("",localName,"");
93     }
94 }
95
Popular Tags