gate.util.compilers
Class Eclipse

java.lang.Object
  extended by gate.util.Javac
      extended by gate.util.compilers.Eclipse
All Implemented Interfaces:
GateConstants

public class Eclipse
extends Javac

This class compiles a set of java sources using the JDT compiler from the Eclipse project. Unlike the Sun compiler, this compiler can load dependencies directly from the GATE class loader, which (a) makes it faster, (b) means the compiler will work when GATE is loaded from a classloader other than the system classpath (for example within a Tomcat web application), and (c) allows it to compile code that depends on classes defined in CREOLE plugins, as well as in the GATE core. This is the default compiler for GATE version 3.0.

Author:
Ian Roberts

Field Summary
static boolean DEBUG
           
 
Fields inherited from class gate.util.Javac
DEFAULT_COMPILER
 
Fields inherited from interface gate.GateConstants
ABOUT_URL_JAVA_PROPERTY_NAME, ADD_NAMESPACE_FEATURES, ANNOT_TYPE_TO_EXPORT, APP_ICON_JAVA_PROPERTY_NAME, APP_SPLASH_JAVA_PROPERTY_NAME, APPLICATION_JAVA_PROPERTY_NAME, AUTOLOAD_PLUGIN_PATH_KEY, AUTOLOAD_PLUGIN_PATH_PROPERTY_NAME, BUILTIN_CREOLE_DIR_PROPERTY_NAME, COMPILER_TYPE_KEY, CORPUS_INDEX_DEFINITION_FEATURE_KEY, CORPUS_INDEX_STATISTICS_FEATURE_KEY, DOC_RTOL_ORIENTATION, DOCEDIT_INSERT_APPEND, DOCEDIT_INSERT_PREPEND, DOCEDIT_READ_ONLY, DOCUMENT_ADD_SPACE_ON_UNPACK_FEATURE_NAME, DOCUMENT_NEW_LINE_TYPE, DOCUMENT_REPOSITIONING_INFO_FEATURE_NAME, ELEMENT_NAMESPACE_PREFIX, ELEMENT_NAMESPACE_URI, GATE_CONFIG_PROPERTY, GATE_DOT_SER, GATE_DOT_XML, GATE_HOME_PROPERTY_NAME, GATE_SITE_CONFIG_PROPERTY_NAME, GATE_USER_CONFIG_PROPERTY_NAME, GATE_USER_SESSION_PROPERTY_NAME, HIDDEN_FEATURE_KEY, KNOWN_PLUGIN_PATH_KEY, LOOK_AND_FEEL, MAIN_FRAME_HEIGHT, MAIN_FRAME_MAXIMIZED, MAIN_FRAME_WIDTH, MENU_PATH_KEY, MENUS_FONT, ORIGINAL_DOCUMENT_CONTENT_FEATURE_NAME, ORIGINAL_MARKUPS_ANNOT_SET_NAME, OTHER_COMPONENTS_FONT, PLUGINS, PLUGINS_HOME_PROPERTY_NAME, SAVE_FEATURES_WHEN_PRESERVING_FORMAT, SAVE_OPTIONS_ON_EXIT, SAVE_SESSION_ON_EXIT, SITE_CONFIG_PROPERTY_NAME, TEXT_COMPONENTS_FONT, THROWEX_FORMAT_PROPERTY_NAME, TITLE_JAVA_PROPERTY_NAME, USER_CONFIG_PROPERTY_NAME, WORDNET_CONFIG_FILE
 
Constructor Summary
Eclipse()
           
 
Method Summary
 void compile(Map sources)
          Compiles a set of java sources using the Eclipse Java compiler and loads the compiled classes in the gate class loader.
 
Methods inherited from class gate.util.Javac
loadClasses
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final boolean DEBUG
See Also:
Constant Field Values
Constructor Detail

Eclipse

public Eclipse()
Method Detail

compile

public void compile(Map sources)
             throws GateException
Compiles a set of java sources using the Eclipse Java compiler and loads the compiled classes in the gate class loader.

Specified by:
compile in class Javac
Parameters:
sources - a map from fully qualified classname to java source
Throws:
GateException - in case of a compilation error or warning. In the case of warnings the compiled classes are loaded before the error is raised.