Search in sources :

Example 1 with MultiPointerAnswerData

use of org.javarosa.core.model.data.MultiPointerAnswerData in project javarosa by opendatakit.

the class XFormAnswerDataSerializer method retrieveExternalDataPointer.

public IDataPointer[] retrieveExternalDataPointer(IAnswerData data) {
    for (IAnswerDataSerializer serializer : additionalSerializers) {
        Boolean contains = serializer.containsExternalData(data);
        if (contains != null) {
            return serializer.retrieveExternalDataPointer(data);
        }
    }
    if (data instanceof PointerAnswerData) {
        IDataPointer[] pointer = new IDataPointer[1];
        pointer[0] = (IDataPointer) ((PointerAnswerData) data).getValue();
        return pointer;
    } else if (data instanceof MultiPointerAnswerData) {
        return (IDataPointer[]) ((MultiPointerAnswerData) data).getValue();
    }
    // This shouldn't have been called.
    return null;
}
Also used : MultiPointerAnswerData(org.javarosa.core.model.data.MultiPointerAnswerData) PointerAnswerData(org.javarosa.core.model.data.PointerAnswerData) MultiPointerAnswerData(org.javarosa.core.model.data.MultiPointerAnswerData) IAnswerDataSerializer(org.javarosa.core.model.IAnswerDataSerializer) IDataPointer(org.javarosa.core.data.IDataPointer)

Aggregations

IDataPointer (org.javarosa.core.data.IDataPointer)1 IAnswerDataSerializer (org.javarosa.core.model.IAnswerDataSerializer)1 MultiPointerAnswerData (org.javarosa.core.model.data.MultiPointerAnswerData)1 PointerAnswerData (org.javarosa.core.model.data.PointerAnswerData)1