// sv:node element
// node name (value of sv:name attribute)
String svName = getAttribute(atts, NamespaceConstants.NAMESPACE_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 = new NameInfo(svName).getRepoQualifiedName();
} catch (RepositoryException e) {
throw new SAXException(new InvalidSerializedDataException("illegal node name: " + svName, e));
}
stack.push(state);
} else if (namespaceURI.equals(NamespaceConstants.NAMESPACE_SV) && "property".equals(localName)) {
// sv:property element
// reset temp fields
currentPropValues.clear();
// property name (value of sv:name attribute)
String svName = getAttribute(atts, NamespaceConstants.NAMESPACE_SV, "name");
if (svName == null) {
throw new SAXException(new InvalidSerializedDataException(
"missing mandatory sv:name attribute of element sv:property"));
}
try {
currentPropName = new NameInfo(svName);
} catch (RepositoryException e) {
throw new SAXException(new InvalidSerializedDataException("illegal property name: " + svName, e));
}
// property type (sv:type attribute)
String type = getAttribute(atts, NamespaceConstants.NAMESPACE_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));
}
// 'multi-value' hint (sv:multiple attribute)
String multiple = getAttribute(atts, NamespaceConstants.NAMESPACE_SV, "multiple");
if (multiple != null) {
currentPropMultipleStatus = PropInfo.MultipleStatus.MULTIPLE;
} else {
currentPropMultipleStatus = PropInfo.MultipleStatus.UNKNOWN;
}
} else if (namespaceURI.equals(NamespaceConstants.NAMESPACE_SV) && "value".equals(localName)) {
// sv:value element
currentPropValue = new BufferedStringValue(valueFactory, currentNamePathMapper());
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: {" + namespaceURI + '}' + localName));
}
}