PlatformProvider.java revision 3628:047d4d42b466
1219019Sgabor/* 2219019Sgabor * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. 3219019Sgabor * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4219019Sgabor * 5219019Sgabor * This code is free software; you can redistribute it and/or modify it 6219019Sgabor * under the terms of the GNU General Public License version 2 only, as 7219019Sgabor * published by the Free Software Foundation. Oracle designates this 8219019Sgabor * particular file as subject to the "Classpath" exception as provided 9219019Sgabor * by Oracle in the LICENSE file that accompanied this code. 10219019Sgabor * 11219019Sgabor * This code is distributed in the hope that it will be useful, but WITHOUT 12219019Sgabor * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13219019Sgabor * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14219019Sgabor * version 2 for more details (a copy is included in the LICENSE file that 15219019Sgabor * accompanied this code). 16219019Sgabor * 17219019Sgabor * You should have received a copy of the GNU General Public License version 18219019Sgabor * 2 along with this work; if not, write to the Free Software Foundation, 19219019Sgabor * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20219019Sgabor * 21219019Sgabor * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22219019Sgabor * or visit www.oracle.com if you need additional information or have any 23219019Sgabor * questions. 24219019Sgabor */ 25219019Sgabor 26219019Sgaborpackage com.sun.tools.javac.platform; 27219019Sgabor 28219019Sgabor/** A collection of platform descriptions that can be selected using {@code --release name} 29219019Sgabor * command line option. 30219019Sgabor * Register in {@code META-INF/services/com.sun.tools.javac.platform.PlatformProvider}. 31244348Sgabor * 32219019Sgabor * <p><b>This is NOT part of any supported API. 33244348Sgabor * If you write code that depends on this, you do so at your own risk. 34219019Sgabor * This code and its internal interfaces are subject to change or 35219019Sgabor * deletion without notice.</b> 36219019Sgabor */ 37219019Sgaborpublic interface PlatformProvider { 38219019Sgabor 39219019Sgabor /**Names of platforms supported by this provider. Each returned name can be used as the key for --release. 40219019Sgabor * 41219019Sgabor * @return the platform keys 42219019Sgabor */ 43219019Sgabor Iterable<String> getSupportedPlatformNames(); 44219019Sgabor 45219019Sgabor /**Create a description of a selected platform. 46219019Sgabor * 47219019Sgabor * @param platformName the name of the selected platform 48219019Sgabor * @param options additional parameter, which can be specified after ':' on the command line 49219019Sgabor * @return a PlatformDescription 50219019Sgabor * @throws PlatformNotSupported if the given platform is not supported 51219019Sgabor */ 52219019Sgabor PlatformDescription getPlatform(String platformName, String options) throws PlatformNotSupported; 53219019Sgabor 54219019Sgabor /**Throw if the given platform is not supported. 55219019Sgabor */ 56219019Sgabor public class PlatformNotSupported extends Exception { 57219019Sgabor private static final long serialVersionUID = 1L; 58219019Sgabor } 59219019Sgabor 60219019Sgabor} 61219019Sgabor