xref: /illumos-gate/usr/src/lib/libslp/javalib/com/sun/slp/ServiceLocationAttributeDescriptor.java (revision 355b4669e025ff377602b6fc7caaf30dbc218371)
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 (c) 1999 by Sun Microsystems, Inc.
26  * All rights reserved.
27  *
28  */
29 
30 //  SCCS Status:      %W%	%G%
31 //  ServiceLocationAttributeDescriptor.java: Describes an SLP attribute.
32 //  Author:           James Kempf
33 //  Created On:       Thu Jun 19 10:38:01 1997
34 //  Last Modified By: James Kempf
35 //  Last Modified On: Fri May 22 13:01:18 1998
36 //  Update Count:     16
37 //
38 
39 package com.sun.slp;
40 
41 import java.util.*;
42 
43 /**
44  * Objects implementing the <b>ServiceLocationAttributeDescriptor</b>
45  * interface return information on a particular service location attribute.
46  * This information is primarily for GUI tools. Programmatic attribute
47  * verification should be done through the
48  * <b>ServiceLocationAttributeVerifier</b>.
49  *
50  * @version %R%.%L% %D%
51  * @author James Kempf
52  *
53  */
54 
55 public interface ServiceLocationAttributeDescriptor {
56 
57     /**
58      * Return the attribute's id.
59      *
60      * @return A <b>String</b> for the attribute's id.
61      */
62 
63     public String getId();
64 
65     /**
66      * Return the fully qualified Java type of the attribute. SLP types
67      * are translated into Java types as follows:<br>
68      *<ol>
69      *	<li><i>STRING</i> -- <i>"java.lang.String"</i></li>
70      *	<li><i>INTEGER</i> -- <i>"java.lang.Integer"</i></li>
71      *	<li><i>BOOLEAN</i> -- <i>"java.lang.Boolean"</i></li>
72      *	<li><i>OPAQUE</i> --  <i>"[B"</i> (i.e. array of byte,
73      *			      <b>byte[]</b>)</li>
74      *	<li><i>KEYWORD</i> -- null string, <i>""</i></li>
75      *</ol>
76      *
77      * @return A <b>String</b> containing the Java type name for the
78      *	      attribute values.
79      */
80 
81     public String getValueType();
82 
83     /**
84      * Return attribute's help text.
85      *
86      * @return A <b>String</b> containing the attribute's help text.
87      */
88 
89     public String getDescription();
90 
91     /**
92      * Return an <b>Enumeration</b> of allowed values for the attribute type.
93      * For keyword attributes returns null. For no allowed values
94      * (i.e. unrestricted) returns an empty <b>Enumeration</b>. Small memory
95      * implementations may want to parse values on demand rather
96      * than at the time the descriptor is created.
97      *
98      * @return An <b>Enumeration</b> of allowed values for the attribute,
99      *         or null if the attribute is keyword.
100      */
101 
102     public Enumeration getAllowedValues();
103 
104     /**
105      * Return an <b>Enumeration</b> of default values for the attribute type.
106      * For keyword attributes returns null. For no allowed values
107      * (i.e. unrestricted) returns an empty <b>Enumeration</b>. Small memory
108      * implementations may want to parse values on demand rather
109      * than at the time the descriptor is created.
110      *
111      * @return An <b>Enumeration</b> of default values for the attribute or
112      *         null if the attribute is keyword.
113      */
114 
115     public Enumeration getDefaultValues();
116 
117     /**
118      * Returns true if the <i>"M"</i> flag is set.
119      *
120      * @return True if the <i>"M"</i> flag is set.
121      */
122 
123     public boolean getIsMultivalued();
124 
125     /**
126      * Returns true if the <i>"O"</i>" flag is set.
127      *
128      * @return True if the <i>"O"</i>" flag is set.
129      */
130 
131     public boolean getIsOptional();
132 
133     /**
134      * Returns true if the <i>"X"</i>" flag is set.
135      *
136      * @return True if the <i>"X"</i> flag is set.
137      */
138 
139     public boolean getRequiresExplicitMatch();
140 
141     /**
142      * Returns true if the <i>"L"</i> flag is set.
143      *
144      * @return True if the <i>"L"</i> flag is set.
145      */
146 
147     public boolean getIsLiteral();
148 
149     /**
150      * Returns <i>true</i> if the attribute is a keyword attribute.
151      *
152      * @return <i>true</i> if the attribute is a keyword attribute
153      */
154 
155     public boolean getIsKeyword();
156 
157 }
158