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:


findElementsByLPath(element, elementTypeSpec)
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 of 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 return true if the element should be included in the result enumeration and false otherwise. The tested element is passed as the generator context element.

Returns:

The enumeration of GOMElement 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:

findChildren("Method | Field");
Returns all "Class" children of the current context element, whose "name" attribute has the value starting with "ABC":
findChildren("Class", BooleanQuery (
  getAttrStringValue("name").startsWith("ABC")
));
Returns all "Class" children of the element element:
element.findChildren("Class");
Returns all children of the element element regardless of their type:
element.findChildren("*");

See Also:

findChild(), countChildren(), findAncestor(), findElementsByLPath()

${include ../../../refs/matching_ets_spec.htm}

${include ../../../refs/element_types.htm}