Search in sources :

Example 86 with TreeElement

use of org.javarosa.core.model.instance.TreeElement in project javarosa by opendatakit.

the class ExtUtil method readAttributes.

public static List<TreeElement> readAttributes(DataInputStream in, TreeElement parent) throws IOException {
    int size = (int) ExtUtil.readNumeric(in);
    List<TreeElement> attributes = new ArrayList<TreeElement>(size);
    for (int i = 0; i < size; ++i) {
        String namespace = ExtUtil.readString(in);
        String name = ExtUtil.readString(in);
        String value = ExtUtil.readString(in);
        TreeElement attr = TreeElement.constructAttributeElement(namespace, name, value);
        attr.setParent(parent);
        attributes.add(attr);
    }
    return attributes;
}
Also used : ArrayList(java.util.ArrayList) TreeElement(org.javarosa.core.model.instance.TreeElement)

Aggregations

TreeElement (org.javarosa.core.model.instance.TreeElement)86 AbstractTreeElement (org.javarosa.core.model.instance.AbstractTreeElement)33 TreeReference (org.javarosa.core.model.instance.TreeReference)28 FormInstance (org.javarosa.core.model.instance.FormInstance)16 ArrayList (java.util.ArrayList)15 Constraint (org.javarosa.core.model.condition.Constraint)11 Test (org.junit.Test)10 Element (org.kxml2.kdom.Element)9 EvaluationContext (org.javarosa.core.model.condition.EvaluationContext)8 FormDef (org.javarosa.core.model.FormDef)7 InstanceInitializationFactory (org.javarosa.core.model.instance.InstanceInitializationFactory)7 IOException (java.io.IOException)6 IFormElement (org.javarosa.core.model.IFormElement)6 StringData (org.javarosa.core.model.data.StringData)6 HashMap (java.util.HashMap)5 IAnswerData (org.javarosa.core.model.data.IAnswerData)4 File (java.io.File)3 GroupDef (org.javarosa.core.model.GroupDef)3 IDataReference (org.javarosa.core.model.IDataReference)3 QuestionDef (org.javarosa.core.model.QuestionDef)3