use of org.javarosa.core.util.externalizable.ExtWrapList in project javarosa by opendatakit.
the class OSMTag method readExternal.
public void readExternal(DataInputStream dis, PrototypeFactory pf) throws IOException, DeserializationException {
key = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
label = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
items = (List<OSMTagItem>) ExtUtil.nullIfEmpty((List<OSMTagItem>) ExtUtil.read(dis, new ExtWrapList(OSMTagItem.class), pf));
}
use of org.javarosa.core.util.externalizable.ExtWrapList in project javarosa by opendatakit.
the class OSMTag method writeExternal.
public void writeExternal(DataOutputStream dos) throws IOException {
ExtUtil.writeString(dos, ExtUtil.emptyIfNull(key));
ExtUtil.writeString(dos, ExtUtil.emptyIfNull(label));
ExtUtil.write(dos, new ExtWrapList(ExtUtil.emptyIfNull(items)));
}
use of org.javarosa.core.util.externalizable.ExtWrapList in project javarosa by opendatakit.
the class FormDef method readExternal.
/**
* Reads the form definition object from the supplied stream.
* <p/>
* Requires that the instance has been set to a prototype of the instance
* that should be used for deserialization.
*
* @param dis - the stream to read from.
* @throws IOException
* @throws InstantiationException
* @throws IllegalAccessException
*/
@Override
public void readExternal(DataInputStream dis, PrototypeFactory pf) throws IOException, DeserializationException {
setID(ExtUtil.readInt(dis));
setName(ExtUtil.nullIfEmpty(ExtUtil.readString(dis)));
setTitle((String) ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
setChildren((List<IFormElement>) ExtUtil.read(dis, new ExtWrapListPoly(), pf));
setInstance((FormInstance) ExtUtil.read(dis, FormInstance.class, pf));
setLocalizer((Localizer) ExtUtil.read(dis, new ExtWrapNullable(Localizer.class), pf));
List<Condition> vcond = (List<Condition>) ExtUtil.read(dis, new ExtWrapList(Condition.class), pf);
for (Condition condition : vcond) {
addTriggerable(condition);
}
List<Recalculate> vcalc = (List<Recalculate>) ExtUtil.read(dis, new ExtWrapList(Recalculate.class), pf);
for (Recalculate recalculate : vcalc) {
addTriggerable(recalculate);
}
finalizeTriggerables();
outputFragments = (List<IConditionExpr>) ExtUtil.read(dis, new ExtWrapListPoly(), pf);
submissionProfiles = (HashMap<String, SubmissionProfile>) ExtUtil.read(dis, new ExtWrapMap(String.class, SubmissionProfile.class));
formInstances = (HashMap<String, DataInstance>) ExtUtil.read(dis, new ExtWrapMap(String.class, new ExtWrapTagged()), pf);
eventListeners = (HashMap<String, List<Action>>) ExtUtil.read(dis, new ExtWrapMap(String.class, new ExtWrapListPoly()), pf);
extensions = (List<XFormExtension>) ExtUtil.read(dis, new ExtWrapListPoly(), pf);
resetEvaluationContext();
}
use of org.javarosa.core.util.externalizable.ExtWrapList in project javarosa by opendatakit.
the class QuestionDef method writeExternal.
@Override
public void writeExternal(DataOutputStream dos) throws IOException {
ExtUtil.writeNumeric(dos, getID());
ExtUtil.write(dos, new ExtWrapNullable(binding == null ? null : new ExtWrapTagged(binding)));
ExtUtil.write(dos, new ExtWrapNullable(getAppearanceAttr()));
ExtUtil.write(dos, new ExtWrapNullable(getTextID()));
ExtUtil.write(dos, new ExtWrapNullable(getLabelInnerText()));
ExtUtil.write(dos, new ExtWrapNullable(getHelpText()));
ExtUtil.write(dos, new ExtWrapNullable(getHelpTextID()));
ExtUtil.write(dos, new ExtWrapNullable(getHelpInnerText()));
ExtUtil.writeNumeric(dos, getControlType());
ExtUtil.writeAttributes(dos, additionalAttributes);
ExtUtil.write(dos, new ExtWrapList(ExtUtil.emptyIfNull(choices)));
ExtUtil.write(dos, new ExtWrapNullable(dynamicChoices));
ExtUtil.write(dos, new ExtWrapList(ExtUtil.emptyIfNull(osmTags)));
}
use of org.javarosa.core.util.externalizable.ExtWrapList in project javarosa by opendatakit.
the class XPathPathExpr method writeExternal.
public void writeExternal(DataOutputStream out) throws IOException {
ExtUtil.writeNumeric(out, init_context);
if (init_context == INIT_CONTEXT_EXPR) {
ExtUtil.write(out, filtExpr);
}
List<XPathStep> v = Arrays.asList(steps);
ExtUtil.write(out, new ExtWrapList(v));
}
Aggregations