|
|||||||||||||||||||
| 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 | |||||||||||||||
| ServiceConfiguration.java | 25% | 24.2% | 18.8% | 22.8% |
|
||||||||||||||
| 1 |
/**
|
|
| 2 |
* JFoxSOAF, Service-Oriented Application Framework
|
|
| 3 |
*
|
|
| 4 |
* Copyright (C) www.huihoo.org
|
|
| 5 |
*
|
|
| 6 |
* Distributable under GNU LGPL For more information, please visit:
|
|
| 7 |
* http://www.huihoo.org/jfox/jfoxsoaf
|
|
| 8 |
*/
|
|
| 9 |
|
|
| 10 |
package org.huihoo.jfox.soaf.schema.config;
|
|
| 11 |
|
|
| 12 |
import java.util.Vector;
|
|
| 13 |
|
|
| 14 |
import org.exolab.castor.xml.Marshaller;
|
|
| 15 |
import org.exolab.castor.xml.Unmarshaller;
|
|
| 16 |
|
|
| 17 |
/**
|
|
| 18 |
* Class ServiceConfiguration.
|
|
| 19 |
*
|
|
| 20 |
* @version $Revision: 1.1 $ $Date: 2004/10/13 10:51:38 $
|
|
| 21 |
*/
|
|
| 22 |
public class ServiceConfiguration implements java.io.Serializable { |
|
| 23 |
|
|
| 24 |
/**
|
|
| 25 |
* Field _configurationEntryList
|
|
| 26 |
*/
|
|
| 27 |
private java.util.Vector _configurationEntryList;
|
|
| 28 |
|
|
| 29 | 4 |
public ServiceConfiguration() {
|
| 30 | 4 |
super();
|
| 31 | 4 |
_configurationEntryList = new Vector();
|
| 32 |
} |
|
| 33 |
|
|
| 34 |
/**
|
|
| 35 |
* Method addConfigurationEntry
|
|
| 36 |
*
|
|
| 37 |
* @param vConfigurationEntry
|
|
| 38 |
*/
|
|
| 39 | 16 |
public void addConfigurationEntry( |
| 40 |
org.huihoo.jfox.soaf.schema.config.ConfigurationEntry vConfigurationEntry) |
|
| 41 |
throws java.lang.IndexOutOfBoundsException {
|
|
| 42 | 16 |
_configurationEntryList.addElement(vConfigurationEntry); |
| 43 |
} |
|
| 44 |
|
|
| 45 |
/**
|
|
| 46 |
* Method addConfigurationEntry
|
|
| 47 |
*
|
|
| 48 |
* @param index
|
|
| 49 |
* @param vConfigurationEntry
|
|
| 50 |
*/
|
|
| 51 | 0 |
public void addConfigurationEntry( |
| 52 |
int index,
|
|
| 53 |
org.huihoo.jfox.soaf.schema.config.ConfigurationEntry vConfigurationEntry) |
|
| 54 |
throws java.lang.IndexOutOfBoundsException {
|
|
| 55 | 0 |
_configurationEntryList.insertElementAt(vConfigurationEntry, index); |
| 56 |
} |
|
| 57 |
|
|
| 58 |
/**
|
|
| 59 |
* Method enumerateConfigurationEntry
|
|
| 60 |
*/
|
|
| 61 | 0 |
public java.util.Enumeration enumerateConfigurationEntry() {
|
| 62 | 0 |
return _configurationEntryList.elements();
|
| 63 |
} |
|
| 64 |
|
|
| 65 |
/**
|
|
| 66 |
* Method getConfigurationEntry
|
|
| 67 |
*
|
|
| 68 |
* @param index
|
|
| 69 |
*/
|
|
| 70 | 0 |
public org.huihoo.jfox.soaf.schema.config.ConfigurationEntry getConfigurationEntry(
|
| 71 |
int index) throws java.lang.IndexOutOfBoundsException { |
|
| 72 |
//-- check bounds for index
|
|
| 73 | 0 |
if ((index < 0) || (index > _configurationEntryList.size())) {
|
| 74 | 0 |
throw new IndexOutOfBoundsException(); |
| 75 |
} |
|
| 76 |
|
|
| 77 | 0 |
return (org.huihoo.jfox.soaf.schema.config.ConfigurationEntry) _configurationEntryList
|
| 78 |
.elementAt(index); |
|
| 79 |
} |
|
| 80 |
|
|
| 81 |
/**
|
|
| 82 |
* Method getConfigurationEntry
|
|
| 83 |
*/
|
|
| 84 | 7 |
public org.huihoo.jfox.soaf.schema.config.ConfigurationEntry[] getConfigurationEntry() {
|
| 85 | 7 |
int size = _configurationEntryList.size();
|
| 86 | 7 |
org.huihoo.jfox.soaf.schema.config.ConfigurationEntry[] mArray = new org.huihoo.jfox.soaf.schema.config.ConfigurationEntry[size];
|
| 87 | 7 |
for (int index = 0; index < size; index++) { |
| 88 | 28 |
mArray[index] = (org.huihoo.jfox.soaf.schema.config.ConfigurationEntry) _configurationEntryList |
| 89 |
.elementAt(index); |
|
| 90 |
} |
|
| 91 | 7 |
return mArray;
|
| 92 |
} |
|
| 93 |
|
|
| 94 |
/**
|
|
| 95 |
* Method getConfigurationEntryCount
|
|
| 96 |
*/
|
|
| 97 | 0 |
public int getConfigurationEntryCount() { |
| 98 | 0 |
return _configurationEntryList.size();
|
| 99 |
} |
|
| 100 |
|
|
| 101 |
/**
|
|
| 102 |
* Method isValid
|
|
| 103 |
*/
|
|
| 104 | 0 |
public boolean isValid() { |
| 105 | 0 |
try {
|
| 106 | 0 |
validate(); |
| 107 |
} catch (org.exolab.castor.xml.ValidationException vex) {
|
|
| 108 | 0 |
return false; |
| 109 |
} |
|
| 110 | 0 |
return true; |
| 111 |
} |
|
| 112 |
|
|
| 113 |
/**
|
|
| 114 |
* Method marshal
|
|
| 115 |
*
|
|
| 116 |
* @param out
|
|
| 117 |
*/
|
|
| 118 | 0 |
public void marshal(java.io.Writer out) |
| 119 |
throws org.exolab.castor.xml.MarshalException,
|
|
| 120 |
org.exolab.castor.xml.ValidationException {
|
|
| 121 |
|
|
| 122 | 0 |
Marshaller.marshal(this, out);
|
| 123 |
} |
|
| 124 |
|
|
| 125 |
/**
|
|
| 126 |
* Method marshal
|
|
| 127 |
*
|
|
| 128 |
* @param handler
|
|
| 129 |
*/
|
|
| 130 | 0 |
public void marshal(org.xml.sax.ContentHandler handler) |
| 131 |
throws java.io.IOException, org.exolab.castor.xml.MarshalException,
|
|
| 132 |
org.exolab.castor.xml.ValidationException {
|
|
| 133 |
|
|
| 134 | 0 |
Marshaller.marshal(this, handler);
|
| 135 |
} |
|
| 136 |
|
|
| 137 |
/**
|
|
| 138 |
* Method removeAllConfigurationEntry
|
|
| 139 |
*/
|
|
| 140 | 0 |
public void removeAllConfigurationEntry() { |
| 141 | 0 |
_configurationEntryList.removeAllElements(); |
| 142 |
} |
|
| 143 |
|
|
| 144 |
/**
|
|
| 145 |
* Method removeConfigurationEntry
|
|
| 146 |
*
|
|
| 147 |
* @param index
|
|
| 148 |
*/
|
|
| 149 | 0 |
public org.huihoo.jfox.soaf.schema.config.ConfigurationEntry removeConfigurationEntry(
|
| 150 |
int index) {
|
|
| 151 | 0 |
java.lang.Object obj = _configurationEntryList.elementAt(index); |
| 152 | 0 |
_configurationEntryList.removeElementAt(index); |
| 153 | 0 |
return (org.huihoo.jfox.soaf.schema.config.ConfigurationEntry) obj;
|
| 154 |
} |
|
| 155 |
|
|
| 156 |
/**
|
|
| 157 |
* Method setConfigurationEntry
|
|
| 158 |
*
|
|
| 159 |
* @param index
|
|
| 160 |
* @param vConfigurationEntry
|
|
| 161 |
*/
|
|
| 162 | 0 |
public void setConfigurationEntry( |
| 163 |
int index,
|
|
| 164 |
org.huihoo.jfox.soaf.schema.config.ConfigurationEntry vConfigurationEntry) |
|
| 165 |
throws java.lang.IndexOutOfBoundsException {
|
|
| 166 |
//-- check bounds for index
|
|
| 167 | 0 |
if ((index < 0) || (index > _configurationEntryList.size())) {
|
| 168 | 0 |
throw new IndexOutOfBoundsException(); |
| 169 |
} |
|
| 170 | 0 |
_configurationEntryList.setElementAt(vConfigurationEntry, index); |
| 171 |
} |
|
| 172 |
|
|
| 173 |
/**
|
|
| 174 |
* Method setConfigurationEntry
|
|
| 175 |
*
|
|
| 176 |
* @param configurationEntryArray
|
|
| 177 |
*/
|
|
| 178 | 0 |
public void setConfigurationEntry( |
| 179 |
org.huihoo.jfox.soaf.schema.config.ConfigurationEntry[] configurationEntryArray) {
|
|
| 180 |
//-- copy array
|
|
| 181 | 0 |
_configurationEntryList.removeAllElements(); |
| 182 | 0 |
for (int i = 0; i < configurationEntryArray.length; i++) { |
| 183 | 0 |
_configurationEntryList.addElement(configurationEntryArray[i]); |
| 184 |
} |
|
| 185 |
} |
|
| 186 |
|
|
| 187 |
/**
|
|
| 188 |
* Method unmarshal
|
|
| 189 |
*
|
|
| 190 |
* @param reader
|
|
| 191 |
*/
|
|
| 192 | 0 |
public static org.huihoo.jfox.soaf.schema.config.ServiceConfiguration unmarshal( |
| 193 |
java.io.Reader reader) |
|
| 194 |
throws org.exolab.castor.xml.MarshalException,
|
|
| 195 |
org.exolab.castor.xml.ValidationException {
|
|
| 196 | 0 |
return (org.huihoo.jfox.soaf.schema.config.ServiceConfiguration) Unmarshaller
|
| 197 |
.unmarshal( |
|
| 198 |
org.huihoo.jfox.soaf.schema.config.ServiceConfiguration.class,
|
|
| 199 |
reader); |
|
| 200 |
} |
|
| 201 |
|
|
| 202 |
/**
|
|
| 203 |
* Method validate
|
|
| 204 |
*/
|
|
| 205 | 0 |
public void validate() throws org.exolab.castor.xml.ValidationException { |
| 206 | 0 |
org.exolab.castor.xml.Validator validator = new org.exolab.castor.xml.Validator();
|
| 207 | 0 |
validator.validate(this);
|
| 208 |
} |
|
| 209 |
|
|
| 210 |
} |
|
||||||||||