use of org.javarosa.xform.util.XFormAnswerDataSerializer in project javarosa by opendatakit.
the class SMSSerializingVisitor method serializeInstance.
/*
* (non-Javadoc)
* @see org.javarosa.core.model.utils.IInstanceSerializingVisitor#serializeInstance(org.javarosa.core.model.instance.FormInstance, org.javarosa.core.model.IDataReference)
*/
public byte[] serializeInstance(FormInstance model, IDataReference ref) throws IOException {
init();
rootRef = FormInstance.unpackReference(ref);
if (this.serializer == null) {
this.setAnswerDataSerializer(new XFormAnswerDataSerializer());
}
model.accept(this);
if (theSmsStr != null) {
// Encode in UTF-16 by default, since it's the default for complex messages
return theSmsStr.getBytes("UTF-16BE");
} else {
return null;
}
}
use of org.javarosa.xform.util.XFormAnswerDataSerializer in project javarosa by opendatakit.
the class FormDef method setValue.
public void setValue(IAnswerData data, TreeReference ref, TreeElement node, boolean midSurvey) {
IAnswerData oldValue = node.getValue();
IAnswerDataSerializer answerDataSerializer = new XFormAnswerDataSerializer();
if (midSurvey && dagImpl.shouldTrustPreviouslyCommittedAnswer() && objectEquals(answerDataSerializer.serializeAnswerData(oldValue), answerDataSerializer.serializeAnswerData(data))) {
return;
}
setAnswer(data, node);
Collection<QuickTriggerable> qts = triggerTriggerables(ref, midSurvey);
dagImpl.publishSummary("New value", ref, qts);
// TODO: pre-populate fix-count repeats here?
}
Aggregations