*
* @generated modifiable
*/
public Object parse(ElementInstance instance, Node node, Object value)
throws Exception {
PropertyType property = wfsfactory.createPropertyType();
//<xsd:element name="Name" type="xsd:string">
String name = (String) node.getChildValue("Name");
//turn into qname
QName qName = (QName) new XSQNameBinding(namespaceContext).parse(null, name);
property.setName(qName);
//<xsd:element minOccurs="0" name="Value">
if (node.hasChild("Value")) {
Object object = node.getChildValue("Value");
//check for a map
if (object instanceof Map) {
Map map = (Map) object;
//this means a complex element parsed by xs:AnyType binding
// try to pull out some text
if (!map.isEmpty()) {
//first check for some text
if (map.containsKey(null)) {
property.setValue(map.get(null));
} else {
//perhaps some other value
property.setValue(map.values().iterator().next());
}
}
} else {
property.setValue(object);
}
}
return property;
}