use of org.javarosa.xform.parse.XFormParseException in project javarosa by opendatakit.
the class FormDef method getAbsRef.
// take a (possibly relative) reference, and make it absolute based on its parent
// moved from the parser to this class so it can be used more cleanly by ItemsetBinding
public static IDataReference getAbsRef(IDataReference ref, TreeReference parentRef) {
TreeReference tref;
if (!parentRef.isAbsolute()) {
throw new RuntimeException("XFormParser.getAbsRef: parentRef must be absolute");
}
if (ref != null) {
tref = (TreeReference) ref.getReference();
} else {
// only happens for <group>s with no binding
tref = TreeReference.selfRef();
}
tref = tref.parent(parentRef);
if (tref == null) {
throw new XFormParseException("Binding path [" + tref + "] not allowed with parent binding of [" + parentRef + "]");
}
return new XPathReference(tref);
}
Aggregations