if (validation && value.length < 2) {
throw new SAXException(
"Missing child element for FeatureTypeType");
}
FeatureSetDescription fsd = new FeatureSetDescription();
List llbb = new LinkedList();
for (int i = 0; i < value.length; i++) {
if (value[i].getElement() == null) {
throw new SAXException(
"Internal error -- a value object representing a child element was missing an element declaration");
}
if (elements[0].getName().equals(value[i].getElement().getName())) {
// Name
fsd.setName((String) value[i].getValue());
if(fsd.getName()!=null){
int j = fsd.getName().indexOf(":");
if(j>0){
// we have a ns prefix
String prefix = fsd.getName().substring(0,j);
}
}
} else {
if (elements[1].getName().equals(value[i].getElement()
.getName())) {
// Title
fsd.setTitle((String) value[i].getValue());
} else {
if (elements[2].getName().equals(value[i].getElement()
.getName())) {
// Abstract
String t = (String) value[i].getValue();
t = "NONE".equals(t) ? "" : t;
fsd.setAbstract(t);
} else {
if (elements[3].getName().equals(value[i].getElement()
.getName())) {
// Keywords
String t = (String) value[i].getValue();
t = (t == null) ? "" : t;
fsd.setKeywords(Arrays.asList(t.split(" ")));
} else {
if (elements[4].getName().equals(value[i].getElement()
.getName())) {
// SRS
fsd.setSRS((String) value[i].getValue());
} else {
if (elements[5].getName().equals(value[i].getElement()
.getName())) {
// Operations
fsd.setOperations(((Integer) value[i]
.getValue()).intValue());
} else {
if (elements[6].getName().equals(value[i].getElement()
.getName())) {
// LatLongBoundingBox
llbb.add(value[i].getValue());
} else {
if (elements[7].getName().equals(value[i].getElement()
.getName())) {
// MetadataURL
// mdurl.add((MetadataURL) value[i]
// .getValue());
} else {
// error
throw new SAXException(
"Unknown child element within a FeatureTypeType: "
+ ((value[i].getElement()
.getName() == null)
? "null"
: value[i].getElement()
.getName()));
}
}
}
}
}
}
}
}
}
if (llbb.size() > 0) {
Envelope e = (Envelope) llbb.get(0);
for (int i = 1; i < llbb.size(); i++)
e.expandToInclude((Envelope) llbb.get(i));
fsd.setLatLongBoundingBox(e);
}
if ((fsd.getName() == null) || (fsd.getSRS() == null)) {
throw new SAXException(
"Missing child element for FeatureTypeType");
}
return fsd;