use of org.javarosa.core.util.externalizable.ExtWrapTagged 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.ExtWrapTagged 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");
}
}
use of org.javarosa.core.util.externalizable.ExtWrapTagged in project javarosa by opendatakit.
the class ItemsetBinding method writeExternal.
public void writeExternal(DataOutputStream out) throws IOException {
ExtUtil.write(out, new ExtWrapTagged(nodesetExpr));
ExtUtil.write(out, contextRef);
ExtUtil.write(out, new ExtWrapTagged(labelExpr));
ExtUtil.write(out, new ExtWrapNullable(valueExpr == null ? null : new ExtWrapTagged(valueExpr)));
ExtUtil.write(out, new ExtWrapNullable(copyExpr == null ? null : new ExtWrapTagged(copyExpr)));
ExtUtil.writeBool(out, labelIsItext);
ExtUtil.writeBool(out, copyMode);
}
use of org.javarosa.core.util.externalizable.ExtWrapTagged in project javarosa by opendatakit.
the class QuestionDef method readExternal.
@Override
public void readExternal(DataInputStream dis, PrototypeFactory pf) throws IOException, DeserializationException {
try {
setID(ExtUtil.readInt(dis));
binding = (IDataReference) ExtUtil.read(dis, new ExtWrapNullable(new ExtWrapTagged()), pf);
setAppearanceAttr((String) ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
setTextID((String) ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
setLabelInnerText((String) ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
setHelpText((String) ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
setHelpTextID((String) ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
setHelpInnerText((String) ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
setControlType(ExtUtil.readInt(dis));
additionalAttributes = ExtUtil.readAttributes(dis, null);
choices = (List<SelectChoice>) ExtUtil.nullIfEmpty((List<SelectChoice>) ExtUtil.read(dis, new ExtWrapList(SelectChoice.class), pf));
for (int i = 0; i < getNumChoices(); i++) {
choices.get(i).setIndex(i);
}
setDynamicChoices((ItemsetBinding) ExtUtil.read(dis, new ExtWrapNullable(ItemsetBinding.class)));
osmTags = (List<OSMTag>) ExtUtil.nullIfEmpty((List<OSMTag>) ExtUtil.read(dis, new ExtWrapList(OSMTag.class), pf));
} catch (OutOfMemoryError e) {
throw new DeserializationException("serialization format change caused misalignment and out-of-memory error");
}
}
use of org.javarosa.core.util.externalizable.ExtWrapTagged in project javarosa by opendatakit.
the class SubmissionProfile method readExternal.
@SuppressWarnings("unchecked")
public void readExternal(DataInputStream in, PrototypeFactory pf) throws IOException, DeserializationException {
ref = (IDataReference) ExtUtil.read(in, new ExtWrapTagged(IDataReference.class));
method = ExtUtil.nullIfEmpty(ExtUtil.readString(in));
action = ExtUtil.nullIfEmpty(ExtUtil.readString(in));
mediaType = ExtUtil.nullIfEmpty(ExtUtil.readString(in));
attributeMap = (HashMap<String, String>) ExtUtil.read(in, new ExtWrapMap(String.class, String.class));
}
Aggregations