Module io.github.mmm.property
Package io.github.mmm.property.factory
Interface PropertyFactoryManager
-
public interface PropertyFactoryManagerThis is the interface for the manager where allPropertyFactoryvariants 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 PropertyFactoryManagerget()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- theClassreflecting the property to create. May be thereadable interface,writable interface, or theimplementation.- Returns:
- the according
PropertyFactoryornullif 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- theClassreflecting theproperty value.- Returns:
- the according
PropertyFactoryornullif 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- theClassreflecting the property to create. May be thereadable interface,writable interface, or theimplementation.valueType- theClassreflecting theproperty value.- Returns:
- the according
PropertyFactoryornullif 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- theClassreflecting the property to create. May be thereadable interface,writable interface, or theimplementation.valueType- theClassreflecting theproperty value.- Returns:
- the according
PropertyFactoryornullif no such factory is registered. - Throws:
ObjectNotFoundException- if no suchPropertyFactorycould 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 thepropertyto create.- Parameters:
propertyType- theClassreflecting 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 noPropertyFactorywasfoundforpropertyType.
-
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 thepropertyto create.- Parameters:
propertyType- theClassreflecting 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 noPropertyFactorywasfoundforpropertyType.
-
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 noPropertyFactorywasfoundforpropertyType.
-
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 noPropertyFactorywasfoundforpropertyType.
-
get
static PropertyFactoryManager get()
- Returns:
- the
PropertyFactoryManagerinstance.
-
-