//raw list of attributes for each feature type requested
List byFeatureTypes = readFlat(rawAtts, "|");
int nLayers = layers.length;
if (byFeatureTypes.size() != nLayers) {
throw new WmsException(byFeatureTypes.size()
+ " lists of attributes specified, expected " + layers.length,
getClass().getName() + "::parseAttributes()");
}
//fill byFeatureTypes with the split of its raw attributes requested
//separated by commas, and check for the validity of each att name
for (int i = 0; i < nLayers; i++) {
rawAtts = (String) byFeatureTypes.get(i);
List atts = readFlat(rawAtts, ",");
byFeatureTypes.set(i, atts);
//FeatureType schema = layers[i].getSchema();
try {
FeatureType schema = layers[i].getFeatureType();
//verify that propper attributes has been requested
for (Iterator attIt = atts.iterator(); attIt.hasNext();) {
String attName = (String) attIt.next();
if (attName.length() > 0) {
LOGGER.finer("checking that " + attName + " is valid");
if ("#FID".equalsIgnoreCase(attName)
|| "#BOUNDS".equalsIgnoreCase(attName)) {
LOGGER.finer("special attribute name requested: "
+ attName);
continue;
}
if (schema.getAttributeType(attName) == null) {
throw new WmsException("Attribute '" + attName
+ "' requested for layer "
+ schema.getTypeName() + " does not exists");
}
} else {
LOGGER.finest(
"removing empty attribute name from request");
attIt.remove();
}
}
LOGGER.finest("attributes requested for "
+ schema.getTypeName() + " checked: " + rawAtts);
} catch (java.io.IOException e) {
throw new WmsException(e);
}
}
return byFeatureTypes;
}