org.apache.commons.proxy.interceptor.filter
Class PatternFilter

java.lang.Object
  extended by org.apache.commons.proxy.interceptor.filter.PatternFilter
All Implemented Interfaces:
MethodFilter

public class PatternFilter
extends Object
implements MethodFilter

A method filter implementation that returns true if the method's name matches a supplied regular expression (JDK regex) pattern string.

Since:
1.0
Author:
James Carman

Field Summary
static String GETTER_SETTER_PATTERN
           
 
Constructor Summary
PatternFilter(String pattern)
           
 
Method Summary
 boolean accepts(Method method)
          Returns whether or not this filter accepts this method.
static MethodFilter getterSetterFilter()
          Returns a MethodFilter which accepts only "getters" and "setters."
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GETTER_SETTER_PATTERN

public static String GETTER_SETTER_PATTERN
Constructor Detail

PatternFilter

public PatternFilter(String pattern)
Method Detail

getterSetterFilter

public static MethodFilter getterSetterFilter()
Returns a MethodFilter which accepts only "getters" and "setters."

Returns:
a MethodFilter which accepts only "getters" and "setters."

accepts

public boolean accepts(Method method)
Description copied from interface: MethodFilter
Returns whether or not this filter accepts this method.

Specified by:
accepts in interface MethodFilter
Parameters:
method - the method
Returns:
whether or not this filter accepts this method


Copyright © 2005-2008 The Apache Software Foundation. All Rights Reserved.