01: /* JFox, the OpenSource J2EE Application Server
02: *
03: * Copyright (C) 2002 huihoo.org
04: * Distributable under GNU LGPL license
05: * See the GNU Lesser General Public License for more details.
06: */
07:
08: package javax.management;
09:
10: /**
11: * Represents strings that are arguments to relational constraints.
12: * A <CODE>StringValueExp</CODE> may be used anywhere a <CODE>ValueExp</CODE> is required.
13: *
14: * @author <a href="mailto:young_yy@hotmail.org">Young Yang</a>
15: */
16:
17: public class StringValueExp extends QueryEval implements ValueExp {
18:
19: private String val;
20:
21: /**
22: * Basic constructor.
23: */
24: public StringValueExp() {
25:
26: }
27:
28: /**
29: * Creates a new <CODE>StringValueExp</CODE> representing the string literal val.
30: *
31: */
32: public StringValueExp(String val) {
33: this .val = val;
34: }
35:
36: /**
37: * Returns the string represented by the <CODE>StringValueExp</CODE> instance.
38: */
39: public String getValue() {
40: return val;
41: }
42:
43: /**
44: * Returns the string representing the object.
45: */
46: public String toString() {
47: return "'" + val + "'";
48: }
49:
50: /**
51: * Applies the ValueExp on a MBean.
52: *
53: * @param name The name of the MBean on which the ValueExp will be applied.
54: *
55: * @return The <CODE>ValueExp</CODE>.
56: *
57: * @exception BadStringOperationException
58: * @exception BadBinaryOpValueExpException
59: * @exception BadAttributeValueExpException
60: * @exception InvalidApplicationException
61: */
62: public ValueExp apply(ObjectName name)
63: throws BadStringOperationException,
64: BadBinaryOpValueExpException,
65: BadAttributeValueExpException, InvalidApplicationException {
66: return this;
67: }
68:
69: }
|