KickJava   Java API By Example, From Geeks To Geeks.

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


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.Component;
19 import org.apache.wsdl.WSDLConstants;
20 import org.apache.wsdl.WSDLExtensibilityAttribute;
21 import org.apache.wsdl.WSDLExtensibilityElement;
22 import org.w3c.dom.Document JavaDoc;
23
24 import java.util.HashMap JavaDoc;
25 import java.util.LinkedList JavaDoc;
26 import java.util.List JavaDoc;
27
28 /**
29  * @author Chathura Herath
30  */

31 public class ComponentImpl implements WSDLConstants, Component {
32     /**
33      * Field componentProperties
34      */

35     protected HashMap JavaDoc componentProperties = new HashMap JavaDoc();
36
37     /**
38      * List of Element
39      */

40     protected List JavaDoc elments;
41
42     /**
43      * Field documentation
44      */

45     protected Document JavaDoc documentation = null;
46
47     /**
48      * Field Namespace Qualified elements that can be sticked in the component.
49      */

50     private List JavaDoc elements = null;
51
52     /**
53      * Field Namespace Qualified attrebutes that can be sticked int eh
54      * component.
55      */

56     private List JavaDoc attributes = null;
57
58     /**
59      * Returns the Documentation Element as a <code>Document</code>.
60      *
61      * @return documentation
62      */

63     public Document JavaDoc getDocumentation() {
64         return documentation;
65     }
66
67     /**
68      * Will set the Documentation element for the Component.
69      *
70      * @param documentation
71      * Component Docuemntation
72      */

73     public void setDocumentation(Document JavaDoc documentation) {
74         this.documentation = documentation;
75     }
76
77     /**
78      * Returns the properties that are specific to this WSDL Component.
79      *
80      * @return
81      */

82     public HashMap JavaDoc getComponentProperties() {
83         return componentProperties;
84     }
85
86     /**
87      * Sets the properties of the Component if any.
88      *
89      * @param properties
90      */

91     public void setComponentProperties(HashMap JavaDoc properties) {
92         this.componentProperties = properties;
93     }
94
95     /**
96      * Will set the property keyed with the relavent key
97      *
98      * @param key
99      * Key in the map
100      * @param obj
101      * Object to be put
102      */

103     public void setComponentProperty(Object JavaDoc key, Object JavaDoc obj) {
104         this.componentProperties.put(key, obj);
105     }
106
107     /**
108      * Gets the component property
109      *
110      * @param key
111      * key for the map search.
112      * @return
113      */

114     public Object JavaDoc getComponentProperty(Object JavaDoc key) {
115         return this.componentProperties.get(key);
116     }
117
118     /**
119      * Adds the <code>Element</code> to this Component.
120      *
121      * @param element
122      */

123     public void addExtensibilityElement(WSDLExtensibilityElement element) {
124         if (null == this.elements) {
125             this.elements = new LinkedList JavaDoc();
126         }
127         if (null == element)
128             return;
129         this.elements.add(element);
130
131     }
132
133     /**
134      * Returns the Extensibility Elements of this component;
135      *
136      * @return List of <code>Element</code> s
137      */

138     public List JavaDoc getExtensibilityElements() {
139         if (null == this.elements) {
140             this.elements = new LinkedList JavaDoc();
141         }
142         return this.elements;
143     }
144
145     /**
146      * Adds the <code>ExtensibilityAttribute</code> as a attrebute of this
147      * Component.
148      * @param attribute <code>ExtensibilityAttribute</code>
149      */

150     public void addExtensibleAttributes(WSDLExtensibilityAttribute attribute) {
151         if (null == this.attributes) {
152             this.attributes = new LinkedList JavaDoc();
153         }
154         if (null == attribute)
155             return;
156         this.attributes.add(attribute);
157     }
158
159     /**
160      * Returns a <code>List</code> of ExtensibleAttributes of this component.
161      * @return <code>List</code>
162      */

163     public List JavaDoc getExtensibilityAttributes() {
164         if (null == this.attributes) {
165             this.attributes = new LinkedList JavaDoc();
166         }
167         return this.attributes;
168     }
169 }
Popular Tags