|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgalapi.Galax
The Galax
class contains methods needed to perform
queries and to manipulate data under different representations.
Constructor Summary | |
Galax()
|
Method Summary | |
static ModuleContext |
addExternalContext(ModuleContext mod_ctxt,
ExternalContext ext_ctxt)
Extends the given module context with the external context. |
static ProcessingContext |
defaultProcessingContext()
Returns the default ProcessingContext
which just contains flags for controlling debugging, printing, and
the processing phases. |
static ModuleContext |
evalGlobalVariables(ModuleContext mod_ctxt)
Evaluates the expressions for all - possibly mutually dependent - global variables. |
static ItemList |
evalQueryFunction(ModuleContext c,
java.lang.String funname,
ItemList[] params)
Given the ModuleContext , evaluates the function
whose name is given by funname applied to the
array of ItemListitem |
static ItemList |
evalStatementFromFileWithContextItemFromXML(Item ctxt,
java.lang.String querystr)
Bind the context item (the XPath "." expression) to the XML value in the item list argument and evaluate the XQuery statement in the file with name in the string argument. |
static ItemList |
evalStatementFromString(ModuleContext c,
java.lang.String querystring)
Given the ModuleContext , evaluates the XQuery
statement in the string argument. |
static ItemList |
evalStatements(QueryContext q)
Given the QueryContext ,
evaluates the statements containded in the query. |
static ItemList |
evalStatementWithContextItemFromDocument(java.lang.String filename,
java.lang.String querystr)
Bind the context item (the XPath "." expression) to the XML document in the resource named by the first string argument, and evaluate the XQuery statement in the second string argument. |
static ItemList |
evalStatementWithContextItemFromXML(Item ctxt,
java.lang.String querystr)
Bind the context item (the XPath "." expression) to the XML value in the item list argument and evaluate the XQuery statement in the string argument. |
static ItemList |
evalStatementWithVariablesFromXML(NameValuePair[] vars,
java.lang.String querystr)
The first argument is a list of variable name and XML value pairs. |
static ModuleContext |
importLibraryModule(ModuleContext mod_ctxt,
java.lang.String filename)
Used to import other library modules. |
static QueryContext |
importMainModule(ModuleContext mod_ctxt,
java.lang.String filename)
Used to import a main module defined in a file. |
protected static int |
importMainModuleFromString(int mod_ctxt,
java.lang.String str)
|
static QueryContext |
importMainModuleFromString(ModuleContext mod_ctxt,
java.lang.String str)
Same as importMainModule , but module
definition is provided in a string instead of a file. |
static void |
init()
Does the initialization stuff, that is it passes program arguments to the OCaml Sys module. |
static NodeList |
loadDocument(java.lang.String filename)
Loads an XML document into the Galax data model. |
static NodeList |
loadDocumentValidate(ModuleContext mc,
java.lang.String filename)
Loads an XML document and validates it with respect to a ModuleContext which may contain
imported schemas. |
static ModuleContext |
loadStandardLibrary(ProcessingContext pc)
Load the standard Galax library, which contains the built-in types, namespaces, and functions. |
protected static int |
nativeAddExternalContext(int mod_ctxt,
int ext_ctxt)
|
protected static int |
nativeDefaultProcessingContext()
|
protected static int |
nativeEvalGlobalVariables(int mod_ctxt)
|
protected static int |
nativeEvalQueryFunction(int c,
java.lang.String funname,
int[] params)
|
protected static int |
nativeEvalStatementFromFileWithContextItemFromXML(int it,
java.lang.String filename)
|
protected static int |
nativeEvalStatementFromString(int c,
java.lang.String querystring)
|
protected static int |
nativeEvalStatements(int q)
|
protected static int |
nativeEvalStatementWithContextItemFromDocument(java.lang.String filename,
java.lang.String querystr)
|
protected static int |
nativeEvalStatementWithContextItemFromXML(int it,
java.lang.String querystr)
|
protected static int |
nativeEvalStatementWithVariablesFromXML(java.lang.String[] varnames,
int[] varvals,
java.lang.String querystr)
|
protected static int |
nativeImportLibraryModule(int mod_ctxt,
java.lang.String filename)
|
protected static int |
nativeImportMainModule(int mod_ctxt,
java.lang.String filename)
|
protected static int |
nativeLoadDocument(java.lang.String filename)
|
protected static int |
nativeLoadDocumentValidate(int mc,
java.lang.String filename)
|
protected static int |
nativeLoadStandardLibrary(int pc)
|
protected static void |
nativeSerializeToFile(java.lang.String filename,
int xml)
|
protected static void |
nativeSerializeToOutputChannel(int xml)
|
protected static java.lang.String |
nativeSerializeToString(int xml)
|
static void |
serializeToFile(java.lang.String filename,
ItemList xml)
Serializes an XQuery data model value to a file |
static void |
serializeToOutputChannel(ItemList xml)
Serializes an XQuery data model value to standard output |
static java.lang.String |
serializeToString(ItemList xml)
Serializes an XQuery data model value to a string |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Galax()
Method Detail |
public static void init() throws GalapiException
GalapiException
public static NodeList loadDocument(java.lang.String filename) throws GalapiException
filename
- The name of the file containing the XML document
GalapiException
public static NodeList loadDocumentValidate(ModuleContext mc, java.lang.String filename) throws GalapiException
ModuleContext
which may contain
imported schemas.
mc
- the context used for validationfilename
- the name of the file containing the XML document
GalapiException
public static java.lang.String serializeToString(ItemList xml) throws GalapiException
xml
- a collection of items representing an XML value
GalapiException
public static void serializeToOutputChannel(ItemList xml) throws GalapiException
xml
- a collection of items representing an XML value
GalapiException
public static void serializeToFile(java.lang.String filename, ItemList xml) throws GalapiException
filename
- the name of the output file to be producedxml
- a collection of items representing an XML value
GalapiException
public static ProcessingContext defaultProcessingContext() throws GalapiException
ProcessingContext
which just contains flags for controlling debugging, printing, and
the processing phases.
GalapiException
public static ModuleContext loadStandardLibrary(ProcessingContext pc) throws GalapiException
GalapiException
public static ModuleContext importLibraryModule(ModuleContext mod_ctxt, java.lang.String filename) throws GalapiException
ModuleContext
argument extended
with the module in the string filename argument.
GalapiException
public static QueryContext importMainModule(ModuleContext mod_ctxt, java.lang.String filename) throws GalapiException
ModuleContext
argument
extended with the main module in the string filename argument
and a list of statements to evaluate.
GalapiException
QueryContext
public static QueryContext importMainModuleFromString(ModuleContext mod_ctxt, java.lang.String str) throws GalapiException
importMainModule
, but module
definition is provided in a string instead of a file.
GalapiException
public static ModuleContext addExternalContext(ModuleContext mod_ctxt, ExternalContext ext_ctxt) throws GalapiException
mod_ctxt
- a given ModuleContext
ext_ctxt
- an ExternalContext
used for the extension of the context
ModuleContext
obtained by extending
the a given environment with an external environment.
GalapiException
public static ModuleContext evalGlobalVariables(ModuleContext mod_ctxt) throws GalapiException
It must be called before the other evalXXX functions.
mod_ctxt
- a context obtained with one of the methods from
this class
GalapiException
public static ItemList evalStatementFromString(ModuleContext c, java.lang.String querystring) throws GalapiException
ModuleContext
, evaluates the XQuery
statement in the string argument.
GalapiException
public static ItemList evalQueryFunction(ModuleContext c, java.lang.String funname, ItemList[] params) throws GalapiException
ModuleContext
, evaluates the function
whose name is given by funname
applied to the
array of ItemListitem arguments.
NOTE: Each actual function argument is bound to one item list.
- Throws:
GalapiException
public static ItemList evalStatements(QueryContext q) throws GalapiException
QueryContext
,
evaluates the statements containded in the query.
GalapiException
public static ItemList evalStatementWithContextItemFromDocument(java.lang.String filename, java.lang.String querystr) throws GalapiException
GalapiException
public static ItemList evalStatementWithContextItemFromXML(Item ctxt, java.lang.String querystr) throws GalapiException
GalapiException
public static ItemList evalStatementFromFileWithContextItemFromXML(Item ctxt, java.lang.String querystr) throws GalapiException
GalapiException
public static ItemList evalStatementWithVariablesFromXML(NameValuePair[] vars, java.lang.String querystr) throws GalapiException
GalapiException
protected static int nativeLoadDocument(java.lang.String filename)
protected static int nativeLoadDocumentValidate(int mc, java.lang.String filename)
protected static java.lang.String nativeSerializeToString(int xml)
protected static void nativeSerializeToOutputChannel(int xml)
protected static void nativeSerializeToFile(java.lang.String filename, int xml)
protected static int nativeDefaultProcessingContext()
protected static int nativeLoadStandardLibrary(int pc)
protected static int nativeImportLibraryModule(int mod_ctxt, java.lang.String filename)
protected static int nativeImportMainModule(int mod_ctxt, java.lang.String filename)
protected static int importMainModuleFromString(int mod_ctxt, java.lang.String str)
protected static int nativeAddExternalContext(int mod_ctxt, int ext_ctxt)
protected static int nativeEvalGlobalVariables(int mod_ctxt)
protected static int nativeEvalStatementFromString(int c, java.lang.String querystring)
protected static int nativeEvalQueryFunction(int c, java.lang.String funname, int[] params)
protected static int nativeEvalStatements(int q)
protected static int nativeEvalStatementWithContextItemFromDocument(java.lang.String filename, java.lang.String querystr)
protected static int nativeEvalStatementWithContextItemFromXML(int it, java.lang.String querystr)
protected static int nativeEvalStatementFromFileWithContextItemFromXML(int it, java.lang.String filename)
protected static int nativeEvalStatementWithVariablesFromXML(java.lang.String[] varnames, int[] varvals, java.lang.String querystr)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |