当前位置: 首页>>代码示例>>Java>>正文


Java IAnswerData.getDisplayText方法代码示例

本文整理汇总了Java中org.javarosa.core.model.data.IAnswerData.getDisplayText方法的典型用法代码示例。如果您正苦于以下问题:Java IAnswerData.getDisplayText方法的具体用法?Java IAnswerData.getDisplayText怎么用?Java IAnswerData.getDisplayText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.javarosa.core.model.data.IAnswerData的用法示例。


在下文中一共展示了IAnswerData.getDisplayText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: unpackValue

import org.javarosa.core.model.data.IAnswerData; //导入方法依赖的package包/类
public static Object unpackValue (IAnswerData val) {
	if (val == null) {
		return "";
	} else if (val instanceof UncastData) {
		return val.getValue();
	} else if (val instanceof IntegerData) {
		return new Double(((Integer)val.getValue()).doubleValue());
	} else if (val instanceof LongData) {
		return new Double(((Long)val.getValue()).doubleValue());
	} else if (val instanceof DecimalData) {
		return val.getValue();
	} else if (val instanceof StringData) {
		return val.getValue();
	} else if (val instanceof SelectOneData) {
		return ((Selection)val.getValue()).getValue();
	} else if (val instanceof SelectMultiData) {
		return (new XFormAnswerDataSerializer()).serializeAnswerData(val);
	} else if (val instanceof DateData) {
		return val.getValue();
	} else if (val instanceof BooleanData) {
		return val.getValue();
	} else if (val instanceof GeoPointData) {
		// we have no access fns that interact with double[4] arrays (the getValue() data type)...
		return val.getDisplayText();
	} else if (val instanceof GeoShapeData) {
		// we have no access fns that interact with GeoShape objects (the getValue() data type)...
		return val.getDisplayText();
	} else if (val instanceof GeoTraceData) {
		// we have no access fns that interact with GeoTrace objects (the getValue() data type)...
		return val.getDisplayText();
	} else {
		System.out.println("warning: unrecognized data type in xpath expr: " + val.getClass().getName());
		return val.getValue(); //is this a good idea?
	}
}
 
开发者ID:medic,项目名称:javarosa,代码行数:36,代码来源:XPathPathExpr.java

示例2: saveProperty

import org.javarosa.core.model.data.IAnswerData; //导入方法依赖的package包/类
private void saveProperty (String propName, TreeElement node) {
	IAnswerData answer = node.getValue();
	String value = (answer == null ? null : answer.getDisplayText());
	if (propName != null && propName.length() > 0 && value != null && value.length() > 0)
		PropertyManager._().setProperty(propName, value);
}
 
开发者ID:medic,项目名称:javarosa,代码行数:7,代码来源:QuestionPreloader.java


注:本文中的org.javarosa.core.model.data.IAnswerData.getDisplayText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。