View Javadoc

1   /**
2    * Copyright 2005-2013 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  import org.kuali.rice.core.api.data.DataType;
21  
22  /**
23   * This interface describes an attribute.  It can be considered the definition for an attribute.
24   * It also contains preferred rendering instructions for an attribute. ie when rendering an attribute
25   * in a user interface use this control with these widgets.
26   */
27  public interface RemotableAttributeFieldContract {
28  
29      /**
30       * The name of the attribute.  Cannot be null or blank.
31       *
32       * @return the name.
33       */
34      String getName();
35  
36      /**
37       * The dataType of the attribute. Can be null.
38       *
39       * @return the datatype or null.
40       */
41      DataType getDataType();
42  
43      /**
44       * The short label of the attribute. Can be null.
45       *
46       * @return the short label or null.
47       */
48      String getShortLabel();
49  
50      /**
51       * The long label of the attribute. Can be null.
52       *
53       * @return the long label or null.
54       */
55      String getLongLabel();
56  
57      /**
58       * The help summary of the attribute. Can be null.
59       *
60       * @return the help summary or null.
61       */
62      String getHelpSummary();
63  
64      /**
65       * The help constraint of the attribute. Can be null.
66       *
67       * @return the help constraint or null.
68       */
69      String getConstraintText();
70  
71      /**
72       * The help description of the attribute. Can be null.
73       *
74       * @return the help description or null.
75       */
76      String getHelpDescription();
77  
78      /**
79       * Should the attribute always be in uppercase. Defaults to false.
80       *
81       * @return force uppercase.
82       */
83      boolean isForceUpperCase();
84  
85      /**
86       * The inclusive minimum length of the attribute. Can be null. Cannot be less than 1.
87       *
88       * @return minimum length.
89       */
90      Integer getMinLength();
91  
92      /**
93       * The inclusive maximum length of the attribute. Can be null. Cannot be less than 1.
94       *
95       * @return maximum length.
96       */
97      Integer getMaxLength();
98  
99      /**
100      * The inclusive minimum value of the attribute. Can be null.
101      *
102      * @return minimum value.
103      */
104     Double getMinValue();
105 
106     /**
107      * The inclusive maximum value of the attribute. Can be null.
108      *
109      * @return maximum value.
110      */
111     Double getMaxValue();
112 
113     /**
114      * The regex constraint to apply to the attribute field for validation. Can be null.
115      *
116      * @return the constraint.
117      */
118     String getRegexConstraint();
119 
120     /**
121      * The message to display if the regex constraint fails. Can be null.
122      *
123      * @return the constraint message.
124      */
125     String getRegexContraintMsg();
126 
127     /**
128         * The name of the formatter
129         *
130         * @return the formatter name.
131         */
132        String getFormatterName();
133 
134 
135     /**
136      * Whether the attribute is a required attribute. Defaults to false.
137      * @return whether the attribute is required.
138      */
139     boolean isRequired();
140 
141     /**
142      * The default values for the attribute.  In the case where the "control" associated
143      * with the attribute only allows a single default value then only one item in this list will be used.
144      * Cannot be null.  Will always return an immutable list.
145      *
146      * @return collection of default values
147      */
148     Collection<String> getDefaultValues();
149 
150     /**
151      * The control associated with the attribute.  Can be null.
152      * @return the control.
153      */
154     RemotableControlContract getControl();
155 
156     /**
157      * The widgets for the attribute. Will always return an immutable list.
158      *
159      * @return collection of widgets
160      */
161     Collection<? extends RemotableWidgetContract> getWidgets();
162 
163     /**
164      * If this method returns a non-null value, it defines various settings for this attribute whenever
165      * it is used on a lookup.
166      *
167      * @return the attribute range configuration for this attribute, or null if this attribute should
168      * not be treated as a range in a lookup
169      */
170     AttributeLookupSettings getAttributeLookupSettings();
171 
172 }