// sv:node element
// node name (value of sv:name attribute)
String svName = getAttribute(atts, NameConstants.SV_NAME);
if (svName == null) {
throw new SAXException(new InvalidSerializedDataException(
"missing mandatory sv:name attribute of element sv:node"));
}
if (!stack.isEmpty()) {
// process current node first
ImportState current = stack.peek();
// need to start current node
if (!current.started) {
processNode(current, true, false);
current.started = true;
}
}
// push new ImportState instance onto the stack
ImportState state = new ImportState();
try {
state.nodeName = resolver.getQName(svName);
} catch (NameException e) {
throw new SAXException(new InvalidSerializedDataException("illegal node name: " + name, e));
} catch (NamespaceException e) {
throw new SAXException(new InvalidSerializedDataException("illegal node name: " + name, e));
}
stack.push(state);
} else if (name.equals(NameConstants.SV_PROPERTY)) {
// sv:property element
// reset temp fields
currentPropValues.clear();
// property name (value of sv:name attribute)
String svName = getAttribute(atts, NameConstants.SV_NAME);
if (name == null) {
throw new SAXException(new InvalidSerializedDataException(
"missing mandatory sv:name attribute of element sv:property"));
}
try {
currentPropName = resolver.getQName(svName);
} catch (NameException e) {
throw new SAXException(new InvalidSerializedDataException("illegal property name: " + name, e));
} catch (NamespaceException e) {
throw new SAXException(new InvalidSerializedDataException("illegal property name: " + name, e));
}
// property type (sv:type attribute)
String type = getAttribute(atts, NameConstants.SV_TYPE);
if (type == null) {
throw new SAXException(new InvalidSerializedDataException(
"missing mandatory sv:type attribute of element sv:property"));
}
try {
currentPropType = PropertyType.valueFromName(type);
} catch (IllegalArgumentException e) {
throw new SAXException(new InvalidSerializedDataException(
"Unknown property type: " + type, e));
}
} else if (name.equals(NameConstants.SV_VALUE)) {
// sv:value element
currentPropValue = new BufferedStringValue(resolver, valueFactory);
String xsiType = atts.getValue("xsi:type");
currentPropValue.setBase64("xs:base64Binary".equals(xsiType));
} else {
throw new SAXException(new InvalidSerializedDataException(
"Unexpected element in system view xml document: " + name));
}
}