org.kuali.rice.kns.datadictionary
Class DataDictionary

java.lang.Object
  extended by org.kuali.rice.kns.datadictionary.DataDictionary
Direct Known Subclasses:
ReloadingDataDictionary

public class DataDictionary
extends Object

Collection of named BusinessObjectEntry objects, each of which contains information relating to the display, validation, and general maintenance of a BusinessObject.


Field Summary
private static Map<String,Map<String,PropertyDescriptor>> cache
           
protected  List<String> configFileLocations
           
protected  org.springframework.beans.factory.support.DefaultListableBeanFactory ddBeans
           
protected  DataDictionaryIndex ddIndex
          The encapsulation of DataDictionary indices
protected  DataDictionaryMapper ddMapper
          The DataDictionaryMapper The default mapper simply consults the initialized indices on workflow document type
private static org.apache.commons.logging.Log LOG
           
static PersistenceStructureService persistenceStructureService
           
protected  UifDictionaryIndex uifIndex
           
(package private) static boolean validateEBOs
           
protected  org.springframework.beans.factory.xml.XmlBeanDefinitionReader xmlReader
           
 
Constructor Summary
DataDictionary()
           
 
Method Summary
 void addConfigFileLocation(String location)
           
static PropertyDescriptor buildReadDescriptor(Class propertyClass, String propertyName)
           
static PropertyDescriptor buildSimpleReadDescriptor(Class propertyClass, String propertyName)
           
 Set<InactivationBlockingMetadata> getAllInactivationBlockingMetadatas(Class blockedClass)
           
static Class getAttributeClass(Class boClass, String attributeName)
          This method determines the Class of the attributeName passed in.
private static Class getAttributeClassWhenBOIsClass(Class boClass, String attributeName)
          This method gets the property type of the given attributeName when the bo class is a concrete class
private static Class getAttributeClassWhenBOIsInterface(Class boClass, String attributeName)
          This method gets the property type of the given attributeName when the bo class is an interface This method will also work if the bo class is not an interface, but that case requires special handling, hence a separate method getAttributeClassWhenBOIsClass
 List<String> getBusinessObjectClassNames()
           
 Map<String,BusinessObjectEntry> getBusinessObjectEntries()
           
 BusinessObjectEntry getBusinessObjectEntry(String className)
          Deprecated. 
 BusinessObjectEntry getBusinessObjectEntryForConcreteClass(String className)
          This method gets the business object entry for a concrete class
static Class getCollectionElementClass(Class boClass, String collectionName)
          This method determines the Class of the elements in the collectionName passed in.
 List<String> getConfigFileLocations()
           
 DataObjectEntry getDataObjectEntry(String className)
           
 DataDictionaryEntry getDictionaryObjectEntry(String className)
           
 Map<String,DocumentEntry> getDocumentEntries()
           
 DocumentEntry getDocumentEntry(String documentTypeDDKey)
          Returns the KNS document entry for the given lookup key.
protected  org.springframework.core.io.Resource getFileResource(String sourceName)
           
 MaintenanceDocumentEntry getMaintenanceDocumentEntryForBusinessObjectClass(Class<?> businessObjectClass)
          Note: only MaintenanceDocuments are indexed by businessObject Class This is a special case that is referenced in one location.
static PersistenceStructureService getPersistenceStructureService()
           
 View getViewById(String viewId)
          Returns the View entry identified by the given id
 View getViewByTypeIndex(String viewTypeName, Map<String,String> indexKey)
          Returns View instance identified by the view type name and index
 List<View> getViewsForType(String viewTypeName)
          Gets all View prototypes configured for the given view type name
private  void indexSource(File dir)
           
private  void indexSource(String sourceName)
           
static boolean isCollectionPropertyOf(Class targetClass, String propertyName)
           
