use of eu.esdihumboldt.hale.common.align.model.condition.impl.BindingCondition in project hale by halestudio.
the class PropertyParameter method createConditions.
private static List<PropertyCondition> createConditions(IConfigurationElement conf) {
List<PropertyCondition> result = new ArrayList<PropertyCondition>();
IConfigurationElement[] children = conf.getChildren();
if (children != null) {
for (IConfigurationElement child : children) {
String name = child.getName();
if (name.equals("propertyCondition")) {
try {
PropertyCondition condition = (PropertyCondition) child.createExecutableExtension("class");
result.add(condition);
} catch (CoreException e) {
log.error("Error creating property condition from extension", e);
}
} else if (name.equals("bindingCondition")) {
BindingCondition bc = createBindingCondition(child);
if (bc != null) {
result.add(new PropertyTypeCondition(bc));
}
} else if (name.equals("geometryCondition")) {
GeometryCondition gc = createGeometryCondition(child);
if (gc != null) {
result.add(new PropertyTypeCondition(gc));
}
} else if (name.equals("geometryOrParentCondition")) {
GeometryCondition gc = createGeometryCondition(child);
if (gc != null) {
result.add(new PropertyOrChildrenTypeCondition(gc));
}
} else if (name.equals("valueCondition")) {
String attr = child.getAttribute("allowAugmented");
boolean allowAugmented;
if (attr == null || attr.isEmpty()) {
// default value
allowAugmented = true;
} else {
allowAugmented = Boolean.parseBoolean(attr);
}
if (allowAugmented) {
result.add(VALUE_CONDITION);
} else {
result.add(VALUE_CONDITION_STRICT);
}
} else {
// ignore
log.warn("Unrecognized property condition");
}
}
}
return result;
}
Aggregations