Clover coverage report - JFox Service-Oriented Application Framework - 1.0-RC2 Coverage timestamp: 星期四 十二月 15 2005 11:58:01 CST FRAMES NO FRAMES |
file stats: | LOC: | 345 |  | Methods: | 26
| NCLOC: | 134 |  | Classes: | 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
Source file | Conditionals | Statements | Methods | TOTAL
ServiceEntry.java | 12.5% | 37.2% | 46.2% | 37.7% |

1 |  |
     /**
2 |  |
      * @(#)ServiceEntry.java
3 |  |
      *
4 |  |
      * JFoxSOAF, Service-Oriented Application Framework
5 |  |
      *
6 |  |
      * Copyright(c) JFoxSOAF Team
7 |  |
      *
8 |  |
      * Licensed under the GNU LGPL, Version 2.1 (the "License");
9 |  |
      * you may not use this file except in compliance with the License.
10 |  |
      * You may obtain a copy of the License at
11 |  |
      *
12 |  |
      * http://www.gnu.org/copyleft/lesser.html
13 |  |
      *
14 |  |
      * Unless required by applicable law or agreed to in writing, software
15 |  |
      * distributed under the License is distributed on an "AS IS" BASIS,
16 |  |
      * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 |  |
      * See the License for the specific language governing permissions and
18 |  |
      * limitations under the License.
19 |  |
      *
20 |  |
      * For more information, please visit:
21 |  |
      * http://www.jfox.cn/confluence/display/JFoxSOAF/Home
22 |  |
      * http://www.huihoo.org/jfox/jfoxsoaf
23 |  |
      */
24 |  |
25 |  |
     package org.huihoo.jfox.soaf.schema.service;
26 |  |
27 |  |
     import java.util.Vector;
28 |  |
29 |  |
     import org.exolab.castor.xml.Marshaller;
30 |  |
     import org.exolab.castor.xml.Unmarshaller;
31 |  |
32 |  |
     /**
33 |  |
      * <p>
34 |  |
      * Class ServiceEntry.
35 |  |
      * </p>
36 |  |
      *
37 |  |
      * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter Cheng </a>
38 |  |
      * @version $Revision: 1.7 $ $Date: 2005/05/22 06:48:07 $
39 |  |
      * @version Revision: 1.0
40 |  |
      */
41 |  |
42 |  |
     public class ServiceEntry implements java.io.Serializable,
