KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > wsdl > impl > ExtensibleComponentImpl


1 /*
2  * Copyright 2004,2005 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.wsdl.impl;
17
18 import org.apache.wsdl.ExtensibleComponent;
19 import org.apache.wsdl.WSDLFeature;
20 import org.apache.wsdl.WSDLProperty;
21
22 import java.util.LinkedList JavaDoc;
23 import java.util.List JavaDoc;
24
25
26 /**
27  * @author chathura@opensource.lk
28  */

29 public class ExtensibleComponentImpl extends ComponentImpl
30         implements ExtensibleComponent {
31     /**
32      * Field features
33      */

34     private List JavaDoc features = null;
35
36     /**
37      * Field properties
38      */

39     private List JavaDoc properties = null;
40     
41     
42
43     /**
44      * Will add a <code>WSDLFeature</code> to the feature list.
45      * If feature is null it will not be added.
46      * <code>ExtensibleComponent</code>
47      *
48      * @param feature
49      */

50     public void addFeature(WSDLFeature feature) {
51         if (null == this.features) {
52             this.features = new LinkedList JavaDoc();
53         }
54         if (null == feature) {
55             return;
56         }
57         this.features.add(feature);
58     }
59
60     /**
61      * Will return the <code>WSDLFeature</code>s. If there aren't
62      * any features an empty list will be returned.
63      *
64      * @return
65      */

66     public List JavaDoc getFeatures() {
67         if (null == this.features) {
68             return new LinkedList JavaDoc();
69         }
70         return this.features;
71     }
72
73     /**
74      * Will add the property to the component properties. If the property is null it will
75      * not be added.
76      *
77      * @param wsdlProperty
78      */

79     public void addProperty(WSDLProperty wsdlProperty) {
80         if (null == this.properties) {
81             this.properties = new LinkedList JavaDoc();
82         }
83         if (null == wsdlProperty) {
84             return;
85         }
86         this.features.add(wsdlProperty);
87     }
88
89     /**
90      * Returns the Component Properties. If none exist an empty list will be returned.
91      *
92      * @return
93      */

94     public List JavaDoc getProperties() {
95         if (null == this.properties) {
96             return new LinkedList JavaDoc();
97         }
98         return this.properties;
99     }
100     
101   
102 }
103
Popular Tags