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.cli; 018 019import java.util.Arrays; 020import java.util.Collection; 021import java.util.List; 022 023import org.springframework.boot.cli.command.Command; 024import org.springframework.boot.cli.command.CommandFactory; 025import org.springframework.boot.cli.command.archive.JarCommand; 026import org.springframework.boot.cli.command.archive.WarCommand; 027import org.springframework.boot.cli.command.core.VersionCommand; 028import org.springframework.boot.cli.command.grab.GrabCommand; 029import org.springframework.boot.cli.command.init.InitCommand; 030import org.springframework.boot.cli.command.install.InstallCommand; 031import org.springframework.boot.cli.command.install.UninstallCommand; 032import org.springframework.boot.cli.command.run.RunCommand; 033import org.springframework.boot.cli.command.test.TestCommand; 034 035/** 036 * Default implementation of {@link CommandFactory}. 037 * 038 * @author Dave Syer 039 */ 040public class DefaultCommandFactory implements CommandFactory { 041 042 private static final List<Command> defaultCommands = Arrays.<Command>asList( 043 new VersionCommand(), new RunCommand(), new TestCommand(), new GrabCommand(), 044 new JarCommand(), new WarCommand(), new InstallCommand(), 045 new UninstallCommand(), new InitCommand()); 046 047 @Override 048 public Collection<Command> getCommands() { 049 return defaultCommands; 050 } 051 052}