Search in sources :

Example 16 with InstanceReference

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);
}
Also used : InstanceReference(eu.esdihumboldt.hale.common.instance.model.InstanceReference) QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList)

Aggregations

InstanceReference (eu.esdihumboldt.hale.common.instance.model.InstanceReference)16 Instance (eu.esdihumboldt.hale.common.instance.model.Instance)8 InstanceService (eu.esdihumboldt.hale.ui.service.instance.InstanceService)5 FamilyInstance (eu.esdihumboldt.hale.common.instance.model.FamilyInstance)4 ResolvableInstanceReference (eu.esdihumboldt.hale.common.instance.model.ResolvableInstanceReference)4 HashSet (java.util.HashSet)4 DefaultInstanceSelection (eu.esdihumboldt.hale.ui.selection.impl.DefaultInstanceSelection)3 ArrayList (java.util.ArrayList)3 ISelection (org.eclipse.jface.viewers.ISelection)3 ArrayListMultimap (com.google.common.collect.ArrayListMultimap)2 ListMultimap (com.google.common.collect.ListMultimap)2 Multimap (com.google.common.collect.Multimap)2 BoundingBox (de.fhg.igd.geom.BoundingBox)2 TypeEntityDefinition (eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition)2 TransformationException (eu.esdihumboldt.hale.common.align.transformation.function.TransformationException)2 DataSet (eu.esdihumboldt.hale.common.instance.model.DataSet)2 IdentifiableInstanceReference (eu.esdihumboldt.hale.common.instance.model.IdentifiableInstanceReference)2 PseudoInstanceReference (eu.esdihumboldt.hale.common.instance.model.impl.PseudoInstanceReference)2 InstanceSelection (eu.esdihumboldt.hale.ui.selection.InstanceSelection)2 HashMap (java.util.HashMap)2