Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
PlatformPlugin |
|
| 0.0;0 |
1 | /* | |
2 | * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. | |
3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
4 | * | |
5 | * This code is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU General Public License version 2 only, as | |
7 | * published by the Free Software Foundation. Sun designates this | |
8 | * particular file as subject to the "Classpath" exception as provided | |
9 | * by Sun in the LICENSE file that accompanied this code. | |
10 | * | |
11 | * This code is distributed in the hope that it will be useful, but WITHOUT | |
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
14 | * version 2 for more details (a copy is included in the LICENSE file that | |
15 | * accompanied this code). | |
16 | * | |
17 | * You should have received a copy of the GNU General Public License version | |
18 | * 2 along with this work; if not, write to the Free Software Foundation, | |
19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
20 | * | |
21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
22 | * CA 95054 USA or visit www.sun.com if you need additional information or | |
23 | * have any questions. | |
24 | */ | |
25 | ||
26 | package com.sun.tools.javafx.util; | |
27 | ||
28 | import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; | |
29 | import com.sun.tools.javac.util.Context; | |
30 | import com.sun.tools.javac.util.Options; | |
31 | import com.sun.tools.javac.util.ListBuffer; | |
32 | import com.sun.tools.javac.util.Log; | |
33 | ||
34 | /** | |
35 | * JavaFX Script compiler platform plug-in. | |
36 | */ | |
37 | 0 | public abstract class PlatformPlugin |
38 | { | |
39 | /** Service name of platform plug-in. */ | |
40 | public final static String SERVICE = | |
41 | "com.sun.tools.javafx.util.PlatformPlugin"; | |
42 | ||
43 | /** Error messages of platform plug-in. */ | |
44 | public final static String MESSAGE = | |
45 | "com.sun.tools.javafx.resources.platformplugin"; | |
46 | ||
47 | /** | |
48 | * The context key for the platform plugin. | |
49 | */ | |
50 | 7 | public static final Context.Key<PlatformPlugin> pluginKey = |
51 | new Context.Key<PlatformPlugin>(); | |
52 | ||
53 | /** | |
54 | * Get the PlatformPlugin instance for this context. | |
55 | * | |
56 | * @param context The compiler context. | |
57 | * @return An instance of the PlatformPlugin or <code>null</code> if plugin | |
58 | * had not been loaded. | |
59 | */ | |
60 | public static PlatformPlugin instance(Context context) { | |
61 | 379 | PlatformPlugin instance = context.get(pluginKey); |
62 | 379 | return instance; |
63 | } | |
64 | ||
65 | /** | |
66 | * Returns <code>true</code> if platform string identifies supported platform. | |
67 | * | |
68 | * @param platform Target platform identifier string. | |
69 | * @return <code>true</code> if plugin supports the platform. | |
70 | */ | |
71 | public abstract boolean isSupported(String platform); | |
72 | ||
73 | /** | |
74 | * Initializes the plugin. | |
75 | * | |
76 | * @param options The compiler options. | |
77 | * @param log The compiler log object. | |
78 | */ | |
79 | public abstract void initialize(Options options, Log log); | |
80 | ||
81 | /** | |
82 | * Performs platform specific abstract syntax tree processing. | |
83 | * | |
84 | * @param trees The abstract syntax tree list. | |
85 | */ | |
86 | public abstract void process(ListBuffer<JCCompilationUnit> trees); | |
87 | } |