*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value)
throws Exception {
QueryType query = wfsfactory.createQueryType();
//<xsd:choice maxOccurs="unbounded" minOccurs="0">
//<xsd:element ref="wfs:PropertyName">
if (node.hasChild("PropertyName")) {
//HACK, stripping of namespace prefix
for (Iterator p = node.getChildValues("PropertyName").iterator(); p.hasNext();) {
Object property = p.next();
String propertyName;
if(property instanceof String)
propertyName = (String) property;
else
propertyName = (String) ((PropertyName) property).getPropertyName();
if (propertyName.indexOf(':') != -1) {
propertyName = propertyName.substring(propertyName.indexOf(':') + 1);
}
query.getPropertyName().add(propertyName);
}
}
//<xsd:element ref="ogc:Function">
if (node.hasChild("Function")) {
query.getFunction().add(node.getChildValues("Function"));
}
//</xsd:choice>
//<xsd:element maxOccurs="1" minOccurs="0" ref="ogc:Filter">
if (node.hasChild(Filter.class)) {
query.setFilter((Filter) node.getChildValue(Filter.class));
}
//<xsd:element maxOccurs="1" minOccurs="0" ref="ogc:SortBy">
if (node.hasChild(SortBy[].class)) {
SortBy[] sortBy = (SortBy[]) node.getChildValue(SortBy[].class);
for (int i = 0; i < sortBy.length; i++)
query.getSortBy().add(sortBy[i]);
}
//<xsd:attribute name="handle" type="xsd:string" use="optional">
if (node.hasAttribute("handle")) {
query.setHandle((String) node.getAttributeValue("handle"));
}
//<xsd:attribute name="typeName" type="wfs:TypeNameListType" use="required">
query.setTypeName((List) node.getAttributeValue("typeName"));
//<xsd:attribute name="featureVersion" type="xsd:string" use="optional">
if (node.hasAttribute("featureVersion")) {
query.setFeatureVersion((String) node.getAttributeValue("featureVersion"));
}
//<xsd:attribute name="srsName" type="xsd:anyURI" use="optional">
if (node.hasAttribute("srsName")) {
query.setSrsName((URI) node.getAttributeValue("srsName"));
}
if ( node.hasChild( "XlinkPropertyName" ) ) {
query.getXlinkPropertyName().addAll( node.getChildValues( "XlinkPropertyName" ));
}
return query;
}