Code example for Method

Methods: getReturnType

0
    private final ReturnType returnType;
    private final InjectedValue<ComponentView> viewToCreate = new InjectedValue<ComponentView>();
 
    public EntityBeanHomeFinderInterceptorFactory(final Method finderMethod) {
        this.finderMethod = finderMethod;
        if (Collection.class.isAssignableFrom(finderMethod.getReturnType())) {
            returnType = ReturnType.COLLECTION;
        } else if (Enumeration.class.isAssignableFrom(finderMethod.getReturnType())) {
            returnType = ReturnType.ENUMERATION;
        } else { 
            returnType = ReturnType.SINGLE;
        } 
    } 
 
    @Override 
    public Interceptor create(final InterceptorFactoryContext context) {
 
        final EntityBeanComponent component = (EntityBeanComponent) context.getContextData().get(Component.class);
 
        return new Interceptor() {