org.nanocontainer.aop.defaults
Class NameMatchesComponentPointcut

java.lang.Object
  extended by org.nanocontainer.aop.defaults.NameMatchesComponentPointcut
All Implemented Interfaces:
ComponentPointcut

public class NameMatchesComponentPointcut
extends java.lang.Object
implements ComponentPointcut

Component pointcut that matches the component name against a regular expression.

Version:
$Revision: 3144 $
Author:
Stephen Molitor

Constructor Summary
NameMatchesComponentPointcut(java.lang.String regex)
          Creates a new NameMatchesComponentPointcut that will match the component key against the given regular expression.
 
Method Summary
 boolean picks(java.lang.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
 

Constructor Detail

NameMatchesComponentPointcut

public NameMatchesComponentPointcut(java.lang.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.
Method Detail

picks

public boolean picks(java.lang.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.