2.17.2: 2011-06-17

net.sf.basedb.core.snapshot
Class AnnotationFilter

java.lang.Object
  extended by net.sf.basedb.core.snapshot.AnnotationFilter
All Implemented Interfaces:
Filter<AnnotationSnapshot>

public class AnnotationFilter
extends Object
implements Filter<AnnotationSnapshot>

Filter implementation that finds the annotation snapshot for a given annotation.

Version:
2.14
Author:
Nicklas
Last modified
$Date: 2009-11-05 10:40:18 +0100 (Thu, 05 Nov 2009) $

Field Summary
private  int annotationId
           
 
Constructor Summary
AnnotationFilter()
          Create a filter that matches all annotations.
AnnotationFilter(Annotation a)
          Create a filter that matches a specfic annotation.
 
Method Summary
 boolean evaluate(AnnotationSnapshot snapshot)
          Evaluate if the given object should pass the filter or not.
 void setAnnotation(Annotation a)
          Set the annotation this filter should match.
 void setAnnotationId(int annotationId)
          Set the annotation this filter should match.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

annotationId

private int annotationId
Constructor Detail

AnnotationFilter

public AnnotationFilter()
Create a filter that matches all annotations.


AnnotationFilter

public AnnotationFilter(Annotation a)
Create a filter that matches a specfic annotation.

Method Detail

evaluate

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

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

setAnnotation

public void setAnnotation(Annotation a)
Set the annotation this filter should match.

Parameters:
a - A specific annotation, or null to match any annotation

setAnnotationId

public void setAnnotationId(int annotationId)
Set the annotation this filter should match.

Parameters:
annotationId - A specific annotation, or 0 to match any annotation
Since:
2.14.1

2.17.2: 2011-06-17