use of com.dexels.navajo.document.stream.api.Prop in project navajo by Dexels.
the class StreamSaxHandler method endElement.
@Override
public final int endElement(String tag) {
Map<String, String> attributes = attributeStack.pop();
if (tag.equals("tml")) {
handler.navajoDone(methods);
return 1;
}
if (tag.equals("message")) {
List<Prop> currentProperties = currentPropertiesStack.pop();
String type = attributes.get("type");
String name = attributes.get("name");
if (Message.MSG_TYPE_DEFINITION.equals(type)) {
handler.messageDefinition(attributes, currentProperties);
} else if (Message.MSG_TYPE_ARRAY.equals(type)) {
handler.arrayDone(name);
} else {
if (Message.MSG_TYPE_ARRAY_ELEMENT.equals(type)) {
handler.arrayElement(currentProperties);
} else {
handler.messageDone(attributes, currentProperties);
}
}
currentProperties.clear();
return 1;
}
if (tag.equals("property")) {
Prop currentProperty;
String val = attributes.get("value");
if ("selection".equals(attributes.get("type"))) {
currentProperty = Prop.create(attributes, currentSelections);
} else if (val != null) {
Hashtable<String, String> h2 = new Hashtable<String, String>(attributes);
// BaseNode.XMLUnescape(val);
val = StringEscapeUtils.unescapeXml(val);
h2.put("value", val);
currentProperty = Prop.create(h2, currentSelections);
} else if ("binary".equals(attributes.get("type"))) {
handler.binaryDone();
return 1;
} else {
currentProperty = Prop.create(attributes, currentSelections);
}
currentPropertiesStack.peek().add(currentProperty);
// currentProperties.add(currentProperty);
currentProperty = null;
currentSelections.clear();
return 0;
}
if (tag.equals("header")) {
parseHeader(attributes);
return 1;
}
if (tag.equals("option")) {
}
if (tag.equals("method")) {
}
if (tag.equals("transaction")) {
}
if (tag.equals("callback")) {
}
return 0;
}
Aggregations