|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgate.Gate
public class Gate
The class is responsible for initialising the GATE libraries, and providing access to singleton utility objects, such as the GATE class loader, CREOLE register and so on.
Nested Class Summary | |
---|---|
static class |
Gate.DirectoryInfo
Stores information about the contents of a CREOLE directory. |
static class |
Gate.ResourceInfo
Stores information about a resource defined by a CREOLE directory. |
Field Summary | |
---|---|
protected static List |
autoloadPlugins
The list of plugins (aka CREOLE directories) the system loads automatically at start-up. |
static String |
DB_OWNER
The database schema owner (GATEADMIN is default) this one should not be hardcoded but set in the XML initialization files |
protected static File |
gateHome
The top level directory of the GATE installation. |
static int |
HASH_STH_SIZE
The default size to be used for Hashtable, HashMap and HashSet. |
protected static List |
knownPlugins
The list of plugins (aka CREOLE directories) the system knows about. |
protected static String |
MIN_JDK_VERSION
Minimum version of JDK we support |
protected static Map |
pluginData
Map from URL of directory to Gate.DirectoryInfo . |
protected static File |
pluginsHome
The top level directory for GATE installed plugins. |
static int |
STRINGBUFFER_SIZE
The default StringBuffer size, it seems that we need longer string than the StringBuffer class default because of the high number of buffer expansions |
static String |
URI
The GATE URI used to interpret custom GATE tags |
Constructor Summary | |
---|---|
Gate()
|
Method Summary | |
---|---|
static void |
addAutoloadPlugin(URL pluginUrl)
Adds a new directory to the list of plugins that are loaded automatically at start-up. |
static void |
addCreoleListener(CreoleListener l)
Registers a CreoleListener with the Gate system |
static void |
addKnownPlugin(URL pluginURL)
Adds the plugin to the list of known plugins. |
static String |
genSym()
Returns a new unique string |
static List |
getAutoloadPlugins()
Returns the list of CREOLE directories the system loads automatically at start-up. |
static GateClassLoader |
getClassLoader()
Get the GATE class loader. |
static CreoleRegister |
getCreoleRegister()
Get the CREOLE register. |
static DataStoreRegister |
getDataStoreRegister()
Get the DataStore register. |
static String |
getDefaultUserConfigFileName()
Get the default path to the user's config file, which is used unless an alternative name has been specified via system properties or setUserConfigFile(java.io.File) . |
static Gate.DirectoryInfo |
getDirectoryInfo(URL directory)
Gets the information about a known directory. |
static String |
getEmptyConfigFile()
Get an empty config file. |
static Executable |
getExecutable()
Returns the curently set executable. |
static File |
getGateHome()
Gets the GATE home location. |
static boolean |
getHiddenAttribute(FeatureMap fm)
Returns the value for the HIDDEN attribute of a feature map |
static List |
getKnownPlugins()
Returns the list of CREOLE directories the system knows about (either pre-installed plugins in the plugins directory or CREOLE directories that have previously been loaded manually). |
static String |
getMinJdkVersion()
Get the minimum supported version of the JDK |
static OptionsMap |
getOriginalUserConfig()
Get the original, initialisation-time, GATE development environment configuration data (initialised from gate.xml). |
static File |
getPluginsHome()
Get the location of the plugins directory. |
static Set |
getRegisteredIREngines()
Gets the set of registered IR engines. |
static File |
getSiteConfigFile()
Get the site config file (generally set during command-line processing or as a gate.config property). |
static URL |
getUrl()
Get a URL that points to either an HTTP server or a file system that contains GATE files (such as test cases). |
static URL |
getUrl(String path)
Get a URL that points to either an HTTP server or a file system that contains GATE files (such as test cases). |
static OptionsMap |
getUserConfig()
Get the GATE development environment configuration data (initialised from gate.xml). |
static String |
getUserConfigElement()
Gate the name of the XML element for GATE development environment config data. |
static File |
getUserConfigFile()
Get the location of the user's config file. |
static String |
getUserConfigFileName()
Deprecated. Use getUserConfigFile() instead. |
static String |
getUserSessionFileName()
Get the name of the user's gate.ser session state file (this doesn't guarantee that file exists!). |
static boolean |
getUseXMLSerialization()
Should we use XML serialization for applications. |
static String |
guessUnicodeFont()
Attempts to guess the Unicode font for the platform. |
static void |
init()
Initialisation - must be called by all clients before using any other parts of the library. |
static void |
initConfigData()
Reads config data (gate.xml files). |
static void |
initCreoleRegister()
Initialise the CREOLE register. |
protected static void |
initCreoleRepositories()
Loads the CREOLE repositories (aka plugins) that the user has selected for automatic loading. |
static void |
initDataStoreRegister()
Initialise the DataStore register. |
protected static void |
initLocalPaths()
Initialises the paths to local files of interest like the GATE home, the installed plugins home and site and user configuration files. |
static boolean |
isEnableJapeDebug()
Should we enable Jape Debugger. |
static boolean |
isGateType(String classname)
Checks whether a particular class is a Gate defined type |
static boolean |
isLocalWebServer()
Should we assume there's a local web server? |
static boolean |
isNetConnected()
Should we assume we're connected to the net? |
static boolean |
isSlugGui()
Should we start SLUG GUI. |
static String |
locateGateFiles()
Find the location of the GATE binaries (and resources) in the local file system. |
static void |
registerIREngine(String className)
Registers a new IR engine. |
static void |
removeAutoloadPlugin(URL pluginURL)
Tells the system to remove a plugin URL from the list of plugins that are loaded automatically at system start-up. |
static void |
removeKnownPlugin(URL pluginURL)
Tells the system to "forget" about one previously known directory. |
static boolean |
runningOnUnix()
This method tries to guess if we are on a UNIX system. |
static void |
setEnableJapeDebug(boolean b)
Tell GATE whether to enable Jape Debugger. |
static void |
setExecutable(Executable executable)
Sets the Executable currently under execution. |
static void |
setGateHome(File gateHome)
Set the location of the GATE home directory. |
static void |
setHiddenAttribute(FeatureMap fm,
boolean hidden)
Sets the value for the HIDDEN attribute of a feature map |
static void |
setLocalWebServer(boolean b)
Tell GATE whether to assume there's a local web server. |
static void |
setNetConnected(boolean b)
Tell GATE whether to assume we're connected to the net. |
static void |
setPluginsHome(File pluginsHome)
Set the location of the plugins directory. |
static void |
setSiteConfigFile(File siteConfigFile)
Set the site config file (e.g. during command-line processing). |
static void |
setSlugGui(boolean b)
Tell GATE whether to start SLUG GUI. |
static void |
setUrlBase(URL urlBase)
Set the URL base for GATE files, e.g. |
static void |
setUserConfigFile(File userConfigFile)
Set the location of the user's config file. |
static void |
setUseXMLSerialization(boolean useXMLSerialization)
Tell GATE whether to use XML serialization for applications. |
protected static boolean |
tryFileSystem()
Try to find GATE files in the local file system |
static boolean |
tryNetServer(String hostName,
int serverPort,
String path)
Try to contact a network server. |
static boolean |
unregisterIREngine(String className)
Unregisters a previously registered IR engine. |
static void |
writeUserConfig()
Update the GATE development environment configuration data in the user's gate.xml file (create one if it doesn't exist). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STRINGBUFFER_SIZE
public static final int HASH_STH_SIZE
public static final String DB_OWNER
public static final String URI
protected static final String MIN_JDK_VERSION
protected static File gateHome
protected static File pluginsHome
protected static List knownPlugins
protected static List autoloadPlugins
protected static Map pluginData
Gate.DirectoryInfo
.
Constructor Detail |
---|
public Gate()
Method Detail |
---|
public static String getMinJdkVersion()
public static void init() throws GateException
GateException
initCreoleRegister()
protected static void initLocalPaths()
protected static void initCreoleRepositories()
public static void initCreoleRegister() throws GateException
GateException
public static void initDataStoreRegister()
public static void initConfigData() throws GateException
GateException
public static String guessUnicodeFont()
public static URL getUrl() throws GateException
Note that the value returned will only be calculated when the existing value recorded by this class is null (which will be the case when neither setUrlBase nor getUrlBase have been called, or if setUrlBase(null) has been called).
GateException
public static URL getUrl(String path) throws GateException
path
- a path to add to the base URL.
GateException
getUrl()
public static void registerIREngine(String className) throws GateException, ClassNotFoundException
IREngine
and be accessible via the GATE class
loader.
className
- the fully qualified name of the class to be registered
GateException
- if the class does not implement the
IREngine
interface.
ClassNotFoundException
- if the named class cannot be found.public static boolean unregisterIREngine(String className)
className
- the name of the class to be removed from the list of
registered IR engines.
public static Set getRegisteredIREngines()
Set
value.public static File getGateHome()
public static boolean isNetConnected()
public static void setNetConnected(boolean b)
init()
.
public static boolean isLocalWebServer()
public static void setLocalWebServer(boolean b)
public static boolean tryNetServer(String hostName, int serverPort, String path) throws MalformedURLException
hostName
- the name of the host to try and connect toserverPort
- the port to try and connect topath
- a path to append to the URL when we make a successfull
connection. E.g. for host xyz, port 80, path /thing, the resultant URL
would be http://xyz:80/thing.
MalformedURLException
protected static boolean tryFileSystem() throws MalformedURLException
MalformedURLException
public static String locateGateFiles()
public static boolean isGateType(String classname)
public static boolean getHiddenAttribute(FeatureMap fm)
public static void setHiddenAttribute(FeatureMap fm, boolean hidden)
public static void addCreoleListener(CreoleListener l)
CreoleListener
with the Gate system
public static void setUrlBase(URL urlBase)
public static GateClassLoader getClassLoader()
public static CreoleRegister getCreoleRegister()
public static DataStoreRegister getDataStoreRegister()
public static void setExecutable(Executable executable)
Executable
currently under execution.
At a given time there can be only one executable set. After the executable
has finished its execution this value should be set back to null.
An attempt to set the executable while this value is not null will result
in the method call waiting until the old executable is set to null.
public static Executable getExecutable()
setExecutable(gate.Executable)
public static String genSym()
public static String getUserConfigElement()
public static File getSiteConfigFile()
public static void setSiteConfigFile(File siteConfigFile)
public static String getEmptyConfigFile()
public static OptionsMap getUserConfig()
public static OptionsMap getOriginalUserConfig()
public static void writeUserConfig() throws GateException
GateException
public static String getUserConfigFileName()
getUserConfigFile()
instead.
public static String getDefaultUserConfigFileName()
setUserConfigFile(java.io.File)
.
public static String getUserSessionFileName()
public static boolean runningOnUnix()
public static List getKnownPlugins()
List
of URL
s.public static void addKnownPlugin(URL pluginURL)
pluginURL
- the URL for the new plugin.public static List getAutoloadPlugins()
List
of URL
s.public static void addAutoloadPlugin(URL pluginUrl)
pluginUrl
- the URL for the new plugin.public static Gate.DirectoryInfo getDirectoryInfo(URL directory)
directory
- the URL for the directory in question.
Gate.DirectoryInfo
value.public static void removeKnownPlugin(URL pluginURL)
pluginURL
- public static void removeAutoloadPlugin(URL pluginURL)
pluginURL
- the URL to be removed.public static void setGateHome(File gateHome)
IllegalStateException
- if the value has already been set.public static void setPluginsHome(File pluginsHome)
IllegalStateException
- if the value has already been set.public static File getPluginsHome()
Gate.init()
has not yet been called).public static void setUserConfigFile(File userConfigFile)
IllegalStateException
- if the value has already been set.public static File getUserConfigFile()
Gate.init()
has not yet been called).public static boolean isSlugGui()
public static void setSlugGui(boolean b)
public static boolean isEnableJapeDebug()
public static void setEnableJapeDebug(boolean b)
public static void setUseXMLSerialization(boolean useXMLSerialization)
public static boolean getUseXMLSerialization()
|
GATE Version 3.1-2270 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |