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 (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright (c) 1999 by Sun Microsystems, Inc. 23 * All rights reserved. 24 * 25 */ 26 27 // ServiceLocationAttributeDescriptor.java: Describes an SLP attribute. 28 // Author: James Kempf 29 // Created On: Thu Jun 19 10:38:01 1997 30 // Last Modified By: James Kempf 31 // Last Modified On: Fri May 22 13:01:18 1998 32 // Update Count: 16 33 // 34 35 package com.sun.slp; 36 37 import java.util.*; 38 39 /** 40 * Objects implementing the <b>ServiceLocationAttributeDescriptor</b> 41 * interface return information on a particular service location attribute. 42 * This information is primarily for GUI tools. Programmatic attribute 43 * verification should be done through the 44 * <b>ServiceLocationAttributeVerifier</b>. 45 * 46 * @author James Kempf 47 * 48 */ 49 50 public interface ServiceLocationAttributeDescriptor { 51 52 /** 53 * Return the attribute's id. 54 * 55 * @return A <b>String</b> for the attribute's id. 56 */ 57 getId()58 public String getId(); 59 60 /** 61 * Return the fully qualified Java type of the attribute. SLP types 62 * are translated into Java types as follows:<br> 63 *<ol> 64 * <li><i>STRING</i> -- <i>"java.lang.String"</i></li> 65 * <li><i>INTEGER</i> -- <i>"java.lang.Integer"</i></li> 66 * <li><i>BOOLEAN</i> -- <i>"java.lang.Boolean"</i></li> 67 * <li><i>OPAQUE</i> -- <i>"[B"</i> (i.e. array of byte, 68 * <b>byte[]</b>)</li> 69 * <li><i>KEYWORD</i> -- null string, <i>""</i></li> 70 *</ol> 71 * 72 * @return A <b>String</b> containing the Java type name for the 73 * attribute values. 74 */ 75 getValueType()76 public String getValueType(); 77 78 /** 79 * Return attribute's help text. 80 * 81 * @return A <b>String</b> containing the attribute's help text. 82 */ 83 getDescription()84 public String getDescription(); 85 86 /** 87 * Return an <b>Enumeration</b> of allowed values for the attribute type. 88 * For keyword attributes returns null. For no allowed values 89 * (i.e. unrestricted) returns an empty <b>Enumeration</b>. Small memory 90 * implementations may want to parse values on demand rather 91 * than at the time the descriptor is created. 92 * 93 * @return An <b>Enumeration</b> of allowed values for the attribute, 94 * or null if the attribute is keyword. 95 */ 96 getAllowedValues()97 public Enumeration getAllowedValues(); 98 99 /** 100 * Return an <b>Enumeration</b> of default values for the attribute type. 101 * For keyword attributes returns null. For no allowed values 102 * (i.e. unrestricted) returns an empty <b>Enumeration</b>. Small memory 103 * implementations may want to parse values on demand rather 104 * than at the time the descriptor is created. 105 * 106 * @return An <b>Enumeration</b> of default values for the attribute or 107 * null if the attribute is keyword. 108 */ 109 getDefaultValues()110 public Enumeration getDefaultValues(); 111 112 /** 113 * Returns true if the <i>"M"</i> flag is set. 114 * 115 * @return True if the <i>"M"</i> flag is set. 116 */ 117 getIsMultivalued()118 public boolean getIsMultivalued(); 119 120 /** 121 * Returns true if the <i>"O"</i>" flag is set. 122 * 123 * @return True if the <i>"O"</i>" flag is set. 124 */ 125 getIsOptional()126 public boolean getIsOptional(); 127 128 /** 129 * Returns true if the <i>"X"</i>" flag is set. 130 * 131 * @return True if the <i>"X"</i> flag is set. 132 */ 133 getRequiresExplicitMatch()134 public boolean getRequiresExplicitMatch(); 135 136 /** 137 * Returns true if the <i>"L"</i> flag is set. 138 * 139 * @return True if the <i>"L"</i> flag is set. 140 */ 141 getIsLiteral()142 public boolean getIsLiteral(); 143 144 /** 145 * Returns <i>true</i> if the attribute is a keyword attribute. 146 * 147 * @return <i>true</i> if the attribute is a keyword attribute 148 */ 149 getIsKeyword()150 public boolean getIsKeyword(); 151 152 } 153