Module io.github.mmm.property
Package io.github.mmm.property.factory
Interface PropertyFactory<V,P extends WritableProperty<V>>
-
- Type Parameters:
V
- the generic type of theproperty value
.P
- the generic type of theproperty implementation
.
- All Known Implementing Classes:
AbstractPropertyFactory
,PropertyFactoryBean
,PropertyFactoryBigDecimal
,PropertyFactoryBigInteger
,PropertyFactoryBoolean
,PropertyFactoryByte
,PropertyFactoryDouble
,PropertyFactoryFloat
,PropertyFactoryId
,PropertyFactoryInstant
,PropertyFactoryInteger
,PropertyFactoryLink
,PropertyFactoryList
,PropertyFactoryLocalDate
,PropertyFactoryLocalDateTime
,PropertyFactoryLocalTime
,PropertyFactoryLong
,PropertyFactoryMap
,PropertyFactoryObject
,PropertyFactoryOffsetDateTime
,PropertyFactoryOffsetTime
,PropertyFactoryRange
,PropertyFactorySet
,PropertyFactoryShort
,PropertyFactoryString
,PropertyFactoryZonedDateTime
public interface PropertyFactory<V,P extends WritableProperty<V>>
This is the interface for the factory of a specificproperty
type. You can directly instantiate implementations such asStringProperty
. However for generic support according types have to be registered via an implementation of this interface.- Since:
- 1.0.0
- See Also:
PropertyFactoryManager
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description P
create(String name, Class<? extends V> valueClass, PropertyMetadata<V> metadata)
Creates a new instance of the property.Class<P>
getImplementationClass()
Class<? extends ReadableProperty<V>>
getReadableInterface()
Class<? extends V>
getValueClass()
Class<? extends WritableProperty<V>>
getWritableInterface()
default boolean
isPolymorphic()
-
-
-
Method Detail
-
getValueClass
Class<? extends V> getValueClass()
- Returns:
- the
Class
of theproperty value
. May benull
for a generic property.
-
getReadableInterface
Class<? extends ReadableProperty<V>> getReadableInterface()
- Returns:
- the
Class
reflecting theReadableProperty
interface. May benull
if no dedicated readable interface exists.
-
getWritableInterface
Class<? extends WritableProperty<V>> getWritableInterface()
- Returns:
- the
Class
reflecting theWritableProperty
interface. May benull
if no dedicated writable interface exists.
-
getImplementationClass
Class<P> getImplementationClass()
- Returns:
- the
Class
reflecting theWritableProperty
implementation.
-
create
P create(String name, Class<? extends V> valueClass, PropertyMetadata<V> metadata)
Creates a new instance of the property.- Parameters:
name
- theproperty name
.valueClass
- thevalue class
.metadata
- TODO- Returns:
- the new instance of the property.
-
isPolymorphic
default boolean isPolymorphic()
- Returns:
true
ifvalue class
is polymorphic and also sub-types are handled by thisPropertyFactory
(unless there is a more specificPropertyFactory
available),false
otherwise.
-
-