org.nanocontainer.aop.defaults
Class NameMatchesComponentPointcut
java.lang.Object
org.nanocontainer.aop.defaults.NameMatchesComponentPointcut
- All Implemented Interfaces:
- ComponentPointcut
public class NameMatchesComponentPointcut
- extends Object
- implements ComponentPointcut
Component pointcut that matches the component name against a regular
expression.
- Version:
- $Revision: 3144 $
- Author:
- Stephen Molitor
Constructor Summary |
NameMatchesComponentPointcut(String regex)
Creates a new NameMatchesComponentPointcut that will match
the component key against the given regular expression. |
Method Summary |
boolean |
picks(Object componentKey)
Tests to see if the component key's toString() value matches the regular expression passed
to the constructor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NameMatchesComponentPointcut
public NameMatchesComponentPointcut(String regex)
throws MalformedRegularExpressionException
- Creates a new
NameMatchesComponentPointcut
that will match
the component key against the given regular expression. The regular
expression must be an ORO Perl5 regular
expression.
- Parameters:
regex
- the regular expression to match against the component name.
- Throws:
MalformedRegularExpressionException
- if the regular expression is
invalid.
picks
public boolean picks(Object componentKey)
- Tests to see if the component key's toString() value matches the regular expression passed
to the constructor.
- Specified by:
picks
in interface ComponentPointcut
- Parameters:
componentKey
- the component key to match against.
- Returns:
- true if the regular expression passed to the constructor matches
against
componentKey
, else false.
Copyright © 2003-2009 Codehaus. All Rights Reserved.