org.codehaus.aspectwerkz.regexp
Class MethodPattern

java.lang.Object
  extended byorg.codehaus.aspectwerkz.regexp.Pattern
      extended byorg.codehaus.aspectwerkz.regexp.MethodPattern
All Implemented Interfaces:
java.io.Serializable

public class MethodPattern
extends Pattern

Implements the regular expression pattern matcher for methods in AspectWerkz.

Example of supported patterns:

      String method() // supports abbreviations for the java.lang.* and java.util.* namespaces
      java.lang.String method()
      * method()
      int method(*) // matches one parameter
      int method(..) // matches any number of parameters
      int method(*,*,int,*)
 

Author:
Jonas Bonér
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.codehaus.aspectwerkz.regexp.Pattern
MULTIPLE_WILDCARD, MULTIPLE_WILDCARD_KEY, SINGLE_WILDCARD
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getPattern()
          Returns the pattern as a string.
 int hashCode()
           
 boolean matches(MethodMetaData method)
          Matches a method.
 boolean matchMethodName(java.lang.String methodName)
          Matches a method name.
 boolean matchParameterTypes(java.lang.String[] parameterTypes)
          Matches a parameter list.
 boolean matchReturnType(java.lang.String returnType)
          Matches a method return type.
 
Methods inherited from class org.codehaus.aspectwerkz.regexp.Pattern
compileCallerSidePattern, compileClassPattern, compileFieldPattern, compileMethodPattern, compileThrowsPattern
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

matches

public boolean matches(MethodMetaData method)
Matches a method.

Parameters:
method - the method
Returns:
true if we have a matches

matchMethodName

public boolean matchMethodName(java.lang.String methodName)
Matches a method name.

Parameters:
methodName - the name of the method
Returns:
true if we have a matches

matchReturnType

public boolean matchReturnType(java.lang.String returnType)
Matches a method return type.

Parameters:
returnType - the return type
Returns:
true if we have a matches

matchParameterTypes

public boolean matchParameterTypes(java.lang.String[] parameterTypes)
Matches a parameter list.

Parameters:
parameterTypes - the parameter types
Returns:
true if we have a matches

getPattern

public java.lang.String getPattern()
Returns the pattern as a string.

Returns:
the pattern

hashCode

public int hashCode()

equals

public boolean equals(java.lang.Object o)


Copyright (c) 2002-2004 The AspectWerkz Team. All Rights Reserved.