if (validation && ((value == null) || (value.length != 4))) {
throw new SAXException(
"The WFS Capabilites document has the wrong number of children");
}
WFSCapabilities result = new WFSCapabilities();
for (int i = 0; i < 4 && i < value.length; i++) {
if (elements[0].getName().equals(value[i].getElement().getName())) {
// service
result.setService((Service) value[i].getValue());
} else {
if (elements[1].getName().equals(value[i].getElement()
.getName())) {
// capability
Object[] temp = (Object[]) value[i].getValue();
if (temp.length != 2) {
throw new SAXException(
"The WFS Capabilites document has an invalid capability child");
}
result.setVendorSpecificCapabilities((String) temp[0]);
OperationType[] tmp = (OperationType[]) temp[1];
if (tmp != null) {
result.setGetCapabilities(tmp[0]);
result.setDescribeFeatureType(tmp[1]);
result.setTransaction(tmp[2]);
result.setGetFeature(tmp[3]);
result.setGetFeatureWithLock(tmp[4]);
result.setLockFeature(tmp[5]);
}
} else {
if (elements[2].getName().equals(value[i].getElement()
.getName())) {
// FeatureTypeList
result.setFeatureTypes((List) value[i].getValue());
} else {
if (elements[3].getName().equals(value[i].getElement()
.getName())) {
// Filter_Capabilities
result.setFilterCapabilities((FilterCapabilities) value[i]
.getValue());
} else {
if(validation){
// error
throw new SAXException("The element "