project.biota.util
Class BiotaUtils

java.lang.Object
  extended byproject.biota.util.BiotaUtils

public class BiotaUtils
extends Object

BiotaUtils provides static utilities for this provider.

Author:
Kimmy Lin

Method Summary
static Set getAllResources()
          Gets all the resources available in this provider.
static String getDiGIRSchemaLocation()
          Gets the location of the DiGIR schema.
static Namespace getDiGIRSchemaNamespace()
          Gets the JDOM Namespace for the DiGIR schema.
static String getDiGIRSchemaURI()
          Gets the URI of the DiGIR schema.
static int getKeywordType(String word)
          Returns the type of the DiGIR keyword.
static String getKeywordValue(String word)
          Returns the value associated with the DiGIR keyword string.
static Element getProviderMetadata()
          Returns a JDOM element that holds this provider's metadata.
static String getProviderVersion()
          Gets the software version of this provider.
static ResourceObject getResourceObject(String rscName)
          Gets the ResourceObject object for the resource specified by rscName.
static Namespace getSchemaInstanceNamespace()
          Gets the JDOM Namespace for the XML schema instance.
static void initializeResources(ServletContext context)
          Intializes this provider.
static boolean isSQLKeyword(String word)
          Checks whether a string is an SQL keyword.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initializeResources

public static void initializeResources(ServletContext context)
Intializes this provider. It reads all the properties and the resource configration files. This method should be called when the servlet's context is initialized.

Parameters:
context - the ServletContext object for the application's servlet

isSQLKeyword

public static boolean isSQLKeyword(String word)
Checks whether a string is an SQL keyword.

Parameters:
word - the string to check whether it is an SQL keyword
Returns:
true if the string is an SQL keyword

getAllResources

public static Set getAllResources()
Gets all the resources available in this provider.

Returns:
a set of resource names

getResourceObject

public static ResourceObject getResourceObject(String rscName)
Gets the ResourceObject object for the resource specified by rscName.

Parameters:
rscName - the name of the resource
Returns:
a ResourceObject object that holds the info of the resource

getProviderMetadata

public static Element getProviderMetadata()
Returns a JDOM element that holds this provider's metadata.

Returns:
a JDOM element that holds this provider's metadata

getKeywordValue

public static String getKeywordValue(String word)
Returns the value associated with the DiGIR keyword string. Retunrs null if the specified string is not a keyword. For example, the value associated with DiGIR keyword "notEquals" is "!=" and with "ANDNOT" is "and not".

Parameters:
word - the DiGIR keyword string
Returns:
the corresponding value for the DiGIR keyword
See Also:
Keyword.getValue()

getKeywordType

public static int getKeywordType(String word)
Returns the type of the DiGIR keyword. It returns -1 if the specified string is not a DiGIR keyword. If it's a DiGIR keyword, it returns Keyword.COP, Keyword.MULTICOP, or Keyword.LOP.

Parameters:
word - the DiGIR keyword string
Returns:
the corresponding keyword type
See Also:
Keyword.getKeyType()

getProviderVersion

public static String getProviderVersion()
Gets the software version of this provider.

Returns:
the version string of this provider

getSchemaInstanceNamespace

public static Namespace getSchemaInstanceNamespace()
Gets the JDOM Namespace for the XML schema instance.

Returns:
the JDOM Namespace object for the XML schema instance

getDiGIRSchemaNamespace

public static Namespace getDiGIRSchemaNamespace()
Gets the JDOM Namespace for the DiGIR schema.

Returns:
the JDOM Namespace object for the DiGIR schema

getDiGIRSchemaURI

public static String getDiGIRSchemaURI()
Gets the URI of the DiGIR schema.

Returns:
the URI of the DiGIR schema

getDiGIRSchemaLocation

public static String getDiGIRSchemaLocation()
Gets the location of the DiGIR schema.

Returns:
the location of the DiGIR schema


Copyright © 2004 University of Massachusetts at Boston. All Rights Reserved.