/** * Creates a new {@link EvaluationContextExtension} for the given extension type. * * @param type must not be {@literal null}. */ public EvaluationContextExtensionInformation(Class<? extends EvaluationContextExtension> type) { Assert.notNull(type, "Extension type must not be null!"); Class<?> rootObjectType = org.springframework.data.util.ReflectionUtils.findRequiredMethod(type, "getRootObject") .getReturnType(); this.rootObjectInformation = Optional .ofNullable(Object.class.equals(rootObjectType) ? null : new RootObjectInformation(rootObjectType)); this.extensionTypeInformation = new ExtensionTypeInformation(type); }