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 ValueExp that represents a string.
13: *
14: * @version $Revision: 1.6 $
15: */
16: public class StringValueExp implements ValueExp {
17: private static final long serialVersionUID = -3256390509806284044L;
18:
19: /**
20: * @serial The string
21: */
22: private String val;
23:
24: /**
25: * Creates a new StringValueExp with a null string
26: */
27: public StringValueExp() {
28: this (null);
29: }
30:
31: /**
32: * Creates a new StringValueExp with the given string
33: */
34: public StringValueExp(String value) {
35: this .val = value;
36: }
37:
38: /**
39: * Returns the string represented by this instance
40: */
41: public String getValue() {
42: return val;
43: }
44:
45: public ValueExp apply(ObjectName name)
46: throws BadStringOperationException,
47: BadBinaryOpValueExpException,
48: BadAttributeValueExpException, InvalidApplicationException {
49: return this ;
50: }
51:
52: public void setMBeanServer(MBeanServer server) {
53: // Not needed
54: }
55:
56: public String toString() {
57: return val;
58: }
59: }
|