001/*
002 * Copyright 2012-2015 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.loader.tools;
018
019/**
020 * The scope of a library. The common {@link #COMPILE}, {@link #RUNTIME} and
021 * {@link #PROVIDED} scopes are defined here and supported by the common {@link Layouts}.
022 * A custom {@link Layout} can handle additional scopes as required.
023 *
024 * @author Phillip Webb
025 */
026public interface LibraryScope {
027
028        @Override
029        String toString();
030
031        /**
032         * The library is used at compile time and runtime.
033         */
034        LibraryScope COMPILE = new LibraryScope() {
035
036                @Override
037                public String toString() {
038                        return "compile";
039                }
040
041        };
042
043        /**
044         * The library is used at runtime but not needed for compile.
045         */
046        LibraryScope RUNTIME = new LibraryScope() {
047
048                @Override
049                public String toString() {
050                        return "runtime";
051                }
052
053        };
054
055        /**
056         * The library is needed for compile but is usually provided when running.
057         */
058        LibraryScope PROVIDED = new LibraryScope() {
059
060                @Override
061                public String toString() {
062                        return "provided";
063                }
064
065        };
066
067        /**
068         * Marker for custom scope when custom configuration is used.
069         */
070        LibraryScope CUSTOM = new LibraryScope() {
071
072                @Override
073                public String toString() {
074                        return "custom";
075                }
076
077        };
078
079}