| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| AttributeField |
|
| 1.0;1 |
| 1 | /** | |
| 2 | * Copyright 2005-2011 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 AttributeField { | |
| 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 getHelpConstraint(); | |
| 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 | * Whether the attribute is a required attribute. Defaults to false. | |
| 127 | * @return whether the attribute is required. | |
| 128 | */ | |
| 129 | boolean isRequired(); | |
| 130 | ||
| 131 | /** | |
| 132 | * The default values for the attribute. In the case where the "control" associated | |
| 133 | * with the attribute only allows a single default value then only one item in this list will be used. | |
| 134 | * Cannot be null. Will always return an immutable list. | |
| 135 | * | |
| 136 | * @return collection of default values | |
| 137 | */ | |
| 138 | Collection<String> getDefaultValues(); | |
| 139 | ||
| 140 | /** | |
| 141 | * The control associated with the attribute. Can be null. | |
| 142 | * @return the control. | |
| 143 | */ | |
| 144 | Control getControl(); | |
| 145 | ||
| 146 | /** | |
| 147 | * The widgets for the attribute. Will always return an immutable list. | |
| 148 | * | |
| 149 | * @return collection of widgets | |
| 150 | */ | |
| 151 | Collection<? extends Widget> getWidgets(); | |
| 152 | ||
| 153 | /** | |
| 154 | * If this method returns a non-null value, it defines various settings for this attribute whenever | |
| 155 | * it is used on a lookup. | |
| 156 | * | |
| 157 | * @return the attribute range configuration for this attribute, or null if this attribute should | |
| 158 | * not be treated as a range in a lookup | |
| 159 | */ | |
| 160 | AttributeLookupSettings getAttributeLookupSettings(); | |
| 161 | ||
| 162 | } |