Package com.consol.citrus.spi
Interface TypeResolver
-
- All Known Implementing Classes:
ResourcePathTypeResolver
public interface TypeResolverResolves types by searching for classpath resource mapping files in order to resolve class references at runtime.- Author:
- Christoph Deppisch
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_TYPE_PROPERTYProperty name that holds the type information to resolvestatic StringTYPE_PROPERTY_WILDCARDProperty name to mark that multiple types will be present all types are loaded
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> Tresolve(String resourcePath, Object... initargs)Load default type information from given resource path property file and create new instance of given type.<T> Tresolve(String resourcePath, String property, Object... initargs)Load given property from given resource path property file and create new instance of given type.default <T> Map<String,T>resolveAll()Load all resources and create new instance of given type.default <T> Map<String,T>resolveAll(String resourcePath)Load all resources in given resource path and create new instance of given type.default <T> Map<String,T>resolveAll(String resourcePath, String property)Load all resources in given resource path and create new instance of given type.<T> Map<String,T>resolveAll(String resourcePath, String property, String keyProperty)Load all resources in given resource path and create new instance of given type.StringresolveProperty(String resourcePath, String property)Resolve resource path property file with given name and load given property.
-
-
-
Field Detail
-
DEFAULT_TYPE_PROPERTY
static final String DEFAULT_TYPE_PROPERTY
Property name that holds the type information to resolve- See Also:
- Constant Field Values
-
TYPE_PROPERTY_WILDCARD
static final String TYPE_PROPERTY_WILDCARD
Property name to mark that multiple types will be present all types are loaded- See Also:
- Constant Field Values
-
-
Method Detail
-
resolveProperty
String resolveProperty(String resourcePath, String property)
Resolve resource path property file with given name and load given property.- Parameters:
resourcePath-property-- Returns:
-
resolve
default <T> T resolve(String resourcePath, Object... initargs)
Load default type information from given resource path property file and create new instance of given type.- Parameters:
resourcePath-initargs-- Returns:
-
resolve
<T> T resolve(String resourcePath, String property, Object... initargs)
Load given property from given resource path property file and create new instance of given type. The type information is read by the given property in the resource file.- Parameters:
resourcePath-property-initargs-- Returns:
-
resolveAll
default <T> Map<String,T> resolveAll()
Load all resources and create new instance of given type. The type information is read by the given property in the resource file. The keys in the resulting map represent the resource file names.- Type Parameters:
T-- Returns:
-
resolveAll
default <T> Map<String,T> resolveAll(String resourcePath)
Load all resources in given resource path and create new instance of given type. The type information is read by the given property in the resource file. The keys in the resulting map represent the resource file names.- Type Parameters:
T-- Parameters:
resourcePath-- Returns:
-
resolveAll
default <T> Map<String,T> resolveAll(String resourcePath, String property)
Load all resources in given resource path and create new instance of given type. The type information is read by the given property in the resource file. The keys in the resulting map represent the resource file names.- Type Parameters:
T-- Parameters:
resourcePath-property-- Returns:
-
resolveAll
<T> Map<String,T> resolveAll(String resourcePath, String property, String keyProperty)
Load all resources in given resource path and create new instance of given type. The type information is read by the given property in the resource file.- Type Parameters:
T-- Parameters:
resourcePath-property-keyProperty-- Returns:
-
-