001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.krad.data.metadata;
017
018import java.util.List;
019
020/**
021* Collection metadata
022*
023* <p>
024* Represents the metadata for a collection within a data object.
025* </p>
026*
027* @author Kuali Rice Team (rice.collab@kuali.org)
028*/
029public interface DataObjectCollection extends MetadataChild {
030
031    /**
032    * Gets name of single object in collection
033    *
034    * <p>
035    * The elementLabel defines the name to be used for a single object within the collection. For example:
036    * "Address" may be the name of one object within the "Addresses" collection.
037    * </p>
038    *
039    * return name of single object in collection
040    */
041        String getElementLabel();
042
043    /**
044    * Gets the minimum number of items which may be in the collection.
045    *
046    * <p>
047    * This is an optional attribute and may not be set by the metadata provider.
048    * </p>
049    *
050    * @return The minimum number of items which must be in this collection or <b>null</b> if unset.
051    */
052        Long getMinItems();
053
054    /**
055    * The maximum number of items which may be in the collection.
056    *
057    * <p>
058    * This is an optional attribute and may not be set by the metadata provider.
059    * </p>
060    *
061    * @return The maximum number of items which may be in this collection or <b>null</b> if unset.
062    */
063        Long getMaxItems();
064
065    /**
066    * Gets the default ordering of a collection.
067    *
068    * <p>
069    * The default ordering of collection items as specified by the metadata provider.
070    * </p>
071    *
072    * @return The list of fields in order by which to sort, or an empty list if none specified.
073    */
074        List<DataObjectCollectionSortAttribute> getDefaultOrdering();
075
076    /**
077    * Determines whether a linked objected is used.
078    *
079    * <p>
080    * Whether the referenced collection uses a linking object in the underlying implementation. (In case that is
081    * somehow important to using code.).
082    * </p>
083    *
084    * @return whether a linked object is used
085    */
086        boolean isIndirectCollection();
087}