Interface TypeResolver

All Known Implementing Classes:
ResourcePathTypeResolver

public interface TypeResolver
Resolves 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 final String
    Property name that holds the type information to resolve
    static final String
    Property name to mark that multiple types will be present all types are loaded
  • Method Summary

    Modifier and Type
    Method
    Description
    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.
    <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.
    default <T> Map<String,T>
    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.
    resolveProperty(String resourcePath, String property)
    Resolve resource path property file with given name and load given property.
  • Field Details

    • DEFAULT_TYPE_PROPERTY

      static final String DEFAULT_TYPE_PROPERTY
      Property name that holds the type information to resolve
      See Also:
    • 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:
  • Method Details

    • 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: