Example usage for org.springframework.core ResolvableType hasUnresolvableGenerics

List of usage examples for org.springframework.core ResolvableType hasUnresolvableGenerics

Introduction

In this page you can find the example usage for org.springframework.core ResolvableType hasUnresolvableGenerics.

Prototype

public boolean hasUnresolvableGenerics() 

Source Link

Document

Determine whether the underlying type has any unresolvable generics: either through an unresolvable type variable on the type itself or through implementing a generic interface in a raw fashion, i.e.

Usage

From source file:org.springframework.context.event.ApplicationListenerMethodAdapter.java

@Override
public boolean supportsEventType(ResolvableType eventType) {
    for (ResolvableType declaredEventType : this.declaredEventTypes) {
        if (declaredEventType.isAssignableFrom(eventType)) {
            return true;
        }// w  w w  . ja v  a2 s.c  o m
        Class<?> eventClass = eventType.getRawClass();
        if (eventClass != null && PayloadApplicationEvent.class.isAssignableFrom(eventClass)) {
            ResolvableType payloadType = eventType.as(PayloadApplicationEvent.class).getGeneric();
            if (declaredEventType.isAssignableFrom(payloadType)) {
                return true;
            }
        }
    }
    return eventType.hasUnresolvableGenerics();
}