KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > routing > filters > logic > NotFilter


1 /*
2  * $Id: NotFilter.java 4219 2006-12-09 10:15:14Z lajos $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.routing.filters.logic;
12
13 import org.mule.umo.UMOFilter;
14 import org.mule.umo.UMOMessage;
15
16 /**
17  * <code>NotFilter</code> accepts if the filter does not accept.
18  */

19
20 public class NotFilter implements UMOFilter
21 {
22     private UMOFilter filter;
23
24     public NotFilter()
25     {
26         super();
27     }
28
29     public NotFilter(UMOFilter filter)
30     {
31         this.filter = filter;
32     }
33
34     public UMOFilter getFilter()
35     {
36         return filter;
37     }
38
39     public void setFilter(UMOFilter filter)
40     {
41         this.filter = filter;
42     }
43
44     public boolean accept(UMOMessage message)
45     {
46         return (filter != null ? !filter.accept(message) : false);
47     }
48
49 }
50
Popular Tags