public class PropertyFactoryManagerImpl extends AbstractLoggableComponent implements PropertyFactoryManager
PropertyFactoryManager.| Modifier and Type | Field and Description |
|---|---|
private static PropertyFactoryManagerImpl |
instance |
private Map<Class<?>,PropertyFactory<?,?>> |
propertyType2factoryMap |
private Map<Class<?>,PropertyFactory<?,?>> |
valueType2factoryMap |
| Constructor and Description |
|---|
PropertyFactoryManagerImpl()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
<V,PROPERTY extends ReadableProperty<V>> |
create(Class<PROPERTY> propertyType,
GenericType<V> valueType,
boolean polymorphic,
String name,
Bean bean,
AbstractValidator<? super V> validator) |
protected void |
doInitialize()
This method performs the actual
initialization. |
protected void |
doInitialized()
This method is invoked at the end of the actual
initialization. |
<V,PROPERTY extends ReadableProperty<V>> |
getFactoryForPropertyType(Class<PROPERTY> propertyType) |
<V> PropertyFactory<V,? extends ReadableProperty<V>> |
getFactoryForValueType(Class<? extends V> valueType,
boolean polymorphic) |
static PropertyFactoryManager |
getInstance()
This method gets the singleton instance of this
PropertyFactoryManager. |
private static void |
register(Map<Class<?>,PropertyFactory<?,?>> map,
Class<?> type,
PropertyFactory<?,?> factory,
boolean allowOverride) |
protected void |
registerDefaults()
|
void |
registerFactory(PropertyFactory<?,?> factory) |
protected void |
registerFactory(PropertyFactory<?,?> factory,
boolean allowOverride) |
private void |
registerPropertyType(Class<?> type,
PropertyFactory<?,?> factory,
boolean allowOverride) |
private void |
registerValueType(Class<?> type,
PropertyFactory<?,?> factory,
boolean allowOverride) |
void |
setFactories(List<PropertyFactory<?,?>> factories) |
createLogger, getLoggergetInitializationState, initializeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFactory, getRequiredFactoryprivate static PropertyFactoryManagerImpl instance
private final Map<Class<?>,PropertyFactory<?,?>> propertyType2factoryMap
private final Map<Class<?>,PropertyFactory<?,?>> valueType2factoryMap
@Inject public void setFactories(List<PropertyFactory<?,?>> factories)
factories - the List of PropertyFactory instances to Inject.public void registerFactory(PropertyFactory<?,?> factory)
factory - the PropertyFactory to register.protected void registerFactory(PropertyFactory<?,?> factory, boolean allowOverride)
factory - the PropertyFactory to register.allowOverride - - true if the given PropertyFactory may override (replace) a previously
registered one.private void registerValueType(Class<?> type, PropertyFactory<?,?> factory, boolean allowOverride)
private void registerPropertyType(Class<?> type, PropertyFactory<?,?> factory, boolean allowOverride)
private static void register(Map<Class<?>,PropertyFactory<?,?>> map, Class<?> type, PropertyFactory<?,?> factory, boolean allowOverride)
protected void doInitialize()
AbstractComponentinitialization. It is called when AbstractComponent.initialize() is
invoked for the first time. super.AbstractComponent.doInitialize().doInitialize in class AbstractLoggableComponentprotected void registerDefaults()
public static PropertyFactoryManager getInstance()
PropertyFactoryManager. Cdi.GET_INSTANCE before using.protected void doInitialized()
AbstractComponentinitialization. It is called when
AbstractComponent.initialize() is invoked for the first time after AbstractComponent.doInitialize() is completed and
initialization-state has changed to initialized. super.AbstractComponent.doInitialized().doInitialized in class AbstractComponentpublic <V,PROPERTY extends ReadableProperty<V>> PropertyFactory<V,? extends PROPERTY> getFactoryForPropertyType(Class<PROPERTY> propertyType)
getFactoryForPropertyType in interface PropertyFactoryManagerV - the generic type of the property value.PROPERTY - the generic type of the property.propertyType - the Class reflecting the property to create. May be the
readable interface,
writable interface, or the
implementation.PropertyFactory or null if no such factory is registered.public <V> PropertyFactory<V,? extends ReadableProperty<V>> getFactoryForValueType(Class<? extends V> valueType, boolean polymorphic)
getFactoryForValueType in interface PropertyFactoryManagerV - the generic type of the property value.valueType - the Class reflecting the property value.polymorphic - - true if also sub-types of
value classes should be accepted as valueType, false
otherwise (more efficient).PropertyFactory or null if no such factory is registered.PropertyFactory.getValueClass()public <V,PROPERTY extends ReadableProperty<V>> PROPERTY create(Class<PROPERTY> propertyType, GenericType<V> valueType, boolean polymorphic, String name, Bean bean, AbstractValidator<? super V> validator)
create in interface PropertyFactoryManagerV - the generic type of the property value.PROPERTY - the generic type of the property to create.propertyType - the Class reflecting the property to create. May be the
readable interface,
writable interface, or the
implementation.valueType - is the GenericType of the value. Only needed for generic properties such as
GenericProperty or
ListProperty. Can be null if the generic value type is
already bound and should be ignored then.polymorphic - - see PropertyFactoryManager.getFactoryForValueType(Class, boolean).name - the property name.bean - the property bean.validator - the validator used for validation.
May be null.Copyright © 2001–2016 mmm-Team. All rights reserved.