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

## Class ReflectionBeanResolver

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

- All Implemented Interfaces:
    BeanResolver, Service

      public class ReflectionBeanResolver
      extends Object
      implements BeanResolver

  A bean resolver that uses reflection to instantiate beans.

  The class passed as an argument must expose a public, no-arg constructor, or this resolver will fail with a `SearchException`.

  If the class passed as an argument contains a method annotated with `@Factory`, the class will be considered as a factory and the returned bean will be fetched from this factory method instead.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ReflectionBeanResolver()`

  - ### Method Summary

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

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

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

- - ### Constructor Detail

    - #### ReflectionBeanResolver

          public ReflectionBeanResolver()

  - ### Method Detail

    - #### resolve

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

      Specified by:
        `resolve` in interface `BeanResolver`

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