本文整理汇总了Java中org.javarosa.core.model.instance.TreeElement.addChild方法的典型用法代码示例。如果您正苦于以下问题:Java TreeElement.addChild方法的具体用法?Java TreeElement.addChild怎么用?Java TreeElement.addChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.javarosa.core.model.instance.TreeElement
的用法示例。
在下文中一共展示了TreeElement.addChild方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mergeDataModel
import org.javarosa.core.model.instance.TreeElement; //导入方法依赖的package包/类
public static void mergeDataModel (FormInstance parent, FormInstance child, TreeReference parentRef) {
TreeElement parentNode = parent.resolveReference(parentRef);
//ugly
if (parentNode == null) {
parentRef = parent.addNode(parentRef);
parentNode = parent.resolveReference(parentRef);
}
TreeElement childNode = child.getRoot();
int mult = parentNode.getChildMultiplicity(childNode.getName());
childNode.setMult(mult);
parentNode.addChild(childNode);
}
示例2: testAddTreeChild
import org.javarosa.core.model.instance.TreeElement; //导入方法依赖的package包/类
public void testAddTreeChild() {
//TreeElement subTree = new TreeElement("subtree");
//TreeElement firstRootTree = new TreeElement("firstRoot");
//TreeElement secondRootTree = new TreeElement("secondRoot");
TreeElement subElement = new TreeElement("SubElement");
subElement.addChild(stringElement);
subElement.addChild(intElement);
//assertTrue("Group did not add valid subtree group as a child",subTree.addChild(subElement));
//assertTrue("Group does not properly contain subtree group as a child",subTree.contains(subElement));
//Looks like these are not valid anymore after the last round of changes.
}
示例3: createTestInstance
import org.javarosa.core.model.instance.TreeElement; //导入方法依赖的package包/类
public FormInstance createTestInstance() {
TreeElement data = new TreeElement("data");
data.addChild(new TreeElement("path"));
FormInstance instance = new FormInstance(data);
return instance;
}