org.codehaus.aspectwerkz.expression.regexp
Class TypePattern

java.lang.Object
  extended by org.codehaus.aspectwerkz.expression.regexp.Pattern
      extended by org.codehaus.aspectwerkz.expression.regexp.TypePattern
All Implemented Interfaces:
Serializable

public class TypePattern
extends Pattern

Implements the regular expression pattern matcher for types.

Author:
Jonas BonŽr
See Also:
Serialized Form

Field Summary
protected  String m_pattern
          The pattern as a string.
protected  com.karneim.util.collection.regex.Pattern m_typeNamePattern
          The fully qualified type name.
 
Fields inherited from class org.codehaus.aspectwerkz.expression.regexp.Pattern
ABBREVIATIONS, EAGER_WILDCARD, REGULAR_WILDCARD
 
Method Summary
protected static boolean areEqualsOrBothNull(Object o1, Object o2)
           
 boolean equals(Object o)
           
protected  void escape(String pattern)
          Escapes the type pattern.
 String getPattern()
          Returns the pattern as a string.
 SubtypePatternType getSubtypePatternType()
          Returns the subtype pattern type
 int hashCode()
           
protected static int hashCodeOrZeroIfNull(Object o)
           
 boolean isEagerWildCard()
          Checks if the pattern matches all types.
 boolean matches(String typeName)
          Matches a type name.
 boolean matchInterfaces(ClassInfo[] interfaces, ClassInfo classInfo)
          Tries to finds a parse at some interface in the hierarchy.
 boolean matchSuperClasses(ClassInfo classInfo)
          Tries to finds a parse at some superclass in the hierarchy.
 boolean matchType(ClassInfo classInfo)
          Matches a type.
 
Methods inherited from class org.codehaus.aspectwerkz.expression.regexp.Pattern
compileNamePattern, compileTypePattern
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_typeNamePattern

protected transient com.karneim.util.collection.regex.Pattern m_typeNamePattern
The fully qualified type name.


m_pattern

protected String m_pattern
The pattern as a string.

Method Detail

matches

public boolean matches(String typeName)
Matches a type name.

Parameters:
typeName - the name of the type
Returns:
true if we have a matche

matchType

public boolean matchType(ClassInfo classInfo)
Matches a type.

Parameters:
classInfo - the info of the class
Returns:

matchSuperClasses

public boolean matchSuperClasses(ClassInfo classInfo)
Tries to finds a parse at some superclass in the hierarchy.

Only checks for a class parse to allow early filtering.

Recursive.

Parameters:
classInfo - the class info
Returns:
boolean

matchInterfaces

public boolean matchInterfaces(ClassInfo[] interfaces,
                               ClassInfo classInfo)
Tries to finds a parse at some interface in the hierarchy.

Only checks for a class parse to allow early filtering.

Recursive.

Parameters:
interfaces - the interfaces
classInfo - the class info
Returns:
boolean

getSubtypePatternType

public SubtypePatternType getSubtypePatternType()
Returns the subtype pattern type

Returns:
boolean

isEagerWildCard

public boolean isEagerWildCard()
Checks if the pattern matches all types.

Returns:
boolean

getPattern

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

Returns:
the pattern

escape

protected void escape(String pattern)
Escapes the type pattern.

Parameters:
pattern - the method pattern

hashCode

public int hashCode()
Overrides:
hashCode in class Object

hashCodeOrZeroIfNull

protected static int hashCodeOrZeroIfNull(Object o)

equals

public boolean equals(Object o)
Overrides:
equals in class Object

areEqualsOrBothNull

protected static boolean areEqualsOrBothNull(Object o1,
                                             Object o2)


Copyright © 2002-2005 Jonas Bonér, Alexandre Vasseur. All Rights Reserved.