01: /*
02: * Copyright (C) The MX4J Contributors.
03: * All rights reserved.
04: *
05: * This software is distributed under the terms of the MX4J License version 1.0.
06: * See the terms of the MX4J License in the documentation provided with this software.
07: */
08:
09: package javax.management;
10:
11: /**
12: * The QueryExp for the 'not' operation
13: *
14: * @version $Revision: 1.6 $
15: * @serial include
16: */
17: class NotQueryExp extends QueryEval implements QueryExp {
18: private static final long serialVersionUID = 5269643775896723397L;
19:
20: /**
21: * @serial The expression to negate
22: */
23: private QueryExp exp;
24:
25: NotQueryExp(QueryExp exp) {
26: this .exp = exp;
27: }
28:
29: public void setMBeanServer(MBeanServer server) {
30: super .setMBeanServer(server);
31: if (exp != null)
32: exp.setMBeanServer(server);
33: }
34:
35: public boolean apply(ObjectName name)
36: throws BadStringOperationException,
37: BadBinaryOpValueExpException,
38: BadAttributeValueExpException, InvalidApplicationException {
39: if (exp != null)
40: return !exp.apply(name);
41: return false;
42: }
43: }
|