001/* 002 * Copyright 2012-2016 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.builder; 018 019import org.springframework.boot.Banner; 020 021/** 022 * Examples of using {@link SpringApplicationBuilder}. 023 * 024 * @author Andy Wilkinson 025 */ 026public class SpringApplicationBuilderExample { 027 028 public void hierarchyWithDisabledBanner(String[] args) { 029 // @formatter:off 030 // tag::hierarchy[] 031 new SpringApplicationBuilder() 032 .sources(Parent.class) 033 .child(Application.class) 034 .bannerMode(Banner.Mode.OFF) 035 .run(args); 036 // end::hierarchy[] 037 // @formatter:on 038 } 039 040 /** 041 * Parent application configuration. 042 */ 043 static class Parent { 044 045 } 046 047 /** 048 * Application configuration. 049 */ 050 static class Application { 051 052 } 053 054}