A methods criterion is declared nested within a method selector.
Attribute | Description | Required |
---|---|---|
Please see selector criterion for additional parameters. | ||
overriding | Tristate. true indicates the method must override another, false indicates that the method must not override another. If this parameter is omitted then overriding criterion is not checked. | No |
overridden | Tristate. true indicates the method must be overridden by another, false indicates that the method must not be overridden by another. If this parameter is omitted then the overridden criterion is not checked. | No |
overloaded | Tristate. true indicates the method must be overloaded, false indicates that the method must not be overloaded. If this parameter is omitted then the overloaded criterion is not checked. | No |
returnSelector | A reference to a type selector to which the return type of the method must belong. | No |
returnsDeclarer | Tristate. true indicates the method must have a return type which matches the type in which it is declared, false indicates that its return type must differ from the type in which it is declared. If this parameter is omitted then this criterion is not checked. | No |
parameterNamePattern | A name pattern to which one or more parameter names must comply for the method to be accepted. | No |
parameterNamePatternSwitch | A reference to a pattern switch, the value of which is the pattern to which one or more parameter names must comply. | No |
parameterTypeSelector | A reference to a type selector which accepts one or more of the methods parameters. | No |
exceptionTypeSelector | A reference to a type selector which accepts one or more of the checked exceptions of the method. | No |
<MethodSelector name="overridingMethods">
<MethodsCriterion overriding="true"/>
</MethodSelector>
Declares a method selector which accepts only methods which override another method.
<MethodSelector name="contextMethods">
<MethodsCriterion parameterNamePattern="context"/>
</MethodSelector>
Declares a method selector which selects methods which have one or more parameters named 'context'.
<MethodSelector name="exceptionThrowers" criteriaAnded="true">Declares a method selector which selects methods whose name starts with 'test...' and throw one or more exception types.
<MethodsCriterion namePattern="test*"/>
<MethodsCriterion exceptionTypeSelector="exceptionTypes"/>
</MethodSelector>