tangentum technologies    
 

Deutsch

   
   
 
    method-with-result

method-with-result

Name

method-with-result -- Selects methods whose result-type is member of a specified set of types.

Synopsis

<... ... method-with-result="type-name (, type-name)*" ... />

Description

This condition-attribute evaluates to true for methods with a result-type that is member of the specified set of types.

The types (classes, interfaces and built-in types) are given as a comma-separated list of type-names. The order of the type-names is not important. The type-names follow the conventions used in Java:

  • Built-in types are given with their standard name, i.e. boolean, byte, char, double, float, int, long, and short,

  • Arrays of built-in types are given using the conventions for arrays, e.g. "boolean[]", or "double[][]".

  • Classes and interfaces are given with their fully-qualified name, e.g. "com.abc_company.A_class".

    To simplify writing of standard-classes like "java.lang.String", "java.lang.Integer", or "java.lang.Object", the package-name "java.lang" may be omitted. Therefore "String", "Integer", or "Object" are equally valid class-names. This rule applies for classes and interfaces defined in package "java.lang" only.

    To name classes or interfaces from an unnamed package, like class "MyApplet", a dot must be prepended to the name, e.g. ".MyApplet".

  • Arrays of classes and interfaces are also given using the conventions for arrays, e.g. "com.abc_company.A_class[]", "String[][]", or ".MyApplet[]".

  • The constant void should be used to specify an empty result-type.

As an example take the following methods:

void foo(...)
java.lang.String foo(...)
int[] foo(...)
int[] bar(...)
com.abc_company.A_class bar(...)

Some selections with their results:

<log method-with-result="java.lang.String"/>
<!----------------------------------------->
<!-- java.lang.String foo(...)           -->


<log method-with-result="String"/>
<!----------------------------------------->
<!-- java.lang.String foo(...)           -->


<log method-with-result="void"/>
<!----------------------------------------->
<!-- void foo(...)                       -->


<log method-with-result="int[]"/>
<!----------------------------------------->
<!-- int[] foo(...)                      -->
<!-- int[] bar(...)                      -->