1 /**
2 * Copyright 2005-2014 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.krad.data.metadata;
17
18 import java.util.List;
19
20 /**
21 * Collection metadata
22 *
23 * <p>
24 * Represents the metadata for a collection within a data object.
25 * </p>
26 *
27 * @author Kuali Rice Team (rice.collab@kuali.org)
28 */
29 public interface DataObjectCollection extends MetadataChild {
30
31 /**
32 * Gets name of single object in collection
33 *
34 * <p>
35 * The elementLabel defines the name to be used for a single object within the collection. For example:
36 * "Address" may be the name of one object within the "Addresses" collection.
37 * </p>
38 *
39 * return name of single object in collection
40 */
41 String getElementLabel();
42
43 /**
44 * Gets the minimum number of items which may be in the collection.
45 *
46 * <p>
47 * This is an optional attribute and may not be set by the metadata provider.
48 * </p>
49 *
50 * @return The minimum number of items which must be in this collection or <b>null</b> if unset.
51 */
52 Long getMinItems();
53
54 /**
55 * The maximum number of items which may be in the collection.
56 *
57 * <p>
58 * This is an optional attribute and may not be set by the metadata provider.
59 * </p>
60 *
61 * @return The maximum number of items which may be in this collection or <b>null</b> if unset.
62 */
63 Long getMaxItems();
64
65 /**
66 * Gets the default ordering of a collection.
67 *
68 * <p>
69 * The default ordering of collection items as specified by the metadata provider.
70 * </p>
71 *
72 * @return The list of fields in order by which to sort, or an empty list if none specified.
73 */
74 List<DataObjectCollectionSortAttribute> getDefaultOrdering();
75
76 /**
77 * Determines whether a linked objected is used.
78 *
79 * <p>
80 * Whether the referenced collection uses a linking object in the underlying implementation. (In case that is
81 * somehow important to using code.).
82 * </p>
83 *
84 * @return whether a linked object is used
85 */
86 boolean isIndirectCollection();
87 }