org.apache.myfaces.extensions.validator.core.storage
Class DefaultStorageManagerFactory

java.lang.Object
  extended by org.apache.myfaces.extensions.validator.core.factory.AbstractNameMapperAwareFactory<Class>
      extended by org.apache.myfaces.extensions.validator.core.storage.DefaultStorageManagerFactory
All Implemented Interfaces:
ClassMappingFactory<Class,StorageManager>, NameMapperAwareFactory<NameMapper<Class>>, StorageManagerHolder

public class DefaultStorageManagerFactory
extends AbstractNameMapperAwareFactory<Class>
implements ClassMappingFactory<Class,StorageManager>, StorageManagerHolder

default implementation for storage-manager creation and caching

Since:
x.x.3
Author:
Gerhard Petracek

Field Summary
protected  Logger logger
           
 
Constructor Summary
DefaultStorageManagerFactory()
           
 
Method Summary
 StorageManager create(Class storageType)
          Create an instance of the target type based on the source type.
protected  List<NameMapper<Class>> getNameMapperList()
           
 StorageManager getStorageManager(Class type)
          Returns the storageManager for the given type.
 void setStorageManager(Class storageType, StorageManager storageManager, boolean override)
          Define the storage manager for the given type.
 
Methods inherited from class org.apache.myfaces.extensions.validator.core.factory.AbstractNameMapperAwareFactory
deny, deregister, getComparator, register
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final Logger logger
Constructor Detail

DefaultStorageManagerFactory

public DefaultStorageManagerFactory()
Method Detail

create

public StorageManager create(Class storageType)
Description copied from interface: ClassMappingFactory
Create an instance of the target type based on the source type. An example is the DefaultMetaDataTransformerFactory that creates a metaDataTransformer for a certain ValidationStrategy.

Specified by:
create in interface ClassMappingFactory<Class,StorageManager>
Parameters:
storageType - source type to be used.
Returns:
target object.

getNameMapperList

protected List<NameMapper<Class>> getNameMapperList()
Specified by:
getNameMapperList in class AbstractNameMapperAwareFactory<Class>

setStorageManager

public void setStorageManager(Class storageType,
                              StorageManager storageManager,
                              boolean override)
Description copied from interface: StorageManagerHolder
Define the storage manager for the given type.

Specified by:
setStorageManager in interface StorageManagerHolder
Parameters:
storageType - The identification for the storage manager, usually it is the storage-class
storageManager - The storageManager to use.
override - use true to replace an existing storageManager and false to use the manager only if there isn't an existing manager for the given type

getStorageManager

public StorageManager getStorageManager(Class type)
Description copied from interface: StorageManagerHolder
Returns the storageManager for the given type.

Specified by:
getStorageManager in interface StorageManagerHolder
Parameters:
type - The identification for the storage manager, usually it is the storage-class
Returns:
the storageManager for the given type or null


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.