001/**
002 * Copyright 2005-2018 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
020import org.kuali.rice.krad.datadictionary.state.StateMapping;
021import org.kuali.rice.krad.datadictionary.validator.ValidationTrace;
022
023/**
024 * Defines methods common to all DataDictionaryDefinition types.
025 *
026 * DD: The highest level objects in the data dictionary are of
027 * the following types:
028 * BusinessObjectEntry
029 * MaintenanceDocumentEntry
030 * TransactionalDocumentEntry
031 *
032 * JSTL: The data dictionary is exposed as a Map which is accessed
033 * by referring to the "DataDictionary" global constant.  This Map contains
034 * the following kinds of entries keyed as indicated:
035 * Business Object Entries -
036 * Key = dataObjectClass name
037 * Value = Map created by BusinessObjectEntryMapper
038 * Maintenance Document entries -
039 * Key = DocumentType name
040 * Value = Map created by MaintenanceObjectEntryMapper
041 * Transactional Document entries -
042 * Key = DocumentType name
043 * Value = Map created by TransactionalDocumentEntryMapper
044 *
045 * All elements are exposed to JSTL as Maps (where the element has a
046 * unique key by which they can be retrieved), or Strings.  For collections
047 * of elements having no unique key, the entry's position in the list
048 * (0, 1, etc.) is used as its index.
049 *
050 * All Maps (except the top-level DataDictionary one) are guaranteed to
051 * present their entries with an iteration order identical to the order
052 * in which the elements were defined in XML.
053 */
054public interface DataDictionaryEntry extends DictionaryBean {
055    /**
056     * @return String used as a globally-unique key for this entry's jstl-exported version
057     */
058    public String getJstlKey();
059
060    /**
061     * Kicks off complete entry-wide validation which couldn't be done earlier.
062     *
063     * @throws org.kuali.rice.krad.datadictionary.exception.CompletionException if a problem arises during
064     * validation-completion
065     */
066    @Deprecated // KNS Version
067    public void completeValidation();
068
069    /**
070     * Validates that the data objects created from the Spring Beans are correct
071     *
072     * @param tracer - Record of object's location
073     */
074    public void completeValidation(ValidationTrace tracer);
075
076    /**
077     * @param attributeName
078     * @return AttributeDefinition with the given name, or null if none with that name exists
079     */
080    public AttributeDefinition getAttributeDefinition(String attributeName);
081
082    /**
083     * Returns the full class name of the underlying object.
084     */
085    public String getFullClassName();
086
087    /**
088     * @return a Map containing all RelationshipDefinitions associated with this BusinessObjectEntry, indexed by
089     *         relationshipName
090     */
091    public List<RelationshipDefinition> getRelationships();
092
093    /**
094     * StateMapping for this DataDictionaryEntry, this represents the states of this entry, their names, and where
095     * to find the state information on the model
096     *
097     * @return StateMapping object
098     */
099    public StateMapping getStateMapping();
100
101    /**
102     * Set the StateMapping object which represents state information for this entry
103     *
104     * @param stateMapping StateMapping object
105     */
106    public void setStateMapping(StateMapping stateMapping);
107}