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; 018 019import java.io.PrintStream; 020 021import org.springframework.core.env.Environment; 022 023/** 024 * Interface class for writing a banner programmatically. 025 * 026 * @author Phillip Webb 027 * @author Michael Stummvoll 028 * @author Jeremy Rickard 029 * @since 1.2.0 030 */ 031@FunctionalInterface 032public interface Banner { 033 034 /** 035 * Print the banner to the specified print stream. 036 * @param environment the spring environment 037 * @param sourceClass the source class for the application 038 * @param out the output print stream 039 */ 040 void printBanner(Environment environment, Class<?> sourceClass, PrintStream out); 041 042 /** 043 * An enumeration of possible values for configuring the Banner. 044 */ 045 enum Mode { 046 047 /** 048 * Disable printing of the banner. 049 */ 050 OFF, 051 052 /** 053 * Print the banner to System.out. 054 */ 055 CONSOLE, 056 057 /** 058 * Print the banner to the log file. 059 */ 060 LOG 061 062 } 063 064}