Module io.github.mmm.property
Package io.github.mmm.property.factory
Interface PropertyFactoryManager
-
public interface PropertyFactoryManager
This is the interface for the manager where allPropertyFactory
variants are registered.- Since:
- 1.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <V,P extends ReadableProperty<V>>
Pcreate(Class<P> propertyType, Class<V> valueClass, String name)
default <V,P extends ReadableProperty<V>>
Pcreate(Class<P> propertyType, Class<V> valueClass, String name, PropertyMetadata<V> metadata)
default <V> WritableProperty<V>
create(Class<V> valueClass, String name)
default <V> WritableProperty<V>
create(Class<V> valueClass, String name, PropertyMetadata<V> metadata)
static PropertyFactoryManager
get()
default <V,P extends ReadableProperty<V>>
PropertyFactory<V,? extends P>getFactory(Class<P> propertyType, Class<? extends V> valueType)
<V,P extends ReadableProperty<V>>
PropertyFactory<V,? extends P>getFactoryForPropertyType(Class<P> propertyType)
<V> PropertyFactory<V,? extends ReadableProperty<V>>
getFactoryForValueType(Class<? extends V> valueType)
default <V,P extends ReadableProperty<V>>
PropertyFactory<V,? extends P>getRequiredFactory(Class<P> propertyType, Class<V> valueType)
-
-
-
Method Detail
-
getFactoryForPropertyType
<V,P extends ReadableProperty<V>> PropertyFactory<V,? extends P> getFactoryForPropertyType(Class<P> propertyType)
- Type Parameters:
V
- the generic type of theproperty value
.P
- the generic type of theproperty
.- Parameters:
propertyType
- theClass
reflecting the property to create. May be thereadable interface
,writable interface
, or theimplementation
.- Returns:
- the according
PropertyFactory
ornull
if no such factory is registered.
-
getFactoryForValueType
<V> PropertyFactory<V,? extends ReadableProperty<V>> getFactoryForValueType(Class<? extends V> valueType)
- Type Parameters:
V
- the generic type of theproperty value
.- Parameters:
valueType
- theClass
reflecting theproperty value
.- Returns:
- the according
PropertyFactory
ornull
if no such factory is registered. - See Also:
PropertyFactory.getValueClass()
-
getFactory
default <V,P extends ReadableProperty<V>> PropertyFactory<V,? extends P> getFactory(Class<P> propertyType, Class<? extends V> valueType)
- Type Parameters:
V
- the generic type of theproperty value
.P
- the generic type of theproperty
.- Parameters:
propertyType
- theClass
reflecting the property to create. May be thereadable interface
,writable interface
, or theimplementation
.valueType
- theClass
reflecting theproperty value
.- Returns:
- the according
PropertyFactory
ornull
if no such factory is registered.
-
getRequiredFactory
default <V,P extends ReadableProperty<V>> PropertyFactory<V,? extends P> getRequiredFactory(Class<P> propertyType, Class<V> valueType)
- Type Parameters:
V
- the generic type of theproperty value
.P
- the generic type of theproperty
.- Parameters:
propertyType
- theClass
reflecting the property to create. May be thereadable interface
,writable interface
, or theimplementation
.valueType
- theClass
reflecting theproperty value
.- Returns:
- the according
PropertyFactory
ornull
if no such factory is registered. - Throws:
ObjectNotFoundException
- if no suchPropertyFactory
could be found.
-
create
default <V,P extends ReadableProperty<V>> P create(Class<P> propertyType, Class<V> valueClass, String name)
- Type Parameters:
V
- the generic type of theproperty value
.P
- the generic type of theproperty
to create.- Parameters:
propertyType
- theClass
reflecting the property to create. May be thereadable interface
,writable interface
, or theimplementation
.valueClass
- thevalue class
.name
- theproperty name
.- Returns:
- the new instance of the property.
- Throws:
IllegalArgumentException
- if noPropertyFactory
wasfound
forpropertyType
.
-
create
default <V,P extends ReadableProperty<V>> P create(Class<P> propertyType, Class<V> valueClass, String name, PropertyMetadata<V> metadata)
- Type Parameters:
V
- the generic type of theproperty value
.P
- the generic type of theproperty
to create.- Parameters:
propertyType
- theClass
reflecting the property to create. May be thereadable interface
,writable interface
, or theimplementation
.valueClass
- thevalue class
.name
- theproperty name
.metadata
- thePropertyMetadata
.- Returns:
- the new instance of the property.
- Throws:
IllegalArgumentException
- if noPropertyFactory
wasfound
forpropertyType
.
-
create
default <V> WritableProperty<V> create(Class<V> valueClass, String name)
- Type Parameters:
V
- the generic type of theproperty value
.- Parameters:
valueClass
- thevalue class
.name
- theproperty name
.- Returns:
- the new instance of the property.
- Throws:
IllegalArgumentException
- if noPropertyFactory
wasfound
forpropertyType
.
-
create
default <V> WritableProperty<V> create(Class<V> valueClass, String name, PropertyMetadata<V> metadata)
- Type Parameters:
V
- the generic type of theproperty value
.- Parameters:
valueClass
- thevalue class
.name
- theproperty name
.metadata
- themetadata
.- Returns:
- the new instance of the property.
- Throws:
IllegalArgumentException
- if noPropertyFactory
wasfound
forpropertyType
.
-
get
static PropertyFactoryManager get()
- Returns:
- the
PropertyFactoryManager
instance.
-
-