Class Selection
java.lang.Object
org.javarosa.core.model.data.helper.Selection
- All Implemented Interfaces:
Externalizable
public class Selection extends Object implements Externalizable
A response to a question requesting a selection
from a list.
This class may exist in 3 states:
1) only index has a value
2) only xmlValue has a value
3) index, xmlValue, and choice have values, where index and xmlValue are simply cached copies of the values in 'choice'
the 3rd form is the most full-featured, and is required for situations where you want to recover the captions for the
choices, such as form entry. the choice objects used in the form entry model will receive localization updates,
allowing you to retrieve the appropriate caption.
the 2nd form is useful when dealing with FormInstances without having to worry about the FormDef or the captions
from the
- Author:
- Drew Roos
-
Field Summary
Fields Modifier and Type Field Description SelectChoicechoiceintindexStringxmlValue -
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidattachChoice(QuestionDef q)voidattachChoice(SelectChoice choice)Selectionclone()StringgetValue()voidreadExternal(DataInputStream in, PrototypeFactory pf)voidwriteExternal(DataOutputStream out)
-
Field Details
-
Constructor Details
-
Method Details
-
clone
-
attachChoice
-
attachChoice
-
getValue
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-