1 /** 2 * Copyright 2005-2012 The Kuali Foundation 3 * 4 * Licensed under the Educational Community License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.opensource.org/licenses/ecl2.php 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package org.kuali.rice.core.api.uif; 17 18 import java.util.Collection; 19 20 /** 21 * This interface describes an attribute. It can be considered the definition for an attribute. 22 * It also contains preferred rendering instructions for an attribute. ie when rendering an attribute 23 * in a user interface use this control with these widgets. 24 */ 25 public interface RemotableAttributeFieldContract { 26 27 /** 28 * The name of the attribute. Cannot be null or blank. 29 * 30 * @return the name. 31 */ 32 String getName(); 33 34 /** 35 * The dataType of the attribute. Can be null. 36 * 37 * @return the datatype or null. 38 */ 39 DataType getDataType(); 40 41 /** 42 * The short label of the attribute. Can be null. 43 * 44 * @return the short label or null. 45 */ 46 String getShortLabel(); 47 48 /** 49 * The long label of the attribute. Can be null. 50 * 51 * @return the long label or null. 52 */ 53 String getLongLabel(); 54 55 /** 56 * The help summary of the attribute. Can be null. 57 * 58 * @return the help summary or null. 59 */ 60 String getHelpSummary(); 61 62 /** 63 * The help constraint of the attribute. Can be null. 64 * 65 * @return the help constraint or null. 66 */ 67 String getConstraintText(); 68 69 /** 70 * The help description of the attribute. Can be null. 71 * 72 * @return the help description or null. 73 */ 74 String getHelpDescription(); 75 76 /** 77 * Should the attribute always be in uppercase. Defaults to false. 78 * 79 * @return force uppercase. 80 */ 81 boolean isForceUpperCase(); 82 83 /** 84 * The inclusive minimum length of the attribute. Can be null. Cannot be less than 1. 85 * 86 * @return minimum length. 87 */ 88 Integer getMinLength(); 89 90 /** 91 * The inclusive maximum length of the attribute. Can be null. Cannot be less than 1. 92 * 93 * @return maximum length. 94 */ 95 Integer getMaxLength(); 96 97 /** 98 * The inclusive minimum value of the attribute. Can be null. 99 * 100 * @return minimum value. 101 */ 102 Double getMinValue(); 103 104 /** 105 * The inclusive maximum value of the attribute. Can be null. 106 * 107 * @return maximum value. 108 */ 109 Double getMaxValue(); 110 111 /** 112 * The regex constraint to apply to the attribute field for validation. Can be null. 113 * 114 * @return the constraint. 115 */ 116 String getRegexConstraint(); 117 118 /** 119 * The message to display if the regex constraint fails. Can be null. 120 * 121 * @return the constraint message. 122 */ 123 String getRegexContraintMsg(); 124 125 /** 126 * The name of the formatter 127 * 128 * @return the formatter name. 129 */ 130 String getFormatterName(); 131 132 133 /** 134 * Whether the attribute is a required attribute. Defaults to false. 135 * @return whether the attribute is required. 136 */ 137 boolean isRequired(); 138 139 /** 140 * The default values for the attribute. In the case where the "control" associated 141 * with the attribute only allows a single default value then only one item in this list will be used. 142 * Cannot be null. Will always return an immutable list. 143 * 144 * @return collection of default values 145 */ 146 Collection<String> getDefaultValues(); 147 148 /** 149 * The control associated with the attribute. Can be null. 150 * @return the control. 151 */ 152 RemotableControlContract getControl(); 153 154 /** 155 * The widgets for the attribute. Will always return an immutable list. 156 * 157 * @return collection of widgets 158 */ 159 Collection<? extends RemotableWidgetContract> getWidgets(); 160 161 /** 162 * If this method returns a non-null value, it defines various settings for this attribute whenever 163 * it is used on a lookup. 164 * 165 * @return the attribute range configuration for this attribute, or null if this attribute should 166 * not be treated as a range in a lookup 167 */ 168 AttributeLookupSettings getAttributeLookupSettings(); 169 170 }