KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > javax > management > StringValueExp


1 /*
2  * @(#)StringValueExp.java 4.19 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package javax.management;
9
10
11
12 /**
13  * Represents strings that are arguments to relational constraints.
14  * A <CODE>StringValueExp</CODE> may be used anywhere a <CODE>ValueExp</CODE> is required.
15  *
16  * @since 1.5
17  */

18 public class StringValueExp implements ValueExp JavaDoc {
19     
20     /* Serial version */
21     private static final long serialVersionUID = -3256390509806284044L;
22
23     /**
24      * @serial The string literal
25      */

26     private String JavaDoc val;
27
28     /**
29      * Basic constructor.
30      */

31     public StringValueExp() {
32     }
33
34     /**
35      * Creates a new <CODE>StringValueExp</CODE> representing the
36      * given string.
37      *
38      * @param val the string that will be the value of this expression
39      */

40     public StringValueExp(String JavaDoc val) {
41     this.val = val;
42     }
43
44     /**
45      * Returns the string represented by the
46      * <CODE>StringValueExp</CODE> instance.
47      *
48      * @return the string.
49      */

50     public String JavaDoc getValue() {
51     return val;
52     }
53
54     /**
55      * Returns the string representing the object.
56      */

57     public String JavaDoc toString() {
58     return "'" + val + "'";
59     }
60    
61
62     /**
63      * Sets the MBean server on which the query is to be performed.
64      *
65      * @param s The MBean server on which the query is to be performed.
66      */

67     public void setMBeanServer(MBeanServer JavaDoc s) { }
68
69     /**
70      * Applies the ValueExp on a MBean.
71      *
72      * @param name The name of the MBean on which the ValueExp will be applied.
73      *
74      * @return The <CODE>ValueExp</CODE>.
75      *
76      * @exception BadStringOperationException
77      * @exception BadBinaryOpValueExpException
78      * @exception BadAttributeValueExpException
79      * @exception InvalidApplicationException
80      */

81     public ValueExp JavaDoc apply(ObjectName JavaDoc name) throws BadStringOperationException JavaDoc, BadBinaryOpValueExpException JavaDoc,
82     BadAttributeValueExpException JavaDoc, InvalidApplicationException JavaDoc {
83     return this;
84     }
85  }
86
Popular Tags