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.datadictionary;
017
018import java.util.List;
019
020
021/**
022 * Defines methods common to all DataDictionaryDefinition types.
023 * 
024 *     DD: The highest level objects in the data dictionary are of
025        the following types:
026        * BusinessObjectEntry
027        * MaintenanceDocumentEntry
028        * TransactionalDocumentEntry
029
030    JSTL: The data dictionary is exposed as a Map which is accessed
031    by referring to the "DataDictionary" global constant.  This Map contains
032    the following kinds of entries keyed as indicated:
033        * Business Object Entries -
034            Key = dataObjectClass name
035            Value = Map created by BusinessObjectEntryMapper
036        * Maintenance Document entries -
037            Key = DocumentType name
038            Value = Map created by MaintenanceObjectEntryMapper
039        * Transactional Document entries -
040            Key = DocumentType name
041            Value = Map created by TransactionalDocumentEntryMapper
042
043    All elements are exposed to JSTL as Maps (where the element has a
044    unique key by which they can be retrieved), or Strings.  For collections
045    of elements having no unique key, the entry's position in the list
046    (0, 1, etc.) is used as its index.
047
048    All Maps (except the top-level DataDictionary one) are guaranteed to
049    present their entries with an iteration order identical to the order
050    in which the elements were defined in XML.
051
052 */
053public interface DataDictionaryEntry {
054    /**
055     * @return String used as a globally-unique key for this entry's jstl-exported version
056     */
057    public String getJstlKey();
058
059    /**
060     * Kicks off complete entry-wide validation which couldn't be done earlier.
061     * 
062     * @throws org.kuali.rice.krad.datadictionary.exception.CompletionException if a problem arises during validation-completion
063     */
064    public void completeValidation();
065
066    /**
067     * @param attributeName
068     * @return AttributeDefinition with the given name, or null if none with that name exists
069     */
070    public AttributeDefinition getAttributeDefinition(String attributeName);
071
072    /**
073     * Returns the full class name of the underlying object.
074     */
075    public String getFullClassName();
076    
077    /**
078     * @return a Map containing all RelationshipDefinitions associated with this BusinessObjectEntry, indexed by relationshipName
079     */
080    public List<RelationshipDefinition> getRelationships();
081}