static boolean isPropertyOf(Class targetClass, String propertyName)
           
 void parseDataDictionaryConfigurationFiles(boolean allowConcurrentValidation)
           
 void performBeanOverrides()
          This method gathers beans of type BeanOverride and invokes each one's performOverride() method.
 void setConfigFileLocations(List<String> configFileLocations)
           
 void setDataDictionaryMapper(DataDictionaryMapper mapper)
          Sets the DataDictionaryMapper
 void validateDD()
           
 void validateDD(boolean validateEbos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ddBeans

protected org.springframework.beans.factory.support.DefaultListableBeanFactory ddBeans

xmlReader

protected org.springframework.beans.factory.xml.XmlBeanDefinitionReader xmlReader

LOG

private static final org.apache.commons.logging.Log LOG

ddIndex

protected DataDictionaryIndex ddIndex
The encapsulation of DataDictionary indices


uifIndex

protected UifDictionaryIndex uifIndex

ddMapper

protected DataDictionaryMapper ddMapper
The DataDictionaryMapper The default mapper simply consults the initialized indices on workflow document type


configFileLocations

protected List<String> configFileLocations

validateEBOs

static boolean validateEBOs

persistenceStructureService

public static PersistenceStructureService persistenceStructureService

cache

private static Map<String,Map<String,PropertyDescriptor>> cache
Constructor Detail

DataDictionary

public DataDictionary()
Method Detail

getConfigFileLocations

public List<String> getConfigFileLocations()

setConfigFileLocations

public void setConfigFileLocations(List<String> configFileLocations)

addConfigFileLocation

public void addConfigFileLocation(String location)
                           throws IOException
Throws:
IOException

setDataDictionaryMapper

public void setDataDictionaryMapper(DataDictionaryMapper mapper)
Sets the DataDictionaryMapper

Parameters:
mapper - the datadictionary mapper

indexSource

private void indexSource(String sourceName)
                  throws IOException
Throws:
IOException

getFileResource

protected org.springframework.core.io.Resource getFileResource(String sourceName)

indexSource

private void indexSource(File dir)

parseDataDictionaryConfigurationFiles

public void parseDataDictionaryConfigurationFiles(boolean allowConcurrentValidation)

validateDD

public void validateDD(boolean validateEbos)

validateDD

public void validateDD()

getBusinessObjectEntry

@Deprecated
public BusinessObjectEntry getBusinessObjectEntry(String className)
Deprecated. 

Parameters:
className -
Returns:
BusinessObjectEntry for the named class, or null if none exists

getDataObjectEntry

public DataObjectEntry getDataObjectEntry(String className)
Parameters:
className -
Returns:
BusinessObjectEntry for the named class, or null if none exists

getBusinessObjectEntryForConcreteClass

public BusinessObjectEntry getBusinessObjectEntryForConcreteClass(String className)
This method gets the business object entry for a concrete class

Parameters:
className -
Returns:

getBusinessObjectClassNames

public List<String> getBusinessObjectClassNames()
Returns:
List of businessObject classnames

getBusinessObjectEntries

public Map<String,BusinessObjectEntry> getBusinessObjectEntries()
Returns:
Map of (classname, BusinessObjectEntry) pairs

getDictionaryObjectEntry

public DataDictionaryEntry getDictionaryObjectEntry(String className)
Parameters:
className -
Returns:
DataDictionaryEntryBase for the named class, or null if none exists

getDocumentEntry

public DocumentEntry getDocumentEntry(String documentTypeDDKey)
Returns the KNS document entry for the given lookup key. The documentTypeDDKey is interpreted successively in the following ways until a mapping is found (or none if found):
  1. KEW/workflow document type
  2. business object class name
  3. maintainable class name
This mapping is compiled when DataDictionary files are parsed on startup (or demand). Currently this means the mapping is static, and one-to-one (one KNS document maps directly to one and only one key).

Parameters:
documentTypeDDKey - the KEW/workflow document type name
Returns:
the KNS DocumentEntry if it exists

getMaintenanceDocumentEntryForBusinessObjectClass

public MaintenanceDocumentEntry getMaintenanceDocumentEntryForBusinessObjectClass(Class<?> businessObjectClass)
Note: only MaintenanceDocuments are indexed by businessObject Class This is a special case that is referenced in one location. Do we need another map for this stuff??

Parameters:
businessObjectClass -
Returns:
DocumentEntry associated with the given Class, or null if there is none

getDocumentEntries

public Map<String,DocumentEntry> getDocumentEntries()

getViewById

public View getViewById(String viewId)
Returns the View entry identified by the given id

Parameters:
viewId - - unique id for view
Returns:
View instance associated with the id

getViewByTypeIndex

public View getViewByTypeIndex(String viewTypeName,
                               Map<String,String> indexKey)
Returns View instance identified by the view type name and index

Parameters:
viewTypeName - - type name for the view
indexKey - - Map of index key parameters, these are the parameters the indexer used to index the view initially and needs to identify an unique view instance
Returns:
View instance that matches the given index

getViewsForType

public List<View> getViewsForType(String viewTypeName)
Gets all View prototypes configured for the given view type name

Parameters:
viewTypeName - - view type name to retrieve
Returns:
List view prototypes with the given type name, or empty list

isPropertyOf

public static boolean isPropertyOf(Class targetClass,
                                   String propertyName)
Parameters:
clazz -
propertyName -
Returns:
true if the given propertyName names a property of the given class
Throws:
CompletionException - if there is a problem accessing the named property on the given class

isCollectionPropertyOf

public static boolean isCollectionPropertyOf(Class targetClass,
                                             String propertyName)
Parameters:
clazz -
propertyName -
Returns:
true if the given propertyName names a Collection property of the given class
Throws:
CompletionException - if there is a problem accessing the named property on the given class

getPersistenceStructureService

public static PersistenceStructureService getPersistenceStructureService()
Returns:
the persistenceStructureService

getAttributeClass

public static Class getAttributeClass(Class boClass,
                                      String attributeName)
This method determines the Class of the attributeName passed in. Null will be returned if the member is not available, or if a reflection exception is thrown.

Parameters:
rootClass - - Class that the attributeName property exists in.
attributeName - - Name of the attribute you want a class for.
Returns:
The Class of the attributeName, if the attribute exists on the rootClass. Null otherwise.

getAttributeClassWhenBOIsClass

private static Class getAttributeClassWhenBOIsClass(Class boClass,
                                                    String attributeName)
This method gets the property type of the given attributeName when the bo class is a concrete class

Parameters:
boClass -
attributeName -
Returns:

getAttributeClassWhenBOIsInterface

private static Class getAttributeClassWhenBOIsInterface(Class boClass,
                                                        String attributeName)
This method gets the property type of the given attributeName when the bo class is an interface This method will also work if the bo class is not an interface, but that case requires special handling, hence a separate method getAttributeClassWhenBOIsClass

Parameters:
boClass -
attributeName -
Returns:

getCollectionElementClass

public static Class getCollectionElementClass(Class boClass,
                                              String collectionName)
This method determines the Class of the elements in the collectionName passed in.

Parameters:
boClass - Class that the collectionName collection exists in.
collectionName - the name of the collection you want the element class for
Returns:

buildReadDescriptor

public static PropertyDescriptor buildReadDescriptor(Class propertyClass,
                                                     String propertyName)
Parameters:
propertyClass -
propertyName -
Returns:
PropertyDescriptor for the getter for the named property of the given class, if one exists.

buildSimpleReadDescriptor

public static PropertyDescriptor buildSimpleReadDescriptor(Class propertyClass,
                                                           String propertyName)
Parameters:
propertyClass -
propertyName -
Returns:
PropertyDescriptor for the getter for the named property of the given class, if one exists.

getAllInactivationBlockingMetadatas

public Set<InactivationBlockingMetadata> getAllInactivationBlockingMetadatas(Class blockedClass)

performBeanOverrides

public void performBeanOverrides()
This method gathers beans of type BeanOverride and invokes each one's performOverride() method.



Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.