01: /* JFox, the OpenSource J2EE Application Server
02: *
03: * Copyright (C) 2002 huihoo.com
04: * Distributable under GNU LGPL license
05: * See the GNU Lesser General Public License for more details.
06: */
07:
08: package org.huihoo.jfox.jmx.queries;
09:
10: import javax.management.QueryEval;
11: import javax.management.QueryExp;
12: import javax.management.ObjectName;
13: import javax.management.BadStringOperationException;
14: import javax.management.BadBinaryOpValueExpException;
15: import javax.management.BadAttributeValueExpException;
16: import javax.management.InvalidApplicationException;
17:
18: /**
19: *
20: * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
21: */
22:
23: public class NotQueryExp extends QueryEval implements QueryExp {
24:
25: private QueryExp exp;
26:
27: public NotQueryExp() {
28: }
29:
30: public NotQueryExp(QueryExp queryexp) {
31: exp = queryexp;
32: }
33:
34: public QueryExp getNegatedExp() {
35: return exp;
36: }
37:
38: public boolean apply(ObjectName objectname)
39: throws BadStringOperationException,
40: BadBinaryOpValueExpException,
41: BadAttributeValueExpException, InvalidApplicationException {
42: return !exp.apply(objectname);
43: }
44:
45: public String toString() {
46: return "not (" + exp + ")";
47: }
48: }
|