本文整理汇总了Java中org.javarosa.core.model.data.StringData类的典型用法代码示例。如果您正苦于以下问题:Java StringData类的具体用法?Java StringData怎么用?Java StringData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StringData类属于org.javarosa.core.model.data包,在下文中一共展示了StringData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: processImage
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
public IAnswerData processImage(Image image)
throws ImageProcessingException {
MonochromeBitmapSource source = new LCDUIImageMonochromeBitmapSource(
image);
Reader reader = new QRCodeReader();
Hashtable hints = new Hashtable();
// hints.put(DecodeHintType.TRY_HARDER, Boolean.TRUE);
try {
Result result = reader.decode(source, hints);
if ((result != null) && (result.getText() != null)) {
String scannedCode = result.getText();
return new StringData(scannedCode);
} else {
throw new ImageProcessingException("Barcode scanning failed");
}
} catch (ReaderException re) {
throw new ImageProcessingException("Barcode scanning failed");
}
}
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:21,代码来源:ZXingBarcodeProcessingService.java
示例2: classForDataType
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
/**
* map xforms data types to the Class that represents that data in a FormInstance
* @param dataType
* @return
*/
public static Class classForDataType (int dataType) {
switch (dataType) {
case Constants.DATATYPE_NULL: return StringData.class;
case Constants.DATATYPE_TEXT: return StringData.class;
case Constants.DATATYPE_INTEGER: return IntegerData.class;
case Constants.DATATYPE_LONG: return LongData.class;
case Constants.DATATYPE_DECIMAL: return DecimalData.class;
case Constants.DATATYPE_BOOLEAN: return BooleanData.class;
case Constants.DATATYPE_DATE: return DateData.class;
case Constants.DATATYPE_TIME: return TimeData.class;
case Constants.DATATYPE_DATE_TIME: return DateTimeData.class;
case Constants.DATATYPE_CHOICE: return SelectOneData.class;
case Constants.DATATYPE_CHOICE_LIST: return SelectMultiData.class;
case Constants.DATATYPE_GEOPOINT: return GeoPointData.class;
case Constants.DATATYPE_GEOSHAPE: return GeoShapeData.class;
case Constants.DATATYPE_GEOTRACE: return GeoTraceData.class;
default: return null;
}
}
开发者ID:medic,项目名称:javarosa,代码行数:25,代码来源:CompactInstanceWrapper.java
示例3: wrapIndeterminedObject
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
/**
* Note: This method is a hack to fix the problem that we don't know what
* data type we're using when we have a preloader. That should get fixed,
* and this method should be removed.
* @param o
* @return
*/
public static IAnswerData wrapIndeterminedObject(Object o) {
if(o == null) {
return null;
}
//TODO: Replace this all with an uncast data
if(o instanceof String) {
return new StringData((String)o);
} else if(o instanceof Date) {
return new DateData((Date)o);
} else if (o instanceof Integer) {
return new IntegerData((Integer)o);
} else if (o instanceof Long) {
return new LongData((Long)o);
} else if (o instanceof Double) {
return new DecimalData((Double)o);
} else if(o instanceof List) {
return new SelectMultiData((List<Selection>)o);
} else if(o instanceof IAnswerData) {
return (IAnswerData)o;
}
return new StringData(o.toString());
}
开发者ID:medic,项目名称:javarosa,代码行数:31,代码来源:PreloadUtils.java
示例4: setUp
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
public void setUp() throws Exception {
super.setUp();
stringData = new StringData(stringDataValue);
stringElement.setValue(stringData);
integerData = new IntegerData(integerDataValue);
intElement.setValue(integerData);
dateData = new DateData(dateDataValue);
dateElement.setValue(dateData);
timeData = new TimeData(timeDataValue);
timeElement.setValue(timeData);
serializer = new XFormAnswerDataSerializer();
}
开发者ID:medic,项目名称:javarosa,代码行数:17,代码来源:XFormAnswerDataSerializerTest.java
示例5: wrapIndeterminedObject
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
/**
* Note: This method is a hack to fix the problem that we don't know what
* data type we're using when we have a preloader. That should get fixed,
* and this method should be removed.
*/
public static IAnswerData wrapIndeterminedObject(Object o) {
if (o == null) {
return null;
}
//TODO: Replace this all with an uncast data
if (o instanceof String) {
return new StringData((String)o);
} else if (o instanceof Date) {
return new DateData((Date)o);
} else if (o instanceof Integer) {
return new IntegerData((Integer)o);
} else if (o instanceof Long) {
return new LongData((Long)o);
} else if (o instanceof Double) {
return new DecimalData((Double)o);
} else if (o instanceof Vector) {
return new SelectMultiData((Vector)o);
} else if (o instanceof IAnswerData) {
return (IAnswerData)o;
}
return new StringData(o.toString());
}
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:29,代码来源:PreloadUtils.java
示例6: setUp
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
@BeforeClass
public static void setUp() {
stringData = new StringData(stringDataValue);
stringElement.setValue(stringData);
integerData = new IntegerData(integerDataValue);
intElement.setValue(integerData);
dateData = new DateData(dateDataValue);
dateElement.setValue(dateData);
timeData = new TimeData(timeDataValue);
timeElement.setValue(timeData);
serializer = new XFormAnswerDataSerializer();
}
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:17,代码来源:XFormAnswerDataSerializerTest.java
示例7: getAttribute
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
public TreeElement getAttribute(String namespace, String name) {
if (name.equals(NAME_ID)) {
if (recordId != TreeReference.INDEX_TEMPLATE) {
//if we're already cached, don't bother with this nonsense
synchronized (parent.treeCache) {
TreeElement element = parent.treeCache.retrieve(recordId);
if (element != null) {
return cache().getAttribute(namespace, name);
}
}
}
//TODO: CACHE GET ID THING
if (entityId == null) {
return cache().getAttribute(namespace, name);
}
//otherwise, don't cache this just yet if we have the ID handy
TreeElement caseid = TreeElement.constructAttributeElement(null, name);
caseid.setValue(new StringData(entityId));
caseid.setParent(this);
return caseid;
}
return cache().getAttribute(namespace, name);
}
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:26,代码来源:LedgerChildElement.java
示例8: getAttribute
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
@Override
public TreeElement getAttribute(String namespace, String name) {
if (name.equals("case_id")) {
if (recordId != TreeReference.INDEX_TEMPLATE) {
//if we're already cached, don't bother with this nonsense
synchronized (parent.treeCache) {
TreeElement element = parent.treeCache.retrieve(recordId);
if (element != null) {
return cache().getAttribute(namespace, name);
}
}
}
//TODO: CACHE GET ID THING
if (caseId == null) {
return cache().getAttribute(namespace, name);
}
//otherwise, don't cache this just yet if we have the ID handy
TreeElement caseid = TreeElement.constructAttributeElement(null, name);
caseid.setValue(new StringData(caseId));
caseid.setParent(this);
return caseid;
}
return cache().getAttribute(namespace, name);
}
开发者ID:dimagi,项目名称:commcare-j2me,代码行数:27,代码来源:CaseChildElement.java
示例9: testSeriesNodeSetExpansion
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
@Test
public void testSeriesNodeSetExpansion() throws XPathSyntaxException {
FormInstance instance = createTestInstance();
EvaluationContext ec = new EvaluationContext(instance);
addDataRef(instance, "/data/flag", new IntegerData(1));
addDataRef(instance, "/data/three[1]", new StringData("alpha"));
addDataRef(instance, "/data/three[2]", new StringData("beta"));
addDataRef(instance, "/data/three[3]", new StringData("delta"));
addDataRef(instance, "/data/two[1]", new StringData("omega"));
addDataRef(instance, "/data/two[2]", new StringData("psi"));
XYSeries pathSeries = new XYSeries("/data/two");
Vector<TreeReference> pathNodes = Graph.expandNodeSet(pathSeries, ec);
Assert.assertEquals(2, pathNodes.size());
XYSeries expressionSeries = new XYSeries("if(/data/flag = 1, '/data/three', '/data/two')");
Vector<TreeReference> expressionNodes = Graph.expandNodeSet(expressionSeries, ec);
Assert.assertEquals(3, expressionNodes.size());
}
开发者ID:dimagi,项目名称:commcare-android,代码行数:21,代码来源:GraphTest.java
示例10: getAttribute
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
@Override
public TreeElement getAttribute(QueryContext context, String namespace, String name) {
if (name.equals(nameId)) {
if (recordId != TreeReference.INDEX_TEMPLATE) {
//if we're already cached, don't bother with this nonsense
synchronized (parent.treeCache) {
TreeElement element = parent.treeCache.retrieve(recordId);
if (element != null) {
return cache(context).getAttribute(namespace, name);
}
}
}
//TODO: CACHE GET ID THING
if (entityId == null) {
return cache(context).getAttribute(namespace, name);
}
//otherwise, don't cache this just yet if we have the ID handy
TreeElement entity = TreeElement.constructAttributeElement(null, name);
entity.setValue(new StringData(entityId));
entity.setParent(this);
return entity;
}
return cache(context).getAttribute(namespace, name);
}
开发者ID:dimagi,项目名称:commcare-core,代码行数:27,代码来源:StorageBackedChildElement.java
示例11: getAnswer
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
@Override
public IAnswerData getAnswer() {
if (mAnswer == null) {
return null;
} else {
return new StringData(mAnswer);
}
}
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:9,代码来源:ItemsetWidget.java
示例12: getAnswer
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
@Override
public IAnswerData getAnswer() {
String s = mStringAnswer.getText().toString();
if (s == null || s.equals("")) {
return null;
} else {
return new StringData(s);
}
}
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:10,代码来源:BarcodeWidget.java
示例13: getAnswer
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
@Override
public IAnswerData getAnswer() {
String s = mStringAnswer.getText().toString();
if (s == null || s.equals("")) {
return null;
} else {
return new StringData(s);
}
}
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:10,代码来源:TriggerWidget.java
示例14: getAnswer
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
@Override
public IAnswerData getAnswer() {
if (mBinaryName != null) {
return new StringData(mBinaryName.toString());
} else {
return null;
}
}
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:9,代码来源:AudioWidget.java
示例15: getAnswer
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
@Override
public IAnswerData getAnswer() {
String s = mAnswer.getText().toString();
if (s == null || s.equals("")) {
return null;
} else {
return new StringData(s);
}
}
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:10,代码来源:ExStringWidget.java
示例16: setBinaryData
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
/**
* Allows answer to be set externally in {@Link FormEntryActivity}.
*/
@Override
public void setBinaryData(Object answer) {
StringData stringData = ExternalAppsUtils.asStringData(answer);
mAnswer.setText(stringData == null ? null : stringData.getValue().toString());
Collect.getInstance().getFormController().setIndexWaitingForData(null);
}
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:10,代码来源:ExStringWidget.java
示例17: getAnswer
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
@Override
public IAnswerData getAnswer() {
clearFocus();
String s = mAnswer.getText().toString();
if (s == null || s.equals("")) {
return null;
} else {
try {
return new StringData(s);
} catch (Exception NumberFormatException) {
return null;
}
}
}
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:15,代码来源:StringNumberWidget.java
示例18: getAnswer
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
@Override
public IAnswerData getAnswer() {
if (mBinaryName != null) {
return new StringData(mBinaryName.toString());
} else {
return null;
}
}
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:9,代码来源:AlignedImageWidget.java
示例19: getAnswer
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
@Override
public IAnswerData getAnswer() {
if (mBinaryName != null) {
return new StringData(mBinaryName.toString());
} else {
return null;
}
}
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:9,代码来源:SignatureWidget.java
示例20: getAnswer
import org.javarosa.core.model.data.StringData; //导入依赖的package包/类
@Override
public IAnswerData getAnswer() {
clearFocus();
String s = mAnswer.getText().toString();
if (s == null || s.equals("")) {
return null;
} else {
return new StringData(s);
}
}
开发者ID:Last-Mile-Health,项目名称:ODK-Liberia,代码行数:11,代码来源:StringWidget.java
注:本文中的org.javarosa.core.model.data.StringData类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论