Search in sources :

Example 11 with ExtWrapList

use of org.javarosa.core.util.externalizable.ExtWrapList in project javarosa by opendatakit.

the class Localizer method writeExternal.

/**
 * Writes the object to a stream.
 */
@Override
public void writeExternal(DataOutputStream dos) throws IOException {
    ExtUtil.writeBool(dos, fallbackDefaultLocale);
    ExtUtil.writeBool(dos, fallbackDefaultForm);
    ExtUtil.write(dos, new ExtWrapMap(localeResources, new ExtWrapListPoly()));
    ExtUtil.write(dos, new ExtWrapList(locales));
    ExtUtil.write(dos, new ExtWrapNullable(defaultLocale));
    ExtUtil.write(dos, new ExtWrapNullable(currentLocale));
}
Also used : ExtWrapListPoly(org.javarosa.core.util.externalizable.ExtWrapListPoly) ExtWrapMap(org.javarosa.core.util.externalizable.ExtWrapMap) ExtWrapList(org.javarosa.core.util.externalizable.ExtWrapList) ExtWrapNullable(org.javarosa.core.util.externalizable.ExtWrapNullable)

Example 12 with ExtWrapList

use of org.javarosa.core.util.externalizable.ExtWrapList in project javarosa by opendatakit.

the class Localizer method readExternal.

/* === (DE)SERIALIZATION === */
/**
 * Reads the object from a stream.
 */
@Override
public void readExternal(DataInputStream dis, PrototypeFactory pf) throws IOException, DeserializationException {
    fallbackDefaultLocale = ExtUtil.readBool(dis);
    fallbackDefaultForm = ExtUtil.readBool(dis);
    localeResources = (OrderedMap<String, List<LocaleDataSource>>) ExtUtil.read(dis, new ExtWrapMap(String.class, new ExtWrapListPoly(), ExtWrapMap.TYPE_ORDERED), pf);
    locales = (List<String>) ExtUtil.read(dis, new ExtWrapList(String.class));
    setDefaultLocale((String) ExtUtil.read(dis, new ExtWrapNullable(String.class), pf));
    String currentLocale = (String) ExtUtil.read(dis, new ExtWrapNullable(String.class), pf);
    if (currentLocale != null) {
        setLocale(currentLocale);
    }
}
Also used : ExtWrapListPoly(org.javarosa.core.util.externalizable.ExtWrapListPoly) ExtWrapMap(org.javarosa.core.util.externalizable.ExtWrapMap) ArrayList(java.util.ArrayList) ExtWrapList(org.javarosa.core.util.externalizable.ExtWrapList) List(java.util.List) ExtWrapList(org.javarosa.core.util.externalizable.ExtWrapList) ExtWrapNullable(org.javarosa.core.util.externalizable.ExtWrapNullable)

Aggregations

ExtWrapList (org.javarosa.core.util.externalizable.ExtWrapList)12 ExtWrapNullable (org.javarosa.core.util.externalizable.ExtWrapNullable)7 ExtWrapTagged (org.javarosa.core.util.externalizable.ExtWrapTagged)7 ArrayList (java.util.ArrayList)5 ExtWrapListPoly (org.javarosa.core.util.externalizable.ExtWrapListPoly)5 ExtWrapMap (org.javarosa.core.util.externalizable.ExtWrapMap)5 List (java.util.List)4 Condition (org.javarosa.core.model.condition.Condition)2 Recalculate (org.javarosa.core.model.condition.Recalculate)2 TreeReference (org.javarosa.core.model.instance.TreeReference)2 Date (java.util.Date)1 HashMap (java.util.HashMap)1 IConditionExpr (org.javarosa.core.model.condition.IConditionExpr)1 DataInstance (org.javarosa.core.model.instance.DataInstance)1 OSMTag (org.javarosa.core.model.osm.OSMTag)1 Localizer (org.javarosa.core.services.locale.Localizer)1 OrderedMap (org.javarosa.core.util.OrderedMap)1 DeserializationException (org.javarosa.core.util.externalizable.DeserializationException)1 ExtWrapBase (org.javarosa.core.util.externalizable.ExtWrapBase)1 ExtWrapMapPoly (org.javarosa.core.util.externalizable.ExtWrapMapPoly)1