Counts 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 following call:
findChildren (
element,
elementTypeSpec
).count()
Parameters:
element
If not specified, the generator context element is assumed,
i.e. the same as the call: contextElement.countChildren(elementTypeSpec)
See Also: GOMContext.contextElement
elementTypeSpec
All counted elements should comply with at least one of the target Element Types.
filterQuery
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 counted
and false
if it should be ignored.
The tested element is passed as the generator context element.
Note: If element == null
, the function returns 0
.
Returns the number of all "Method"
and "Field"
children of
the current generator context element:
countChildren("Method | Field");
"Class"
children of the current context element,
whose "name"
attribute has the value starting with "ABC"
:
countChildren("Class", BooleanQuery (
getAttrStringValue("name").startsWith("ABC")
));
findChildren(), countElementsByLPath(), BooleanQuery()