Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.github.edgarespina.mwa;
 
 import java.util.List;
 
Helper class for beans.

Author(s):
edgar.espina
Since:
0.1.3
public final class Beans {

  
Not allowed.
  private Beans() {
  }

  
Look for bean of an specific type in the Application Context.

Parameters:
context The application context.
beanType The bean type to look for.
<T> The bean generic type.
Returns:
All the of the specific types found in the Application Context.
  public static <T> List<T> lookFor(final ApplicationContext context,
      final Class<T> beanType) {
    Collection<T> beans = context.getBeansOfType(beanType).values();
    List<T> result = new ArrayList<T>();
    if (beans != null) {
      result.addAll(beans);
    }
    return result;
  }
New to GrepCode? Check out our FAQ X