本文整理汇总了Java中org.javarosa.core.model.QuestionDef.setTextID方法的典型用法代码示例。如果您正苦于以下问题:Java QuestionDef.setTextID方法的具体用法?Java QuestionDef.setTextID怎么用?Java QuestionDef.setTextID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.javarosa.core.model.QuestionDef
的用法示例。
在下文中一共展示了QuestionDef.setTextID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseQuestionLabel
import org.javarosa.core.model.QuestionDef; //导入方法依赖的package包/类
private void parseQuestionLabel (QuestionDef q, Element e) {
String label = getLabel(e);
String ref = e.getAttributeValue("", REF_ATTR);
List<String> usedAtts = new ArrayList<String>();
usedAtts.add(REF_ATTR);
if (ref != null) {
if (ref.startsWith(ITEXT_OPEN) && ref.endsWith(ITEXT_CLOSE)) {
String textRef = ref.substring(ITEXT_OPEN.length(), ref.indexOf(ITEXT_CLOSE));
verifyTextMappings(textRef, "Question <label>", true);
q.setTextID(textRef);
} else {
throw new RuntimeException("malformed ref [" + ref + "] for <label>");
}
} else {
q.setLabelInnerText(label);
}
if(XFormUtils.showUnusedAttributeWarning(e, usedAtts)){
reporter.warning(XFormParserReporter.TYPE_UNKNOWN_MARKUP, XFormUtils.unusedAttWarning(e, usedAtts), getVagueLocation(e));
}
}
示例2: testPromptIDsNoLocalizer
import org.javarosa.core.model.QuestionDef; //导入方法依赖的package包/类
@Test
public void testPromptIDsNoLocalizer() {
QuestionDef q = new QuestionDef();
q.setTextID("long text id");
if (!"long text id".equals(q.getTextID())) {
fail("Long text ID getter/setter broken");
}
QuestionString hint = new QuestionString("hint");
hint.setTextId("hint text id");
q.putQuestionString("hint", hint);
if (!"hint text id".equals(q.getQuestionString("hint").getTextId())) {
fail("hint text ID getter/setter broken");
}
}
示例3: testPromptIDsNoLocalizer
import org.javarosa.core.model.QuestionDef; //导入方法依赖的package包/类
public void testPromptIDsNoLocalizer () {
QuestionDef q = new QuestionDef();
q.setTextID("long text id");
if (!"long text id".equals(q.getTextID())) {
fail("Long text ID getter/setter broken");
}
q.setHelpTextID("help text id");
if (!"help text id".equals(q.getHelpTextID()) || q.getHelpText() != null) {
fail("Help text ID getter/setter broken");
}
}