SelectorsThe job of a selector (FieldSelector, TypeSelector or MethodSelector) is to provide a yes or no verdict when presented with a particular Java element (field, method or type) from the Eclipse Java model. The verdict is reached as a result of testing the presented Java element against specified criteria to see if matches. When specifying a selector one or more criteria must be specified. Where multiple criteria are specified they must all be either anded (&) or ored (|). For the criteria documented below we use FieldSelector examples; please note that all of these criteria are equally valid for use in the specification of a TypeSelector or a MethodSelector. Name CriterionThe name is the simple unqualified name of the Java element. The criterion tests it against a wildcard pattern. The pattern may be supplied directly in the definition, or may be sourced from a PatternSwitch. Examples:Matches fields named serialVersionUID
Matches fields with a name ending in ID
Matches fields with a name matching a PatternSwitch (this contains just a reference to the PatternSwitch, the PatternSwitch itself is specified elsewhere)
JavadocThe Javadoc is the comment present in the source code just before the declaration of the Java element. A Javadoc comment can be treated as a collection of tag-value pairs. Below is a Javadoc comment with three tags:
The javadoc criterion can apply to either the tag name or the value. ExamplesMatches fields with a Javadoc value containing the word persistence
Matches fields with a Javadoc value matching a PatternSwitch (again, authorPattern is specified elsewhere)
Matches fields with an @author Javadoc tag and a Javadoc value matching Flintstone
ModifiersModifiers are the familiar Java keywords like final static abstract public which are prepended to the declaration of a Java element in the source code. The modified criterion differentiates between Java elements which have a given modifier and those which do not. ExampleMatches all final fields
Declared ByThe owner of a Java element is the type in which it is declared. Inner types are declared by their outer type. Top level types do not have an owner (see TypeSelector). This criterion selects based upon the selection of the Java element's owner. ExampleMatches all fields declared in a unit test. (What constitutes a unit test is dealt with by the unitTests TypeSelector).
Included Other SelectorInclusion by another selector allows new selectors to be composed of an aggregation of many other selectors without the need to repeat all of the criteria of the aggregates. ExampleMatches all final fields declared in a unit test
Excluded Other SelectorExclusion from another selector means that this Java element is required to not meet the criteria of another selector. ExamplesMatches all fields which are mutable (non-final)
|