KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > wsdl > extensions > impl > ExtensionFactoryImpl


1 /*
2  * Copyright 2001-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
17 package org.apache.wsdl.extensions.impl;
18
19 import org.apache.wsdl.WSDLExtensibilityElement;
20 import org.apache.wsdl.extensions.ExtensionConstants;
21 import org.apache.wsdl.extensions.ExtensionFactory;
22
23 import javax.xml.namespace.QName JavaDoc;
24
25 /**
26  * @author chathura@opensource.lk
27  *
28  */

29 public class ExtensionFactoryImpl implements ExtensionFactory , ExtensionConstants{
30     /**
31      * Returns the correct "Specific" ExtensibilityElement given the
32      * <code>QName</code>
33      * @param qName QName of the ExtensibilityElement found in the WSDL
34      * @return the Specific implementation for the particular QName given.
35      */

36      public WSDLExtensibilityElement getExtensionElement(QName JavaDoc qName){
37         if(qName.equals(SOAP_ADDRESS))
38             return new SOAPAddressImpl();
39         if(qName.equals(SCHEMA))
40             return new SchemaImpl();
41         if(qName.equals(SOAP_OPERATION))
42             return new SOAPOperationImpl();
43         if(SOAP_BODY.equals(qName))
44             return new SOAPBodyImpl();
45         if(SOAP_BINDING.equals(qName))
46             return new SOAPBindingImpl();
47         
48         return new DefaultExtensibilityElementImpl();
49      }
50
51 }
52
Popular Tags