org.jcoderz.commons.tracing
Class AspectPattern

java.lang.Object
  extended by org.jcoderz.commons.tracing.AspectPattern

public class AspectPattern
extends Object

This class allows to match aspectJ like patterns with the java internal class representation.

The following limitations / specialties should be considered:

TODO: Javadoc TODO: Support '+' for inheritance

Author:
Andreas Mandel

Constructor Summary
AspectPattern(String in)
          Creates new aspect pattern matcher.
 
Method Summary
 String getClassRegex()
           
 String getMethodPattern()
           
 int getModifiers()
           
 String getTracerClass()
           
 boolean matchAccess(int access)
           
 boolean matchClass(String internalClassname)
           
 boolean matches(int acc, String className, String arguments)
          Tests if the given class with the given access flags matches this pattern.
 boolean matchMethod(String methodDesc)
           
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AspectPattern

public AspectPattern(String in)
Creates new aspect pattern matcher. The input is translated into regular expressions which are compiled and stored in this AspectPattern.

Parameters:
in - the aspectJ like pattern.
Method Detail

matches

public boolean matches(int acc,
                       String className,
                       String arguments)
Tests if the given class with the given access flags matches this pattern.

Parameters:
acc - the access flags.
className - name of the class in internal representation.
arguments - argument string in internal representation.
Returns:
true if the given parameters match this matcher.

getModifiers

public int getModifiers()

getMethodPattern

public String getMethodPattern()

getClassRegex

public String getClassRegex()

matchClass

public boolean matchClass(String internalClassname)
Parameters:
internalClassname -
Returns:

matchMethod

public boolean matchMethod(String methodDesc)
Parameters:
methodDesc -
Returns:

toString

public String toString()

Overrides:
toString in class Object

matchAccess

public boolean matchAccess(int access)
Parameters:
access -
Returns:

getTracerClass

public String getTracerClass()


Copyright 2007 The jCoderZ Project.