001/* 002 * Copyright 2012-2017 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017package org.springframework.boot.autoconfigure.groovy.template; 018 019import org.springframework.boot.autoconfigure.template.AbstractTemplateViewResolverProperties; 020import org.springframework.boot.context.properties.ConfigurationProperties; 021 022/** 023 * {@link ConfigurationProperties} for configuring Groovy templates. 024 * 025 * @author Dave Syer 026 * @author Marten Deinum 027 * @since 1.1.0 028 */ 029@ConfigurationProperties(prefix = "spring.groovy.template", ignoreUnknownFields = true) 030public class GroovyTemplateProperties extends AbstractTemplateViewResolverProperties { 031 032 public static final String DEFAULT_RESOURCE_LOADER_PATH = "classpath:/templates/"; 033 034 public static final String DEFAULT_PREFIX = ""; 035 036 public static final String DEFAULT_SUFFIX = ".tpl"; 037 038 public static final String DEFAULT_REQUEST_CONTEXT_ATTRIBUTE = "spring"; 039 040 /** 041 * Template path. 042 */ 043 private String resourceLoaderPath = DEFAULT_RESOURCE_LOADER_PATH; 044 045 public GroovyTemplateProperties() { 046 super(DEFAULT_PREFIX, DEFAULT_SUFFIX); 047 setRequestContextAttribute(DEFAULT_REQUEST_CONTEXT_ATTRIBUTE); 048 } 049 050 public String getResourceLoaderPath() { 051 return this.resourceLoaderPath; 052 } 053 054 public void setResourceLoaderPath(String resourceLoaderPath) { 055 this.resourceLoaderPath = resourceLoaderPath; 056 } 057 058}