43 |  |
             org.huihoo.jfox.soaf.container.ServiceEntry {
44 |  |
45 |  |
         /**
46 |  |
          * Field _id
47 |  |
          */
48 |  |
         private java.lang.String _id;
49 |  |
50 |  |
         /**
51 |  |
          * Field _description
52 |  |
          */
53 |  |
         private java.lang.String _description;
54 |  |
55 |  |
         /**
56 |  |
          * Field _manageable
57 |  |
          */
58 |  |
         private java.lang.String _manageable;
59 |  |
60 |  |
         /**
61 |  |
          * Field _interface
62 |  |
          */
63 |  |
         private java.lang.String _interface;
64 |  |
65 |  |
         /**
66 |  |
          * Field _implementation
67 |  |
          */
68 |  |
         private java.lang.String _implementation;
69 |  |
70 |  |
         /**
71 |  |
          * Field _parameterList
72 |  |
          */
73 |  |
         private java.util.Vector _parameterList;
74 |  |
75 | 131 |
         public ServiceEntry() {
76 | 131 |
             super();
77 | 131 |
             _parameterList = new Vector();
78 |  |
         }
79 |  |
80 |  |
         /**
81 |  |
          * Method addParameter
82 |  |
          *
83 |  |
          * @param vParameter
84 |  |
          */
85 | 0 |
         public void addParameter(
86 |  |
                 org.huihoo.jfox.soaf.schema.service.Parameter vParameter)
87 |  |
                 throws java.lang.IndexOutOfBoundsException {
88 | 0 |
             _parameterList.addElement(vParameter);
89 |  |
         }
90 |  |
91 |  |
         /**
92 |  |
          * Method addParameter
93 |  |
          *
94 |  |
          * @param index
95 |  |
          * @param vParameter
96 |  |
          */
97 | 0 |
         public void addParameter(int index,
98 |  |
                 org.huihoo.jfox.soaf.schema.service.Parameter vParameter)
99 |  |
                 throws java.lang.IndexOutOfBoundsException {
100 | 0 |
             _parameterList.insertElementAt(vParameter, index);
101 |  |
         }
102 |  |
103 |  |
         /**
104 |  |
          * Method enumerateParameter
105 |  |
          */
106 | 0 |
         public java.util.Enumeration enumerateParameter() {
107 | 0 |
             return _parameterList.elements();
108 |  |
         }
109 |  |
110 |  |
         /**
111 |  |
          * Method getDescriptionReturns the value of field 'description'.
112 |  |
          *
113 |  |
          * @return the value of field 'description'.
114 |  |
          */
115 | 131 |
         public java.lang.String getDescription() {
116 | 131 |
             return this._description;
117 |  |
         }
118 |  |
119 |  |
         /**
120 |  |
          * Method getIdReturns the value of field 'id'.
121 |  |
          *
122 |  |
          * @return the value of field 'id'.
123 |  |
          */
124 | 261 |
         public java.lang.String getId() {
125 | 261 |
             return this._id;
126 |  |
         }
127 |  |
128 |  |
         /**
129 |  |
          * Method getImplementationReturns the value of field 'implementation'.
130 |  |
          *
131 |  |
          * @return the value of field 'implementation'.
132 |  |
          */
133 | 522 |
         public java.lang.String getImplementation() {
134 | 522 |
             return this._implementation;
135 |  |
         }
136 |  |
137 |  |
         /**
138 |  |
          * Method getInterfaceReturns the value of field 'interface'.
139 |  |
          *
140 |  |
          * @return the value of field 'interface'.
141 |  |
          */
142 | 131 |
         public java.lang.String getInterface() {
143 | 131 |
             return this._interface;
144 |  |
         }
145 |  |
146 |  |
         /**
147 |  |
          * Method getManageableReturns the value of field 'manageable'.
148 |  |
          *
149 |  |
          * @return the value of field 'manageable'.
150 |  |
          */
151 | 391 |
         public java.lang.String getManageable() {
152 | 391 |
             return this._manageable;
153 |  |
         }
154 |  |
155 |  |
         /**
156 |  |
          * Method getParameter
157 |  |
          *
158 |  |
          * @param index
159 |  |
          */
160 | 0 |
         public org.huihoo.jfox.soaf.schema.service.Parameter getParameter(int index)
161 |  |
                 throws java.lang.IndexOutOfBoundsException {
162 |  |
             //-- check bounds for index
163 | 0 |
             if ((index < 0) || (index > _parameterList.size())) {
164 | 0 |
                 throw new IndexOutOfBoundsException();
165 |  |
             }
166 |  |
167 | 0 |
             return (org.huihoo.jfox.soaf.schema.service.Parameter) _parameterList
168 |  |
                     .elementAt(index);
169 |  |
         }
170 |  |
171 |  |
         /**
172 |  |
          * Method getParameter
173 |  |
          */
174 | 131 |
         public org.huihoo.jfox.soaf.schema.service.Parameter[] getParameter() {
175 | 131 |
             int size = _parameterList.size();
176 | 131 |
             org.huihoo.jfox.soaf.schema.service.Parameter[] mArray = new org.huihoo.jfox.soaf.schema.service.Parameter[size];
177 | 131 |
             for (int index = 0; index < size; index++) {
178 | 0 |
                 mArray[index] = (org.huihoo.jfox.soaf.schema.service.Parameter) _parameterList
179 |  |
                         .elementAt(index);
180 |  |
             }
181 | 131 |
             return mArray;
182 |  |
         }
183 |  |
184 |  |
         /**
185 |  |
          * Method getParameterCount
186 |  |
          */
187 | 0 |
         public int getParameterCount() {
188 | 0 |
             return _parameterList.size();
189 |  |
         }
190 |  |
191 |  |
         /**
192 |  |
          * Method isValid
193 |  |
          */
194 | 0 |
         public boolean isValid() {
195 | 0 |
             try {
196 | 0 |
                 validate();
197 |  |
             } catch (org.exolab.castor.xml.ValidationException vex) {
198 | 0 |
                 return false;
199 |  |
             }
200 | 0 |
             return true;
201 |  |
         }
202 |  |
203 |  |
         /**
204 |  |
          * Method marshal
205 |  |
          *
206 |  |
          * @param out
207 |  |
          */
208 | 0 |
         public void marshal(java.io.Writer out)
209 |  |
                 throws org.exolab.castor.xml.MarshalException,
210 |  |
                 org.exolab.castor.xml.ValidationException {
211 |  |
212 | 0 |
             Marshaller.marshal(this, out);
213 |  |
         }
214 |  |
215 |  |
         /**
216 |  |
          * Method marshal
217 |  |
          *
218 |  |
          * @param handler
219 |  |
          */
220 | 0 |
         public void marshal(org.xml.sax.ContentHandler handler)
221 |  |
                 throws java.io.IOException, org.exolab.castor.xml.MarshalException,
222 |  |
                 org.exolab.castor.xml.ValidationException {
223 |  |
224 | 0 |
             Marshaller.marshal(this, handler);
225 |  |
         }
226 |  |
227 |  |
         /**
228 |  |
          * Method removeAllParameter
229 |  |
          */
230 | 0 |
         public void removeAllParameter() {
231 | 0 |
             _parameterList.removeAllElements();
232 |  |
         }
233 |  |
234 |  |
         /**
235 |  |
          * Method removeParameter
236 |  |
          *
237 |  |
          * @param index
238 |  |
          */
239 | 0 |
         public org.huihoo.jfox.soaf.schema.service.Parameter removeParameter(
240 |  |
                 int index) {
241 | 0 |
             java.lang.Object obj = _parameterList.elementAt(index);
242 | 0 |
             _parameterList.removeElementAt(index);
243 | 0 |
             return (org.huihoo.jfox.soaf.schema.service.Parameter) obj;
244 |  |
         }
245 |  |
246 |  |
         /**
247 |  |
          * Method setDescriptionSets the value of field 'description'.
248 |  |
          *
249 |  |
          * @param description the value of field 'description'.
250 |  |
          */
251 | 131 |
         public void setDescription(java.lang.String description) {
252 | 131 |
             this._description = description;
253 |  |
         }
254 |  |
255 |  |
         /**
256 |  |
          * Method setIdSets the value of field 'id'.
257 |  |
          *
258 |  |
          * @param id the value of field 'id'.
259 |  |
          */
260 | 131 |
         public void setId(java.lang.String id) {
261 | 131 |
             this._id = id;
262 |  |
         }
263 |  |
264 |  |
         /**
265 |  |
          * Method setImplementationSets the value of field 'implementation'.
266 |  |
          *
267 |  |
          * @param implementation the value of field 'implementation'.
268 |  |
          */
269 | 131 |
         public void setImplementation(java.lang.String implementation) {
270 | 131 |
             this._implementation = implementation;
271 |  |
         }
272 |  |
273 |  |
         /**
274 |  |
          * Method setInterfaceSets the value of field 'interface'.
275 |  |
          *
276 |  |
          * @param _interface
277 |  |
          * @param interface the value of field 'interface'.
278 |  |
          */
279 | 131 |
         public void setInterface(java.lang.String _interface) {
280 | 131 |
             this._interface = _interface;
281 |  |
         }
282 |  |
283 |  |
         /**
284 |  |
          * Method setManageableSets the value of field 'manageable'.
285 |  |
          *
286 |  |
          * @param manageable the value of field 'manageable'.
287 |  |
          */
288 | 131 |
         public void setManageable(java.lang.String manageable) {
289 | 131 |
             this._manageable = manageable;
290 |  |
         }
291 |  |
292 |  |
         /**
293 |  |
          * Method setParameter
294 |  |
          *
295 |  |
          * @param index
296 |  |
          * @param vParameter
297 |  |
          */
298 | 0 |
         public void setParameter(int index,
299 |  |
                 org.huihoo.jfox.soaf.schema.service.Parameter vParameter)
300 |  |
                 throws java.lang.IndexOutOfBoundsException {
301 |  |
             //-- check bounds for index
302 | 0 |
             if ((index < 0) || (index > _parameterList.size())) {
303 | 0 |
                 throw new IndexOutOfBoundsException();
304 |  |
             }
305 | 0 |
             _parameterList.setElementAt(vParameter, index);
306 |  |
         }
307 |  |
308 |  |
         /**
309 |  |
          * Method setParameter
310 |  |
          *
311 |  |
          * @param parameterArray
312 |  |
          */
313 | 0 |
         public void setParameter(
314 |  |
                 org.huihoo.jfox.soaf.schema.service.Parameter[] parameterArray) {
315 |  |
             //-- copy array
316 | 0 |
             _parameterList.removeAllElements();
317 | 0 |
             for (int i = 0; i < parameterArray.length; i++) {
318 | 0 |
                 _parameterList.addElement(parameterArray[i]);
319 |  |
             }
320 |  |
         }
321 |  |
322 |  |
         /**
323 |  |
          * Method unmarshal
324 |  |
          *
325 |  |
          * @param reader
326 |  |
          */
327 | 0 |
         public static org.huihoo.jfox.soaf.schema.service.ServiceEntry unmarshal(
328 |  |
                 java.io.Reader reader)
329 |  |
                 throws org.exolab.castor.xml.MarshalException,
330 |  |
                 org.exolab.castor.xml.ValidationException {
331 | 0 |
             return (org.huihoo.jfox.soaf.schema.service.ServiceEntry) Unmarshaller
332 |  |
                     .unmarshal(
333 |  |
                             org.huihoo.jfox.soaf.schema.service.ServiceEntry.class,
334 |  |
                             reader);
335 |  |
         }
336 |  |
337 |  |
         /**
338 |  |
          * Method validate
339 |  |
          */
340 | 0 |
         public void validate() throws org.exolab.castor.xml.ValidationException {
341 | 0 |
             org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
342 | 0 |
             validator.validate(this);
343 |  |
         }
344 |  |
345 |  |
     }