use of eu.esdihumboldt.hale.common.instance.model.InstanceReference in project hale by halestudio.
the class InstanceValidationMessageDefinition method createMessage.
/**
* @see AbstractMessageDefinition#createMessage(Properties)
*/
@Override
protected InstanceValidationMessage createMessage(Properties props) {
// instance reference isn't valid anymore either way... simply use null
InstanceReference ref = null;
String typeName = props.getProperty(KEY_TYPE);
QName type = null;
if (typeName != null) {
type = QName.valueOf(typeName);
}
int pathCount = 0;
try {
pathCount = Integer.valueOf(props.getProperty(KEY_PATH_COUNT));
} catch (Exception e) {
// ignore
}
List<QName> path = new ArrayList<QName>(pathCount);
for (int i = 0; i < pathCount; i++) {
path.add(QName.valueOf(props.getProperty(KEY_PATH_PREFIX + i)));
}
String category = props.getProperty(KEY_CATEGORY);
String message = props.getProperty(KEY_MESSAGE);
return new DefaultInstanceValidationMessage(ref, type, path, category, message);
}
Aggregations