Class QualifiedElementFactory
java.lang.Object
de.iip_ecosphere.platform.transport.serialization.QualifiedElementFactory
Creates instances of
QualifiedElement, intended to be configured by transport mechanisms.- Author:
- Holger Eichelberger, SSE
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> QualifiedElement<T> createElement(Class<T> cls) Creates an element instance for a given value type.static <T> Supplier<QualifiedElement<T>> getSupplier(Class<T> cls) Creates an element instance for a given value type.static <T> voidregisterElementSupplier(Class<T> cls, Supplier<QualifiedElement<T>> supplier) Registers an element supplier.static voidreset()Resets the creators registered with this factory.
-
Field Details
-
SUPPLIERS
-
-
Constructor Details
-
QualifiedElementFactory
public QualifiedElementFactory()
-
-
Method Details
-
reset
public static void reset()Resets the creators registered with this factory. -
getSupplier
Creates an element instance for a given value type.- Type Parameters:
T- the value type- Parameters:
cls- the value type class- Returns:
- the element instance
-
createElement
Creates an element instance for a given value type.- Type Parameters:
T- the value type- Parameters:
cls- the value type class- Returns:
- the element instance
-
registerElementSupplier
public static <T> void registerElementSupplier(Class<T> cls, Supplier<QualifiedElement<T>> supplier) Registers an element supplier. Nothing happens ifclsorsupplierare null.- Type Parameters:
T- the element value type- Parameters:
cls- the element value type classsupplier- the corresponding supplier
-