use of org.javarosa.core.util.externalizable.ExtWrapListPoly in project javarosa by opendatakit.
the class XPathFilterExpr method writeExternal.
public void writeExternal(DataOutputStream out) throws IOException {
List<XPathExpression> v = Arrays.asList(predicates);
ExtUtil.write(out, new ExtWrapTagged(x));
ExtUtil.write(out, new ExtWrapListPoly(v));
}
use of org.javarosa.core.util.externalizable.ExtWrapListPoly in project javarosa by opendatakit.
the class XPathFilterExpr method readExternal.
public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException {
x = (XPathExpression) ExtUtil.read(in, new ExtWrapTagged(), pf);
List<Object> v = (List<Object>) ExtUtil.read(in, new ExtWrapListPoly(), pf);
predicates = new XPathExpression[v.size()];
for (int i = 0; i < predicates.length; i++) predicates[i] = (XPathExpression) v.get(i);
}
use of org.javarosa.core.util.externalizable.ExtWrapListPoly in project javarosa by opendatakit.
the class FormDef method writeExternal.
/**
* Writes the form definition object to the supplied stream.
*
* @param dos - the stream to write to.
* @throws IOException
*/
@Override
public void writeExternal(DataOutputStream dos) throws IOException {
ExtUtil.writeNumeric(dos, getID());
ExtUtil.writeString(dos, ExtUtil.emptyIfNull(getName()));
ExtUtil.write(dos, new ExtWrapNullable(getTitle()));
ExtUtil.write(dos, new ExtWrapListPoly(getChildren()));
ExtUtil.write(dos, getMainInstance());
ExtUtil.write(dos, new ExtWrapNullable(localizer));
List<Condition> conditions = dagImpl.getConditions();
List<Recalculate> recalcs = dagImpl.getRecalculates();
ExtUtil.write(dos, new ExtWrapList(conditions));
ExtUtil.write(dos, new ExtWrapList(recalcs));
ExtUtil.write(dos, new ExtWrapListPoly(outputFragments));
ExtUtil.write(dos, new ExtWrapMap(submissionProfiles));
// for support of multi-instance forms
ExtUtil.write(dos, new ExtWrapMap(formInstances, new ExtWrapTagged()));
ExtUtil.write(dos, new ExtWrapMap(eventListeners, new ExtWrapListPoly()));
ExtUtil.write(dos, new ExtWrapListPoly(extensions));
}
use of org.javarosa.core.util.externalizable.ExtWrapListPoly in project javarosa by opendatakit.
the class GroupDef method writeExternal.
/**
* Write the group definition object to the supplied stream.
*/
public void writeExternal(DataOutputStream dos) throws IOException {
ExtUtil.writeNumeric(dos, getID());
ExtUtil.write(dos, new ExtWrapNullable(getAppearanceAttr()));
ExtUtil.write(dos, new ExtWrapTagged(getBind()));
ExtUtil.write(dos, new ExtWrapNullable(getTextID()));
ExtUtil.write(dos, new ExtWrapNullable(getLabelInnerText()));
ExtUtil.writeBool(dos, getRepeat());
ExtUtil.write(dos, new ExtWrapListPoly(getChildren()));
ExtUtil.writeBool(dos, noAddRemove);
ExtUtil.write(dos, new ExtWrapNullable(count != null ? new ExtWrapTagged(count) : null));
ExtUtil.writeString(dos, ExtUtil.emptyIfNull(chooseCaption));
ExtUtil.writeString(dos, ExtUtil.emptyIfNull(addCaption));
ExtUtil.writeString(dos, ExtUtil.emptyIfNull(delCaption));
ExtUtil.writeString(dos, ExtUtil.emptyIfNull(doneCaption));
ExtUtil.writeString(dos, ExtUtil.emptyIfNull(addEmptyCaption));
ExtUtil.writeString(dos, ExtUtil.emptyIfNull(doneEmptyCaption));
ExtUtil.writeString(dos, ExtUtil.emptyIfNull(entryHeader));
ExtUtil.writeString(dos, ExtUtil.emptyIfNull(delHeader));
ExtUtil.writeString(dos, ExtUtil.emptyIfNull(mainHeader));
ExtUtil.writeAttributes(dos, additionalAttributes);
}
use of org.javarosa.core.util.externalizable.ExtWrapListPoly in project javarosa by opendatakit.
the class GroupDef method readExternal.
/**
* Reads a group definition object from the supplied stream.
*/
public void readExternal(DataInputStream dis, PrototypeFactory pf) throws IOException, DeserializationException {
try {
setID(ExtUtil.readInt(dis));
setAppearanceAttr((String) ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
setBind((IDataReference) ExtUtil.read(dis, new ExtWrapTagged(), pf));
setTextID((String) ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
setLabelInnerText((String) ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
setRepeat(ExtUtil.readBool(dis));
setChildren((List<IFormElement>) ExtUtil.read(dis, new ExtWrapListPoly(), pf));
noAddRemove = ExtUtil.readBool(dis);
count = (IDataReference) ExtUtil.read(dis, new ExtWrapNullable(new ExtWrapTagged()), pf);
chooseCaption = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
addCaption = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
delCaption = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
doneCaption = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
addEmptyCaption = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
doneEmptyCaption = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
entryHeader = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
delHeader = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
mainHeader = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
additionalAttributes = ExtUtil.readAttributes(dis, null);
} catch (OutOfMemoryError e) {
throw new DeserializationException("serialization format change caused misalignment and out-of-memory error");
}
}
Aggregations