本文整理汇总了Java中org.javarosa.core.model.instance.TreeElement.setDataType方法的典型用法代码示例。如果您正苦于以下问题:Java TreeElement.setDataType方法的具体用法?Java TreeElement.setDataType怎么用?Java TreeElement.setDataType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.javarosa.core.model.instance.TreeElement
的用法示例。
在下文中一共展示了TreeElement.setDataType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: attachBind
import org.javarosa.core.model.instance.TreeElement; //导入方法依赖的package包/类
private static void attachBind(TreeElement node, DataBinding bind) {
node.setDataType(bind.getDataType());
if (bind.relevancyCondition == null) {
node.setRelevant(bind.relevantAbsolute);
}
if (bind.requiredCondition == null) {
node.setRequired(bind.requiredAbsolute);
}
if (bind.readonlyCondition == null) {
node.setEnabled(!bind.readonlyAbsolute);
}
if (bind.constraint != null) {
node.setConstraint(new Constraint(bind.constraint, bind.constraintMessage));
}
node.setPreloadHandler(bind.getPreload());
node.setPreloadParams(bind.getPreloadParams());
node.setBindAttributes(bind.getAdditionalAttributes());
}
示例2: applyControlProperties
import org.javarosa.core.model.instance.TreeElement; //导入方法依赖的package包/类
private void applyControlProperties (FormInstance instance) {
for (int h = 0; h < 2; h++) {
List<TreeReference> selectRefs = (h == 0 ? selectOnes : selectMultis);
int type = (h == 0 ? Constants.DATATYPE_CHOICE : Constants.DATATYPE_CHOICE_LIST);
for (int i = 0; i < selectRefs.size(); i++) {
TreeReference ref = selectRefs.get(i);
List<TreeReference> nodes = new EvaluationContext(instance).expandReference(ref, true);
for (int j = 0; j < nodes.size(); j++) {
TreeElement node = instance.resolveReference(nodes.get(j));
if (node.getDataType() == Constants.DATATYPE_CHOICE || node.getDataType() == Constants.DATATYPE_CHOICE_LIST) {
//do nothing
} else if (node.getDataType() == Constants.DATATYPE_NULL || node.getDataType() == Constants.DATATYPE_TEXT) {
node.setDataType(type);
} else {
reporter.warning(XFormParserReporter.TYPE_INVALID_STRUCTURE,
"Select question " + ref.toString() + " appears to have data type that is incompatible with selection", null);
}
}
}
}
}
示例3: applyDataType
import org.javarosa.core.model.instance.TreeElement; //导入方法依赖的package包/类
public static void applyDataType (FormInstance dm, String path, TreeReference parent, int dataType) {
TreeReference ref = childRef(path, parent);
List<TreeReference> v = new EvaluationContext(dm).expandReference(ref);
for (int i = 0; i < v.size(); i++) {
TreeElement e = dm.resolveReference(v.get(i));
e.setDataType(dataType);
}
}