3.0.2: 2012-01-25

net.sf.basedb.util.extensions.xml
Class ExtensionPointFilter

java.lang.Object
  extended by net.sf.basedb.util.extensions.xml.ExtensionPointFilter
All Implemented Interfaces:
Filter<Element>

public class ExtensionPointFilter
extends Object
implements Filter<Element>

Filter implementation that can be used to match extension points and extensions based on the ID of the extension point.

Extensions points will pass the filter if their ID matches the given pattern.

Extensions will pass the filter if the ID of the extension point they are extending matches the given pattern.

Since:
3.0
Author:
Nicklas
Last modified
$Date: 2011-03-30 11:44:57 +0200 (Wed, 30 Mar 2011) $

Field Summary
private  Pattern pattern
           
 
Constructor Summary
ExtensionPointFilter(Pattern pattern)
          Create a new filter based on the given pattern.
ExtensionPointFilter(String pattern)
          Create a new filter based on the given pattern.
 
Method Summary
 boolean evaluate(Element tag)
          Evaluate if the given object should pass the filter or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pattern

private final Pattern pattern
Constructor Detail

ExtensionPointFilter

public ExtensionPointFilter(Pattern pattern)
Create a new filter based on the given pattern.

Parameters:
pattern - A pattern, null is not allowed

ExtensionPointFilter

public ExtensionPointFilter(String pattern)
Create a new filter based on the given pattern.

Parameters:
pattern - A pattern that will be used in Pattern.compile(String), null is not allowed
Method Detail

evaluate

public boolean evaluate(Element tag)
Description copied from interface: Filter
Evaluate if the given object should pass the filter or not.

Specified by:
evaluate in interface Filter<Element>
Parameters:
tag - The object to evaluate
Returns:
TRUE if the object passes the filter, FALSE otherwise

3.0.2: 2012-01-25