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: | 223 |  | Methods: | 16
| NCLOC: | 98 |  | 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
SystemInterceptor.java | 25% | 24.2% | 18.8% | 22.8% |

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