Returns all elements that are children of the specified element and comply with the specified target Element Type(s).
This function returns the same result as the call:
The difference is that it will work considerably faster, because it bypasses the Location Path processor and requests the data source (DSM) directly. So, when all you need is to access the children of a given element, using offindElementsByLPath(element, elementTypeSpec)
findChildren()
function may be preferable.
Parameters:
element
The element whose children are requested.If not specified, the generator context element is assumed, i.e. the same as the call:
contextElement.findChildren(elementTypeSpec)
See Also:
GOMContext.contextElement
elementTypeSpec
The list of target Element Types (see "Specifying Matching Element Types" below).All elements included in the result enumeration should comply with at least one of the target Element Types.
filterQuery
Specify an additional condition on the returned elements.This should be a boolean subquery created with
BooleanQuery()
function. The subquery will be processed against each initially selected element. It must returntrue
if the element should be included in the result enumeration andfalse
otherwise. The tested element is passed as the generator context element.
Returns:
The enumeration ofGOMElement
instances representing the found child elements.If no such children found (or
element == null
), an empty enumeration is returned.
Examples:
Returns all "Method"
and "Field"
children of
the current generator context element:
Returns allfindChildren("Method | Field");
"Class"
children of the current context element,
whose "name"
attribute has the value starting with "ABC"
:
Returns allfindChildren("Class", BooleanQuery ( getAttrStringValue("name").startsWith("ABC") ));
"Class"
children of the element element
:
Returns all children of the elementelement.findChildren("Class");
element
regardless of their type:
element.findChildren("*");
See Also:
findChild(), countChildren(), findAncestor(), findElementsByLPath()
${include ../../../refs/matching_ets_spec.htm}
${include ../../../refs/element_types.htm}