Package org.javarosa.core.model.instance
Interface AbstractTreeElement<T extends AbstractTreeElement>
- All Known Implementing Classes:
TreeElement
public interface AbstractTreeElement<T extends AbstractTreeElement>
-
Method Summary
Modifier and Type Method Description voidaccept(ITreeVisitor visitor)Visitor pattern acceptance method.voidclearCaches()TgetAttribute(String namespace, String name)Retrieves the TreeElement representing the attribute at the provided namespace and name, or null if none exists.intgetAttributeCount()Returns the number of attributes of this element.StringgetAttributeName(int index)get name of attribute at 'index' in the listStringgetAttributeNamespace(int index)get namespace of attribute at 'index' in the listStringgetAttributeValue(int index)get value of attribute at 'index' in the listStringgetAttributeValue(String namespace, String name)get value of attribute with namespace:name' in the listTgetChild(String name, int multiplicity)TgetChildAt(int i)intgetChildMultiplicity(String name)List<T>getChildrenWithName(String name)Get all the child nodes of this element, with specific nameintgetDataType()intgetDepth()StringgetInstanceName()intgetMult()StringgetName()StringgetNamespace()intgetNumChildren()AbstractTreeElementgetParent()TreeReferencegetRef()IAnswerDatagetValue()booleanhasChildren()booleanisAttribute()booleanisChildable()booleanisLeaf()booleanisRelevant()booleanisRepeatable()List<TreeReference>tryBatchChildFetch(String name, int mult, List<XPathExpression> predicates, EvaluationContext evalContext)TODO: Worst method name ever.
-
Method Details
-
isLeaf
boolean isLeaf() -
isChildable
boolean isChildable() -
getInstanceName
String getInstanceName() -
getChild
-
getChildrenWithName
Get all the child nodes of this element, with specific name- Parameters:
name-- Returns:
-
hasChildren
boolean hasChildren() -
getNumChildren
int getNumChildren() -
getChildAt
-
isRepeatable
boolean isRepeatable() -
isAttribute
boolean isAttribute() -
getChildMultiplicity
-
accept
Visitor pattern acceptance method.- Parameters:
visitor- The visitor traveling this tree
-
getAttributeCount
int getAttributeCount()Returns the number of attributes of this element. -
getAttributeNamespace
get namespace of attribute at 'index' in the list- Parameters:
index-- Returns:
- String
-
getAttributeName
get name of attribute at 'index' in the list- Parameters:
index-- Returns:
- String
-
getAttributeValue
get value of attribute at 'index' in the list- Parameters:
index-- Returns:
- String
-
getAttribute
Retrieves the TreeElement representing the attribute at the provided namespace and name, or null if none exists. If 'null' is provided for the namespace, it will match the first attribute with the matching name.- Returns:
- TreeElement
-
getAttributeValue
get value of attribute with namespace:name' in the list- Returns:
- String
-
getRef
TreeReference getRef() -
getDepth
int getDepth() -
getName
String getName() -
getMult
int getMult() -
getParent
AbstractTreeElement getParent() -
getValue
IAnswerData getValue() -
getDataType
int getDataType() -
clearCaches
void clearCaches() -
isRelevant
boolean isRelevant() -
getNamespace
String getNamespace() -
tryBatchChildFetch
List<TreeReference> tryBatchChildFetch(String name, int mult, List<XPathExpression> predicates, EvaluationContext evalContext)TODO: Worst method name ever. Don't use this unless you know what's up.- Parameters:
name-mult-predicates- possibly list of predicates to be evaluated. predicates will be removed from list if they are able to be evaluatedevalContext-- Returns:
-