org.hibernate.search.engine.service.beanresolver.impl

## Class ReflectionFallbackBeanResolver

- java.lang.Object
- - org.hibernate.search.engine.service.beanresolver.impl.ReflectionFallbackBeanResolver

- All Implemented Interfaces:
    BeanResolver, Service

      public class ReflectionFallbackBeanResolver
      extends Object
      implements BeanResolver

  A bean resolver implementing fallback: it attempts to resolve beans against a given delegate, return it if the resolution succeeded (non-null result), or attempts a resolution `using reflection` if it failed (null result).

  Any exception thrown by the delegate will be propagated immediately (it won't be swallowed to try reflection).

  Note that we don't expect this resolver to ever return null, because the resolution using reflection will always either succeed (return a non-null bean) or throw an exception.

  Author:
    Yoann Rodiere

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReflectionFallbackBeanResolver(BeanResolver delegate, ReflectionBeanResolver fallback)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> T` | `resolve(Class<?> reference, Class<T> expectedClass)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ReflectionFallbackBeanResolver

          public ReflectionFallbackBeanResolver(BeanResolver delegate,
                                                ReflectionBeanResolver fallback)

  - ### Method Detail

    - #### resolve

          public <T> T resolve(Class<?> reference,
                               Class<T> expectedClass)

      Specified by:
        `resolve` in interface `BeanResolver`

Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved