Java 类org.springframework.boot.autoconfigure.template.TemplateAvailabilityProvider 实例源码

项目:contestparser    文件:ErrorMvcAutoConfiguration.java   
@Override
public ConditionOutcome getMatchOutcome(ConditionContext context,
        AnnotatedTypeMetadata metadata) {
    List<TemplateAvailabilityProvider> availabilityProviders = SpringFactoriesLoader
            .loadFactories(TemplateAvailabilityProvider.class,
                    context.getClassLoader());

    for (TemplateAvailabilityProvider availabilityProvider : availabilityProviders) {
        if (availabilityProvider.isTemplateAvailable("error",
                context.getEnvironment(), context.getClassLoader(),
                context.getResourceLoader())) {
            return ConditionOutcome.noMatch("Template from "
                    + availabilityProvider + " found for error view");
        }
    }

    return ConditionOutcome.match("No error template view detected");
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DefaultErrorViewResolver.java   
private ModelAndView resolve(String viewName, Map<String, Object> model) {
    String errorViewName = "error/" + viewName;
    TemplateAvailabilityProvider provider = this.templateAvailabilityProviders
            .getProvider(errorViewName, this.applicationContext);
    if (provider != null) {
        return new ModelAndView(errorViewName, model);
    }
    return resolveResource(errorViewName, model);
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:ErrorMvcAutoConfiguration.java   
@Override
public ConditionOutcome getMatchOutcome(ConditionContext context,
        AnnotatedTypeMetadata metadata) {
    TemplateAvailabilityProviders providers = new TemplateAvailabilityProviders(
            context.getClassLoader());
    TemplateAvailabilityProvider provider = providers.getProvider("error",
            context.getEnvironment(), context.getClassLoader(),
            context.getResourceLoader());
    if (provider != null) {
        return ConditionOutcome
                .noMatch("Template from " + provider + " found for error view");
    }
    return ConditionOutcome.match("No error template view detected");
}
项目:spring-boot-concourse    文件:DefaultErrorViewResolver.java   
private ModelAndView resolve(String viewName, Map<String, Object> model) {
    String errorViewName = "error/" + viewName;
    TemplateAvailabilityProvider provider = this.templateAvailabilityProviders
            .getProvider(errorViewName, this.applicationContext);
    if (provider != null) {
        return new ModelAndView(errorViewName, model);
    }
    return resolveResource(errorViewName, model);
}
项目:spring-boot-concourse    文件:ErrorMvcAutoConfiguration.java   
@Override
public ConditionOutcome getMatchOutcome(ConditionContext context,
        AnnotatedTypeMetadata metadata) {
    TemplateAvailabilityProviders providers = new TemplateAvailabilityProviders(
            context.getClassLoader());
    TemplateAvailabilityProvider provider = providers.getProvider("error",
            context.getEnvironment(), context.getClassLoader(),
            context.getResourceLoader());
    if (provider != null) {
        return ConditionOutcome
                .noMatch("Template from " + provider + " found for error view");
    }
    return ConditionOutcome.match("No error template view detected");
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:DefaultErrorViewResolverTests.java   
TestTemplateAvailabilityProviders(TemplateAvailabilityProvider provider) {
    super(Collections.singletonList(provider));
}
项目:spring-boot-concourse    文件:DefaultErrorViewResolverTests.java   
TestTemplateAvailabilityProviders(TemplateAvailabilityProvider provider) {
    super(Collections.singletonList(provider));
}