Clover coverage report - JFox Service-Oriented Application Framework - 1.0-RC3 Coverage timestamp: 星期三 二月 15 2006 18:10:22 CST FRAMES NO FRAMES |
file stats: | LOC: | 227 |  | Methods: | 16
| NCLOC: | 97 |  | 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
Service.java | 25% | 27.3% | 25% | 26.3% |

1 |  |
     /**
2 |  |
      * @(#)Service.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 Service.
35 |  |
      * </p>
36 |  |
      *
37 |  |
      * @author <a href="mailto:founder_chen@yahoo.com.cn">Peter Cheng </a>*
38 |  |
      * @version $Revision: 1.6 $ $Date: 2005/01/17 13:29:57 $
39 |  |
      * @version Revision: 1.0
40 |  |
      */
41 |  |
42 |  |
     public class Service implements java.io.Serializable {
43 |  |
44 |  |
         /**
45 |  |
          * Field _serviceEntryList
46 |  |
          */
47 |  |
         private java.util.Vector _serviceEntryList;
48 |  |
49 | 71 |
         public Service() {
50 | 71 |
             super();
51 | 71 |
             _serviceEntryList = new Vector();
52 |  |
         }
53 |  |
54 |  |
         /**
55 |  |
          * Method addServiceEntry
56 |  |
          *
57 |  |
          * @param vServiceEntry
58 |  |
          */
59 | 131 |
         public void addServiceEntry(
60 |  |
                 org.huihoo.jfox.soaf.schema.service.ServiceEntry vServiceEntry)
61 |  |
                 throws java.lang.IndexOutOfBoundsException {
62 | 131 |
             _serviceEntryList.addElement(vServiceEntry);
63 |  |
         }
64 |  |
65 |  |
         /**
66 |  |
          * Method addServiceEntry
67 |  |
          *
68 |  |
          * @param index
69 |  |
          * @param vServiceEntry
70 |  |
          */
71 | 0 |
         public void addServiceEntry(int index,
72 |  |
                 org.huihoo.jfox.soaf.schema.service.ServiceEntry vServiceEntry)
73 |  |
                 throws java.lang.IndexOutOfBoundsException {
74 | 0 |
             _serviceEntryList.insertElementAt(vServiceEntry, index);
75 |  |
         }
76 |  |
77 |  |
         /**
78 |  |
          * Method enumerateServiceEntry
79 |  |
          */
80 | 0 |
         public java.util.Enumeration enumerateServiceEntry() {
81 | 0 |
             return _serviceEntryList.elements();
82 |  |
         }
83 |  |
84 |  |
         /**
85 |  |
          * Method getServiceEntry
86 |  |
          *
87 |  |
          * @param index
88 |  |
          */
89 | 0 |
         public org.huihoo.jfox.soaf.schema.service.ServiceEntry getServiceEntry(
90 |  |
                 int index) throws java.lang.IndexOutOfBoundsException {
91 |  |
             //-- check bounds for index
92 | 0 |
             if ((index < 0) || (index > _serviceEntryList.size())) {
93 | 0 |
                 throw new IndexOutOfBoundsException();
94 |  |
             }
95 |  |
96 | 0 |
             return (org.huihoo.jfox.soaf.schema.service.ServiceEntry) _serviceEntryList
97 |  |
                     .elementAt(index);
98 |  |
         }
99 |  |
100 |  |
         /**
101 |  |
          * Method getServiceEntry
102 |  |
          */
103 | 142 |
         public org.huihoo.jfox.soaf.schema.service.ServiceEntry[] getServiceEntry() {
104 | 142 |
             int size = _serviceEntryList.size();
105 | 142 |
             org.huihoo.jfox.soaf.schema.service.ServiceEntry[] mArray = new org.huihoo.jfox.soaf.schema.service.ServiceEntry[size];
106 | 142 |
             for (int index = 0; index < size; index++) {
107 | 262 |
                 mArray[index] = (org.huihoo.jfox.soaf.schema.service.ServiceEntry) _serviceEntryList
108 |  |
                         .elementAt(index);
109 |  |
             }
110 | 142 |
             return mArray;
111 |  |
         }
112 |  |
113 |  |
         /**
114 |  |
          * Method getServiceEntryCount
115 |  |
          */
116 | 0 |
         public int getServiceEntryCount() {
117 | 0 |
             return _serviceEntryList.size();
118 |  |
         }
119 |  |
120 |  |
         /**
121 |  |
          * Method isValid
122 |  |
          */
123 | 0 |
         public boolean isValid() {
124 | 0 |
             try {
125 | 0 |
                 validate();
126 |  |
             } catch (org.exolab.castor.xml.ValidationException vex) {
127 | 0 |
                 return false;
128 |  |
             }
129 | 0 |
             return true;
130 |  |
         }
131 |  |
132 |  |
         /**
133 |  |
          * Method marshal
134 |  |
          *
135 |  |
          * @param out
136 |  |
          */
137 | 0 |
         public void marshal(java.io.Writer out)
138 |  |
                 throws org.exolab.castor.xml.MarshalException,
139 |  |
                 org.exolab.castor.xml.ValidationException {
140 |  |
141 | 0 |
             Marshaller.marshal(this, out);
142 |  |
         }
143 |  |
144 |  |
         /**
145 |  |
          * Method marshal
146 |  |
          *
147 |  |
          * @param handler
148 |  |
          */
149 | 0 |
         public void marshal(org.xml.sax.ContentHandler handler)
150 |  |
                 throws java.io.IOException, org.exolab.castor.xml.MarshalException,
151 |  |
                 org.exolab.castor.xml.ValidationException {
152 |  |
153 | 0 |
             Marshaller.marshal(this, handler);
154 |  |
         }
155 |  |
156 |  |
         /**
157 |  |
          * Method removeAllServiceEntry
158 |  |
          */
159 | 0 |
         public void removeAllServiceEntry() {
160 | 0 |
             _serviceEntryList.removeAllElements();
161 |  |
         }
162 |  |
163 |  |
         /**
164 |  |
          * Method removeServiceEntry
165 |  |
          *
166 |  |
          * @param index
167 |  |
          */
168 | 0 |
         public org.huihoo.jfox.soaf.schema.service.ServiceEntry removeServiceEntry(
169 |  |
                 int index) {
170 | 0 |
             java.lang.Object obj = _serviceEntryList.elementAt(index);
171 | 0 |
             _serviceEntryList.removeElementAt(index);
172 | 0 |
             return (org.huihoo.jfox.soaf.schema.service.ServiceEntry) obj;
173 |  |
         }
174 |  |
175 |  |
         /**
176 |  |
          * Method setServiceEntry
177 |  |
          *
178 |  |
          * @param index
179 |  |
          * @param vServiceEntry
180 |  |
          */
181 | 0 |
         public void setServiceEntry(int index,
182 |  |
                 org.huihoo.jfox.soaf.schema.service.ServiceEntry vServiceEntry)
183 |  |
                 throws java.lang.IndexOutOfBoundsException {
184 |  |
             //-- check bounds for index
185 | 0 |
             if ((index < 0) || (index > _serviceEntryList.size())) {
186 | 0 |
                 throw new IndexOutOfBoundsException();
187 |  |
             }
188 | 0 |
             _serviceEntryList.setElementAt(vServiceEntry, index);
189 |  |
         }
190 |  |
191 |  |
         /**
192 |  |
          * Method setServiceEntry
193 |  |
          *
194 |  |
          * @param serviceEntryArray
195 |  |
          */
196 | 0 |
         public void setServiceEntry(
197 |  |
                 org.huihoo.jfox.soaf.schema.service.ServiceEntry[] serviceEntryArray) {
198 |  |
             //-- copy array
199 | 0 |
             _serviceEntryList.removeAllElements();
200 | 0 |
             for (int i = 0; i < serviceEntryArray.length; i++) {
201 | 0 |
                 _serviceEntryList.addElement(serviceEntryArray[i]);
202 |  |
             }
203 |  |
         }
204 |  |
205 |  |
         /**
206 |  |
          * Method unmarshal
207 |  |
          *
208 |  |
          * @param reader
209 |  |
          */
210 | 71 |
         public static org.huihoo.jfox.soaf.schema.service.Service unmarshal(
211 |  |
                 java.io.Reader reader)
212 |  |
                 throws org.exolab.castor.xml.MarshalException,
213 |  |
                 org.exolab.castor.xml.ValidationException {
214 | 71 |
             return (org.huihoo.jfox.soaf.schema.service.Service) Unmarshaller
215 |  |
                     .unmarshal(org.huihoo.jfox.soaf.schema.service.Service.class,
216 |  |
                             reader);
217 |  |
         }
218 |  |
219 |  |
         /**
220 |  |
          * Method validate
221 |  |
          */
222 | 0 |
         public void validate() throws org.exolab.castor.xml.ValidationException {
223 | 0 |
             org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
224 | 0 |
             validator.validate(this);
225 |  |
         }
226 |  |
227 |  |
     }