1 /*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22 /*
23 * ident "%Z%%M% %I% %E% SMI"
24 *
25 * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
27 */
28
29 package com.sun.dhcpmgr.data.qualifier;
30
31 /**
32 * Common interface that all concrete qualifiers can implement. A qualifier
33 * contains information about a given parameter. This information includes the
34 * parameter type and whether the parameter is read only.
35 */
36 public interface Qualifier {
37
38 /**
39 * Attribute that indicates the name of the parameter the qualifier is
40 * associated with.
41 */
42 public final static String KEYWORD = "keyword";
43
44 /**
45 * Attribute that indicates the Java type that can store a legal value for
46 * the parameter.
47 */
48 public final static String TYPE = "type";
49
50 /**
51 * Attribute that indicates whether the parameter is designated as read
52 * only.
53 */
54 public final static String READONLY = "readOnly";
55
56 /**
57 * Attribute that indicates whether the parameter is hidden.
58 */
59 public final static String HIDDEN = "hidden";
60
61 /**
62 * Get the named qualifier attribute.
63 *
64 * @param attribute
65 * Attribute to get.
66 * @return
67 * The value of the attribute, or null if the attribute is not set.
68 */
69 public Object getAttribute(String attribute);
70
71 /**
72 * Set the named qualifier attributes value.
73 *
74 * @param attribute
75 * Attribute to set.
76 * @param value
77 * The value to set the attribute to, or null if the attribute is to
78 * be removed.
79 */
80 public void setAttribute(String attribute, Object value);
81
82 /**
83 * Get the name of the parameter this qualifier is connected to.
84 * Convenience method for obtaining the KEYWORD attribute.
85 *
86 * @return
87 * String containing the name of the parameter.
88 */
89 public String getKeyword();
90
91 /**
92 * Indicates whether the parameter is designated as read only.
93 * Convenience method for obtaining the READONLY attribute.
94 *
95 * @return
96 * True if the parameter is read only, otherwise false.
97 */
98 public boolean isReadOnly();
99
100 /**
101 * Indicates whether the parameter is hidden.
102 * Convenience method for obtaining the HIDDEN attribute.
103 *
104 * @return
105 * True if the parameter is hidden, otherwise false.
106 */
107 public boolean isHidden();
108
109 /**
110 * Get the Java type that can store a legal value for the parameter.
111 * Primitive Java types have their counterpart wrapper classes returned.
112 * For example for an int the Integer class is returned.
113 * Convenience method for obtaining the TYPE attribute.
114 *
115 * @return
116 * A class that can store legal parameter values.
117 */
118 public QualifierType getType();
119
120 }