org.kuali.rice.krad.data.provider.impl
Class MetadataProviderBase

java.lang.Object
  extended by org.kuali.rice.krad.data.provider.impl.MetadataProviderBase
All Implemented Interfaces:
MetadataProvider, Provider
Direct Known Subclasses:
AnnotationMetadataProviderImpl, CompositeMetadataProviderImpl, JpaMetadataProviderImpl, SpringMetadataProviderImpl

public abstract class MetadataProviderBase
extends Object
implements MetadataProvider

Superclass for all metadata providers which contain the basic operations and data structure. All each subclass needs to implement is the initializeMetadata method.


Field Summary
protected  ConcurrentHashMap<Class<?>,DataObjectMetadata> masterMetadataMap
           
 
Constructor Summary
MetadataProviderBase()
           
 
Method Summary
 DataObjectMetadata getMetadataForType(Class<?> dataObjectType)
          Obtains the metadata for a specific data type.
 Collection<Class<?>> getSupportedTypes()
          Returns a complete list of the data object types which will return data from this provider.
 boolean handles(Class<?> type)
          Indicates whether or not this provider handles metadata for the given data object type.
protected abstract  void initializeMetadata(Collection<Class<?>> types)
          Performs the initialization of the provider with the given set of types.
protected  boolean isClassPersistable(Class<?> clazz)
           
 Map<Class<?>,DataObjectMetadata> provideMetadata()
          Provides the metadata available from this provider for all of it's data objects.
 Map<Class<?>,DataObjectMetadata> provideMetadataForTypes(Collection<Class<?>> types)
          Provides the metadata for the given types.
 boolean requiresListOfExistingTypes()
          By default, providers are assumed to be able to pull the list of annotated types from somewhere.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

masterMetadataMap

protected ConcurrentHashMap<Class<?>,DataObjectMetadata> masterMetadataMap
Constructor Detail

MetadataProviderBase

public MetadataProviderBase()
Method Detail

initializeMetadata

protected abstract void initializeMetadata(Collection<Class<?>> types)
Performs the initialization of the provider with the given set of types. If the list is null or empty, the provider is expected to discover the types via other means, or do nothing if the types cannot be discovered.


handles

public boolean handles(Class<?> type)
Description copied from interface: MetadataProvider
Indicates whether or not this provider handles metadata for the given data object type.

Specified by:
handles in interface MetadataProvider
Parameters:
type - the data object type to check
Returns:
true if this provider will return any data for the given type, false otherwise

getSupportedTypes

public Collection<Class<?>> getSupportedTypes()
Description copied from interface: MetadataProvider
Returns a complete list of the data object types which will return data from this provider.

Specified by:
getSupportedTypes in interface MetadataProvider
Returns:
A non-null list of all the data object types supported by this provider.

provideMetadata

public Map<Class<?>,DataObjectMetadata> provideMetadata()
Description copied from interface: MetadataProvider
Provides the metadata available from this provider for all of it's data objects.

Specified by:
provideMetadata in interface MetadataProvider
Returns:
the metadata provided by this provider

provideMetadataForTypes

public Map<Class<?>,DataObjectMetadata> provideMetadataForTypes(Collection<Class<?>> types)
Description copied from interface: MetadataProvider
Provides the metadata for the given types.

Specified by:
provideMetadataForTypes in interface MetadataProvider
Returns:
a Map of the data object types to their metadata

getMetadataForType

public DataObjectMetadata getMetadataForType(Class<?> dataObjectType)
                                      throws IllegalArgumentException
Description copied from interface: MetadataProvider
Obtains the metadata for a specific data type.

Specified by:
getMetadataForType in interface MetadataProvider
Returns:
The metadata for the given data object or null if no metadata is available for the given type.
Throws:
IllegalArgumentException - if the data object type is null.

isClassPersistable

protected boolean isClassPersistable(Class<?> clazz)

requiresListOfExistingTypes

public boolean requiresListOfExistingTypes()
By default, providers are assumed to be able to pull the list of annotated types from somewhere.

Specified by:
requiresListOfExistingTypes in interface MetadataProvider
Returns:
true if this provider will fail when passed an empty list of entity types


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.