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
    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      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> 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.
      String resolveProperty​(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: