public abstract class MetadataProviderBase extends Object implements MetadataProvider
All each subclass needs to implement is the initializeMetadata method.
Modifier and Type | Field and Description |
---|---|
protected ConcurrentHashMap<Class<?>,DataObjectMetadata> |
masterMetadataMap
The map of types to metadata.
|
Constructor and Description |
---|
MetadataProviderBase() |
Modifier and Type | Method and Description |
---|---|
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)
Determines whether the given class can be persisted.
|
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()
Flag which allows the service to indicate that it requires knowledge of previously discovered persistable
entities.
|
protected ConcurrentHashMap<Class<?>,DataObjectMetadata> masterMetadataMap
public MetadataProviderBase()
protected abstract void initializeMetadata(Collection<Class<?>> 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.
public boolean handles(Class<?> type)
handles
in interface MetadataProvider
type
- the data object type to check.public Collection<Class<?>> getSupportedTypes()
getSupportedTypes
in interface MetadataProvider
public Map<Class<?>,DataObjectMetadata> provideMetadata()
provideMetadata
in interface MetadataProvider
public Map<Class<?>,DataObjectMetadata> provideMetadataForTypes(Collection<Class<?>> types)
provideMetadataForTypes
in interface MetadataProvider
types
- the list of types for which to get the metadata.public DataObjectMetadata getMetadataForType(Class<?> dataObjectType) throws IllegalArgumentException
getMetadataForType
in interface MetadataProvider
dataObjectType
- the type for which to get the metadata.IllegalArgumentException
- if the data object type is null.protected boolean isClassPersistable(Class<?> clazz)
clazz
- the class to check for persistability.public boolean requiresListOfExistingTypes()
That is, the service is designed only to process existing objects and not to create new ones.
By default, providers are assumed to be able to pull the list of annotated types from somewhere.requiresListOfExistingTypes
in interface MetadataProvider
Copyright © 2005–2015 The Kuali Foundation. All rights reserved.