Package org.javarosa.core.model
Interface IFormElement
- All Superinterfaces:
Externalizable,Localizable
- All Known Implementing Classes:
FormDef,GroupDef,QuestionDef,RangeQuestion
public interface IFormElement extends Localizable, Externalizable
An IFormDataElement is an element of the physical interaction for
a form, an example of an implementing element would be the definition
of a Question.
- Author:
- Drew Roos
-
Method Summary
Modifier and Type Method Description voidaddChild(IFormElement fe)ActionControllergetActionController()StringgetAdditionalAttribute(String namespace, String name)Retrieve the value of an additional attribute on a Question or GroupList<TreeElement>getAdditionalAttributes()Retrieve all additional attributes on a Question or GroupStringgetAppearanceAttr()IDataReferencegetBind()IFormElementgetChild(int i)List<IFormElement>getChildren()intgetDeepChildCount()intgetID()StringgetLabelInnerText()This method returns the regular innertext betweem label tags (if present) (<label>innertext</label>).StringgetTextID()get the TextID for this element used for localization purposesvoidregisterStateObserver(FormElementStateListener qsl)Registers a state observer for this element.voidsetAdditionalAttribute(String namespace, String name, String value)Capture additional attributes on a Question or GroupvoidsetAppearanceAttr(String appearanceAttr)voidsetChildren(List<IFormElement> v)voidsetID(int id)voidsetTextID(String id)Set the textID for this element for use with localization.voidunregisterStateObserver(FormElementStateListener qsl)Unregisters a state observer for this element.Methods inherited from interface org.javarosa.core.util.externalizable.Externalizable
readExternal, writeExternal
-
Method Details
-
getID
int getID()- Returns:
- The unique ID of this element
-
setID
void setID(int id)- Parameters:
id- The new unique ID of this element
-
getTextID
String getTextID()get the TextID for this element used for localization purposes- Returns:
- the TextID (bare, no ;form appended to it!!)
-
setTextID
Set the textID for this element for use with localization.- Parameters:
id- the plain TextID WITHOUT any form specification (e.g. ;long)
-
getChildren
List<IFormElement> getChildren()- Returns:
- A List containing any children that this element might have. Null if the element is not able to have child elements.
-
setChildren
- Parameters:
v- the children of this element, if it is capable of having child elements.- Throws:
IllegalStateException- if the element is incapable of having children.
-
addChild
- Parameters:
fe- The child element to be added- Throws:
IllegalStateException- if the element is incapable of having children.
-
getChild
-
getDeepChildCount
int getDeepChildCount()- Returns:
- A recursive count of how many elements are ancestors of this element.
-
getBind
IDataReference getBind()- Returns:
- The data reference for this element
-
registerStateObserver
Registers a state observer for this element.- Parameters:
qsl-
-
unregisterStateObserver
Unregisters a state observer for this element.- Parameters:
qsl-
-
getLabelInnerText
String getLabelInnerText()This method returns the regular innertext betweem label tags (if present) (<label>innertext</label>).- Returns:
- <label> innertext or null (if innertext is not present).
-
getAppearanceAttr
String getAppearanceAttr()- Returns:
-
setAppearanceAttr
-
getActionController
ActionController getActionController() -
setAdditionalAttribute
Capture additional attributes on a Question or Group- Parameters:
namespace-name-value-
-
getAdditionalAttribute
Retrieve the value of an additional attribute on a Question or Group- Parameters:
namespace-name-- Returns:
-
getAdditionalAttributes
List<TreeElement> getAdditionalAttributes()Retrieve all additional attributes on a Question or Group- Returns:
-