1 /**
2 * Copyright 2005-2012 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.datadictionary;
17
18 import org.kuali.rice.krad.datadictionary.state.StateMapping;
19 import org.kuali.rice.krad.datadictionary.validator.ValidationTrace;
20
21 import java.util.List;
22
23 /**
24 * Defines methods common to all DataDictionaryDefinition types.
25 *
26 * DD: The highest level objects in the data dictionary are of
27 * the following types:
28 * BusinessObjectEntry
29 * MaintenanceDocumentEntry
30 * TransactionalDocumentEntry
31 *
32 * JSTL: The data dictionary is exposed as a Map which is accessed
33 * by referring to the "DataDictionary" global constant. This Map contains
34 * the following kinds of entries keyed as indicated:
35 * Business Object Entries -
36 * Key = dataObjectClass name
37 * Value = Map created by BusinessObjectEntryMapper
38 * Maintenance Document entries -
39 * Key = DocumentType name
40 * Value = Map created by MaintenanceObjectEntryMapper
41 * Transactional Document entries -
42 * Key = DocumentType name
43 * Value = Map created by TransactionalDocumentEntryMapper
44 *
45 * All elements are exposed to JSTL as Maps (where the element has a
46 * unique key by which they can be retrieved), or Strings. For collections
47 * of elements having no unique key, the entry's position in the list
48 * (0, 1, etc.) is used as its index.
49 *
50 * All Maps (except the top-level DataDictionary one) are guaranteed to
51 * present their entries with an iteration order identical to the order
52 * in which the elements were defined in XML.
53 */
54 public interface DataDictionaryEntry extends DictionaryBean {
55 /**
56 * @return String used as a globally-unique key for this entry's jstl-exported version
57 */
58 public String getJstlKey();
59
60 /**
61 * Kicks off complete entry-wide validation which couldn't be done earlier.
62 *
63 * @throws org.kuali.rice.krad.datadictionary.exception.CompletionException if a problem arises during
64 * validation-completion
65 */
66 public void completeValidation();
67
68 /**
69 * Validates that the data objects created from the Spring Beans are correct
70 *
71 * @param tracer - Record of object's location
72 */
73 public void completeValidation(ValidationTrace tracer);
74
75 /**
76 * @param attributeName
77 * @return AttributeDefinition with the given name, or null if none with that name exists
78 */
79 public AttributeDefinition getAttributeDefinition(String attributeName);
80
81 /**
82 * Returns the full class name of the underlying object.
83 */
84 public String getFullClassName();
85
86 /**
87 * @return a Map containing all RelationshipDefinitions associated with this BusinessObjectEntry, indexed by
88 * relationshipName
89 */
90 public List<RelationshipDefinition> getRelationships();
91
92 /**
93 * StateMapping for this DataDictionaryEntry, this represents the states of this entry, their names, and where
94 * to find the state information on the model
95 *
96 * @return StateMapping object
97 */
98 public StateMapping getStateMapping();
99
100 /**
101 * Set the StateMapping object which represents state information for this entry
102 *
103 * @param stateMapping StateMapping object
104 */
105 public void setStateMapping(StateMapping stateMapping);
106 }