Search in sources :

Example 6 with BooleanAttribute

use of org.openforis.idm.model.BooleanAttribute in project collect by openforis.

the class ModelLocationPath method computeValue.

@Override
public Object computeValue(EvalContext context) {
    Object value = super.computeValue(context);
    if (value instanceof DynamicPropertyPointer) {
        NodePointer pointer = ((DynamicPropertyPointer) value).getValuePointer();
        Object object = pointer.getNode();
        if (object instanceof BooleanAttribute) {
            return pointer.getValue();
        }
    }
    return value;
}
Also used : BooleanAttribute(org.openforis.idm.model.BooleanAttribute) DynamicPropertyPointer(org.apache.commons.jxpath.ri.model.dynamic.DynamicPropertyPointer) NodePointer(org.apache.commons.jxpath.ri.model.NodePointer)

Aggregations

BooleanAttribute (org.openforis.idm.model.BooleanAttribute)6 Test (org.junit.Test)4 NodePointer (org.apache.commons.jxpath.ri.model.NodePointer)1 DynamicPropertyPointer (org.apache.commons.jxpath.ri.model.dynamic.DynamicPropertyPointer)1 BooleanAttributeDefinition (org.openforis.idm.metamodel.BooleanAttributeDefinition)1 BooleanValue (org.openforis.idm.model.BooleanValue)1 Value (org.openforis.idm.model.Value)1