public static boolean isMethodNode ( ASTNode node , String methodNamePattern , Integer numArguments , Class returnType ) { if ( ! ( node instanceof MethodNode ) ) { return false ; } if ( ! ( ( ( MethodNode ) node ) . getName ( ) . matches ( methodNamePattern ) ) ) { return false ; } if ( numArguments != null && ( ( MethodNode ) node ) . getParameters ( ) != null && ( ( MethodNode ) node ) . getParameters ( ) . length != numArguments ) { return false ; } if ( returnType != null && ! AstUtil . classNodeImplementsType ( ( ( MethodNode ) node ) . getReturnType ( ) , returnType ) ) { return false ; } return true ; }
Tells you if the ASTNode is a method node for the given name arity and return type .