Java Doc for StaticQueryContext.java in  » XML » XPath-Saxon » net » sf » saxon » query » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » XPath Saxon » net.sf.saxon.query 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sf.saxon.query.StaticQueryContext

StaticQueryContext
public class StaticQueryContext implements StaticContext(Code)
StaticQueryContext is the implementation of StaticContext used when processing XQuery expressions.

The StaticQueryContext object has two different usages. The application constructs a StaticQueryContext and initializes it with information about the context, for example, default namespaces, base URI, and so on. When a query is compiled using this StaticQueryContext, the query parser makes a copy of the StaticQueryContext and uses this internally, modifying it with information obtained from the query prolog, as well as information such as namespace and variable declarations that can occur at any point in the query. The query parser does not modify the original StaticQueryContext supplied by the calling application, which may therefore be used for compiling multiple queries, serially or even in multiple threads.

This class forms part of Saxon's published XQuery API. Note that some of the methods are intended for use internally by the query processor itself: these are labelled as such. Methods that are considered stable are labelled with the JavaDoc "since" tag. The value 8.4 indicates a method introduced at or before Saxon 8.4; other values indicate the version at which the method was introduced.

In the longer term, this entire API may at some stage be superseded by a proposed standard Java API for XQuery.
since:
   8.4




Constructor Summary
public  StaticQueryContext(Configuration config)
     Create a StaticQueryContext using a given Configuration.
public  StaticQueryContext(Configuration config, StaticQueryContext importer)
     Create a StaticQueryContext for a library module.
Parameters:
  importer - the module that imported this module.

Method Summary
public  voidaddImportedNamespace(String uri)
    
public  voidaddImportedSchema(String targetNamespace)
     Add an imported schema to this static context.
public  voidbindUnboundFunctionCalls()
     Bind function calls that could not be bound when first encountered.
public  voidbindUnboundVariables()
    
public  VariableReferencebindVariable(int fingerprint)
     Bind a variable used in a query to the expression in which it is declared.
public  DocumentInfobuildDocument(Source source)
     Convenience method for building Saxon's internal representation of a source XML document.
public  StringcheckURIForPrefix(String prefix)
     Get the URI for a prefix if there is one, return null if not. This method is used by the XQuery parser to resolve namespace prefixes.

This method is intended primarily for internal use.
Parameters:
  prefix - The prefix.

public  voidclearPassiveNamespaces()
    
public  XQueryExpressioncompileQuery(String query)
     Prepare an XQuery query for subsequent evaluation.
public  XQueryExpressioncompileQuery(Reader source)
     Prepare an XQuery query for subsequent evaluation.
public  XQueryExpressioncompileQuery(InputStream source, String encoding)
     Prepare an XQuery query for subsequent evaluation.
public  StaticQueryContextcopy()
     Make a copy of this StaticQueryContext.
public  voiddeclareActiveNamespace(String prefix, String uri)
     Declare an active namespace, that is, a namespace which as well as affecting the static context of the query, will also be copied to the result tree when element constructors are evaluated.
public  voiddeclareCollation(String name, Comparator comparator)
     Declare a named collation.
public  voiddeclareDefaultCollation(String name)
     Set the default collation.
Parameters:
  name - The collation name, as specified in the query prolog.
public  voiddeclareFunction(XQueryFunction function)
     Register a user-defined XQuery function.
public  voiddeclarePassiveNamespace(String prefix, String uri, boolean explicit)
     Declare a namespace whose prefix can be used in expressions.
public  voiddeclareVariable(VariableDeclaration var)
     Declare a global variable.
public  voidexplainGlobalFunctions()
     Output "explain" information about each declared function.
public  voidexplainGlobalVariables()
     Produce "explain" output for all global variables.
public  voidfixupGlobalFunctions()
     Fixup all references to global functions.
public  ListfixupGlobalVariables(SlotManager globalVariableMap)
     Fixup all references to global variables.
public  int[]getActiveNamespaceCodes()
     Get an array containing the namespace codes of all active namespaces.
public  HashMapgetAllCollations()
     Get a HashMap that maps all registered collations to Comparators.
public  StringgetBaseURI()
     Get the Base URI of the query, for resolving any relative URI's used in the expression.
public  ComparatorgetCollation(String name)
     Get a named collation.
public  ConfigurationgetConfiguration()
    
public  intgetConstructionMode()
    
public  StringgetDefaultCollationName()
     Get the name of the default collation. the name of the default collation; or the name of the codepoint collationif no default collation has been defined.
public  shortgetDefaultElementNamespace()
    
public  StringgetDefaultFunctionNamespace()
    
public  ExecutablegetExecutable()
     Get the Executable, an object representing the compiled query and its environment.
public  NamespaceResolvergetExternalNamespaceResolver()
     Get the external namespace resolver that has been registered using setExternalNamespaceResolver(), if any.
public  FunctionLibrarygetFunctionLibrary()
     Get the function library containing all the in-scope functions available in this static context (that is, the functions available in this query module).

This method is provided for use by advanced applications. The details of the interface are subject to change. the FunctionLibrary used.

public  XQueryFunctionLibrarygetGlobalFunctionLibrary()
    
public  SlotManagergetGlobalStackFrameMap()
     Get the stack frame map for global variables.
public  ImportedFunctionLibrarygetImportedFunctionLibrary()
    
public  SetgetImportedSchemaNamespaces()
    
public  intgetLineNumber()
     Get the line number of the expression within that container. Used to construct error messages.
public  XQueryFunctionLibrarygetLocalFunctionLibrary()
    
public  LocationMapgetLocationMap()
     Get the LocationMap, an data structure used to identify the location of compiled expressions within the query source text.
public  StringgetLocationURI()
    
public  StringgetModuleNamespace()
     Get the namespace of the current library module.
public  shortgetModuleNamespaceCode()
     Get the namesapce code of the current library module.
public  IteratorgetModuleVariables()
    
public  NamePoolgetNamePool()
    
public  NamespaceResolvergetNamespaceResolver()
     Get a copy of the Namespace Context.
public  SlotManagergetStackFrameMap()
     Get the stack frame map for local variables in the "main" query expression.
public  StringgetSystemId()
     Get the system ID of the container of the expression.
public  StaticQueryContextgetTopLevelModule(StaticQueryContext start)
     Get the Static Query Context for the top-level module.
public  StringgetURIForPrefix(String prefix)
     Get the URI for a prefix.
public  ListgetUndeclaredVariables(SlotManager globalVariableMap)
     Get references to undeclared variables.
public  UserFunctiongetUserDefinedFunction(String uri, String localName, int arity)
     Get the function with a given name and arity.
public  booleanimportsNamespace(String uri)
    
public  booleanimportsNamespaceIndirectly(String uri)
    
public  booleanisAllowedBuiltInType(AtomicType type)
     Determine whether a built-in type is available in this context.
public  booleanisImportedSchema(String namespace)
     Get the schema for a given namespace, if it has been imported
Parameters:
  namespace - The namespace of the required schema.
public  booleanisInBackwardsCompatibleMode()
    
public  booleanisInheritNamespaces()
    
public  booleanisMainModule()
    
public  booleanisPreserveNamespaces()
    
public  booleanisTopLevelModule()
     Test whether this is a "top-level" module.
public  voidissueWarning(String s, SourceLocator locator)
     Issue a compile-time warning.
public  IteratoriterateImportedNamespaces()
    
public  XPathContextmakeEarlyEvaluationContext()
    
public static  StaticQueryContextmakeStaticQueryContext(String baseURI, Executable executable, StaticQueryContext importer, String query, String namespaceURI)
     Supporting method to load a query module.
public  booleanmayImport(String namespace)
     Check whether this module is allowed to import a module with namespace N.
public  voidreset()
    
public  voidsetBaseURI(String baseURI)
    
public  voidsetConfiguration(Configuration config)
    
public  voidsetConstructionMode(int mode)
    
public  voidsetDefaultElementNamespace(String uri)
    
public  voidsetDefaultFunctionNamespace(String defaultFunctionNamespace)
    
public  voidsetExecutable(Executable executable)
     Set the executable.
public  voidsetExternalNamespaceResolver(NamespaceResolver resolver)
     Set an external namespace resolver.
public  voidsetFunctionLibraryList(FunctionLibraryList functionLibrary)
     Set the function library used for binding any function call appearing within the query module.

This method is available for use by advanced applications.

public  voidsetInheritNamespaces(boolean inherit)
    
public  voidsetLocationURI(String uri)
    
public  voidsetModuleNamespace(String uri)
     Set the namespace for a library module.
public  voidsetPreserveNamespaces(boolean inherit)
    
public  voidtypeCheckGlobalVariables(List compiledVars)
    
public  voidundeclareNamespace()
     Undeclare the most recently-declared active namespace.


Constructor Detail
StaticQueryContext
public StaticQueryContext(Configuration config)(Code)
Create a StaticQueryContext using a given Configuration. This creates a StaticQueryContext for a main module (that is, a module that is not a library module).
since:
   8.4



StaticQueryContext
public StaticQueryContext(Configuration config, StaticQueryContext importer)(Code)
Create a StaticQueryContext for a library module.
Parameters:
  importer - the module that imported this module. This may be null, in which case thelibrary module is treated as a "top-level" library module.




Method Detail
addImportedNamespace
public void addImportedNamespace(String uri)(Code)
Register that this module imports a particular module namespace



addImportedSchema
public void addImportedSchema(String targetNamespace)(Code)
Add an imported schema to this static context. A query module can reference types in a schema provided two conditions are satisfied: the schema containing those types has been loaded into the Configuration, and the target namespace has been imported by this query module. This method achieves the second of these conditions. It does not cause the schema to be loaded.


Parameters:
  targetNamespace - The target namespace of the schema to be added
since:
   8.4




bindUnboundFunctionCalls
public void bindUnboundFunctionCalls() throws XPathException(Code)
Bind function calls that could not be bound when first encountered. These will either be forwards references to functions declared later in the same query module, or in modules that are being imported recursively, or errors.

This method is for internal use only.
throws:
  net.sf.saxon.trans.StaticError - if a function call refers to a function that hasnot been declared




bindUnboundVariables
public void bindUnboundVariables() throws XPathException(Code)
Bind unbound variables (these are typically variables that reference another module participating in a same-namespace cycle, since local forwards references are not allowed



bindVariable
public VariableReference bindVariable(int fingerprint) throws StaticError(Code)
Bind a variable used in a query to the expression in which it is declared.

This method is provided for use by the XQuery parser, and it should not be called by the user of the API, or overridden, unless variables are to be declared using a mechanism other than the declareVariable method of this class.




buildDocument
public DocumentInfo buildDocument(Source source) throws XPathException(Code)
Convenience method for building Saxon's internal representation of a source XML document. The document will be built using the default NamePool, which means that any process that uses it must also use the default NamePool.
Parameters:
  source - Any javax.xml.transform.Source object representing the document againstwhich queries will be executed. Note that a Saxon net.sf.saxon.om.DocumentInfo DocumentInfo(indeed any net.sf.saxon.om.NodeInfo NodeInfo)can be used as a Source. To use a third-party DOM Document as a source, create an instance ofjavax.xml.transform.dom.DOMSource DOMSource to wrap it.

For additional control over the way in which the source document is processed,supply an net.sf.saxon.AugmentedSource AugmentedSource object and set appropriateoptions on the object.

the DocumentInfo representing the root node of the resulting document object.
since:
   8.4



checkURIForPrefix
public String checkURIForPrefix(String prefix)(Code)
Get the URI for a prefix if there is one, return null if not. This method is used by the XQuery parser to resolve namespace prefixes.

This method is intended primarily for internal use.
Parameters:
  prefix - The prefix. Supply "" to obtain the default namespace. the corresponding namespace URI, or null if the prefix has notbeen declared. If the prefix is "" and the default namespace is the non-namespace,return "".




clearPassiveNamespaces
public void clearPassiveNamespaces()(Code)
Clear all the declared passive namespaces, except for the standard ones (xml, saxon, etc)
since:
   8.4



compileQuery
public XQueryExpression compileQuery(String query) throws XPathException(Code)
Prepare an XQuery query for subsequent evaluation. The source text of the query is supplied as a String. The base URI of the query is taken from the static context, and defaults to the current working directory.
Parameters:
  query - The XQuery query to be evaluated, supplied as a string. an XQueryExpression object representing the prepared expression
throws:
  net.sf.saxon.trans.XPathException - if the syntax of the expression is wrong,or if it references namespaces, variables, or functions that have not been declared,or contains other static errors.
since:
   8.4



compileQuery
public XQueryExpression compileQuery(Reader source) throws XPathException, IOException(Code)
Prepare an XQuery query for subsequent evaluation. The Query is supplied in the form of a Reader. The base URI of the query is taken from the static context, and defaults to the current working directory.
Parameters:
  source - A Reader giving access to the text of the XQuery query to be compiled. an XPathExpression object representing the prepared expression.
throws:
  net.sf.saxon.trans.XPathException - if the syntax of the expression is wrong, or if it references namespaces,variables, or functions that have not been declared, or any other static error is reported.
throws:
  java.io.IOException - if a failure occurs reading the supplied input.
since:
   8.4



compileQuery
public XQueryExpression compileQuery(InputStream source, String encoding) throws XPathException, IOException(Code)
Prepare an XQuery query for subsequent evaluation. The Query is supplied in the form of a InputStream, with an optional encoding. If the encoding is not specified, the query parser attempts to obtain the encoding by inspecting the input stream: it looks specifically for a byte order mark, and for the encoding option in the version declaration of an XQuery prolog. The encoding defaults to UTF-8. The base URI of the query is taken from the static context, and defaults to the current working directory.
Parameters:
  source - An InputStream giving access to the text of the XQuery query to be compiled, as a streamof octets
Parameters:
  encoding - The encoding used to translate characters to octets in the query source. The parametermay be null: in this case the query parser attempts to infer the encoding by inspecting the source,and if that fails, it assumes UTF-8 encoding an XPathExpression object representing the prepared expression.
throws:
  net.sf.saxon.trans.XPathException - if the syntax of the expression is wrong, or if it references namespaces,variables, or functions that have not been declared, or any other static error is reported.
throws:
  java.io.IOException - if a failure occurs reading the supplied input.
since:
   8.5



copy
public StaticQueryContext copy()(Code)
Make a copy of this StaticQueryContext. The StaticQueryContext that is constructed by a user application and passed to Saxon when a query is compiled should not be modified by the query compiler. Saxon therefore makes a copy of the StaticQueryContext and uses this copy internally, to capture any changes to the StaticQueryContext defined in the query prolog. a copy of this StaticQueryContext



declareActiveNamespace
public void declareActiveNamespace(String prefix, String uri)(Code)
Declare an active namespace, that is, a namespace which as well as affecting the static context of the query, will also be copied to the result tree when element constructors are evaluated. When searching for a prefix-URI binding, active namespaces are searched first, then passive namespaces. Active namespaces may be undeclared (in reverse sequence) using StaticQueryContext.undeclareNamespace() .

This method is intended for internal use only.




declareCollation
public void declareCollation(String name, Comparator comparator)(Code)
Declare a named collation. Collations are only available in a query if this method has been called externally to declare the collation and associate it with an implementation, in the form of a Java Comparator. The default collation is the Unicode codepoint collation, unless otherwise specified.
Parameters:
  name - The name of the collation (technically, a URI)
Parameters:
  comparator - The Java Comparator used to implement the collating sequence
since:
   8.4



declareDefaultCollation
public void declareDefaultCollation(String name)(Code)
Set the default collation.
Parameters:
  name - The collation name, as specified in the query prolog. The nameis not validated until it is used.
since:
   8.4. Changed in 8.6 so it no longer validates the collation name: this is
since:
   because the base URI is not necessarily known at the point where the default
since:
   collation is declared.



declareFunction
public void declareFunction(XQueryFunction function) throws StaticError(Code)
Register a user-defined XQuery function.

This method is intended for internal use only.




declarePassiveNamespace
public void declarePassiveNamespace(String prefix, String uri, boolean explicit) throws StaticError(Code)
Declare a namespace whose prefix can be used in expressions. This is a passive namespace, it won't be copied into the result tree. Passive namespaces are never undeclared, and active namespaces override them.
Parameters:
  prefix - The namespace prefix. Must not be null.
Parameters:
  uri - The namespace URI. Must not be null. The value "" (zero-length string) is usedto undeclare a namespace; it is not an error if there is no existing binding forthe namespace prefix.
Parameters:
  explicit - This parameter is set to true when Saxon calls the method internally todefine a namespace declared within the query prolog. It should normally be set to falsein the case of a call from a user application.
since:
   8.4



declareVariable
public void declareVariable(VariableDeclaration var) throws StaticError(Code)
Declare a global variable. A variable must normally be declared before an expression referring to it is compiled, but there are exceptions where a set of modules in the same namespace import each other cyclically. Global variables are normally declared in the Query Prolog, but they can also be predeclared using this API. All global variables are held in the StaticQueryContext for the main module. The fact that a global variable is present therefore does not mean that it is visible: there are two additional conditions (a) the namespace must be imported into the module where the reference appears, and (b) the declaration must not be in the same module and textually after the reference.
since:
   8.4



explainGlobalFunctions
public void explainGlobalFunctions() throws XPathException(Code)
Output "explain" information about each declared function.

This method is intended primarily for internal use.




explainGlobalVariables
public void explainGlobalVariables()(Code)
Produce "explain" output for all global variables.

This method is intended primarily for internal use.




fixupGlobalFunctions
public void fixupGlobalFunctions() throws XPathException(Code)
Fixup all references to global functions. This method is called on completion of query parsing. Each XQueryFunction is required to bind all references to that function to the object representing the run-time executable code of the function.

This method is for internal use only.




fixupGlobalVariables
public List fixupGlobalVariables(SlotManager globalVariableMap) throws StaticError(Code)
Fixup all references to global variables.

This method is for internal use by the Query Parser only.




getActiveNamespaceCodes
public int[] getActiveNamespaceCodes()(Code)
Get an array containing the namespace codes of all active namespaces.

This method is for internal use only.




getAllCollations
public HashMap getAllCollations()(Code)
Get a HashMap that maps all registered collations to Comparators. Note that this returns a snapshot copy of the data held by the static context. This method is provided for internal use by the query processor.

This method is intended for internal use.




getBaseURI
public String getBaseURI()(Code)
Get the Base URI of the query, for resolving any relative URI's used in the expression. Note that the systemID and the Base URI are currently identical, but they might be distinguished in the future. Used by the document() function. the base URI of the query
since:
   8.4



getCollation
public Comparator getCollation(String name)(Code)
Get a named collation.
Parameters:
  name - the name of the collation, as an absolute URI the collation identified by the given name, as set previously using declareCollation.If no collation with this name has been declared, the method calls the CollationURIResolverto locate a collation with this name.Return null if no collation with this name is found.
since:
   8.4



getConfiguration
public Configuration getConfiguration()(Code)
Get the Configuration options
since:
   8.4



getConstructionMode
public int getConstructionMode()(Code)
Get the current validation mode one of Validation.STRIP, Validation.PRESERVE
since:
   8.4



getDefaultCollationName
public String getDefaultCollationName()(Code)
Get the name of the default collation. the name of the default collation; or the name of the codepoint collationif no default collation has been defined. The name is returned in the formit was specified; that is, it is not yet resolved against the base URI. (Thisis because the base URI declaration can follow the default collation declarationin the query prolog.) If no default collation has been specified, the "default default"(that is, the Unicode codepoint collation) is returned.
since:
   8.4



getDefaultElementNamespace
public short getDefaultElementNamespace()(Code)
Get the default XPath namespace, as a namespace URI code that can be looked up in the NamePool
since:
   8.4



getDefaultFunctionNamespace
public String getDefaultFunctionNamespace()(Code)
Get the default function namespace the default function namespace (defaults to the fn: namespace)
since:
   8.4



getExecutable
public Executable getExecutable()(Code)
Get the Executable, an object representing the compiled query and its environment.

This method is intended for internal use only. the Executable




getExternalNamespaceResolver
public NamespaceResolver getExternalNamespaceResolver()(Code)
Get the external namespace resolver that has been registered using setExternalNamespaceResolver(), if any.



getFunctionLibrary
public FunctionLibrary getFunctionLibrary()(Code)
Get the function library containing all the in-scope functions available in this static context (that is, the functions available in this query module).

This method is provided for use by advanced applications. The details of the interface are subject to change. the FunctionLibrary used. For XQuery, this will always be a FunctionLibraryList.
See Also:   FunctionLibraryList




getGlobalFunctionLibrary
public XQueryFunctionLibrary getGlobalFunctionLibrary()(Code)



getGlobalStackFrameMap
public SlotManager getGlobalStackFrameMap()(Code)
Get the stack frame map for global variables.

This method is intended for internal use.




getImportedFunctionLibrary
public ImportedFunctionLibrary getImportedFunctionLibrary()(Code)



getImportedSchemaNamespaces
public Set getImportedSchemaNamespaces()(Code)
Get the set of imported schemas a Set, the set of URIs representing the names of imported schemas



getLineNumber
public int getLineNumber()(Code)
Get the line number of the expression within that container. Used to construct error messages. This method is provided to satisfy the StaticContext interface, but the value is meaningful only for XPath expressions within a document such as a stylesheet. -1 always



getLocalFunctionLibrary
public XQueryFunctionLibrary getLocalFunctionLibrary()(Code)
Get the functions declared locally within this module



getLocationMap
public LocationMap getLocationMap()(Code)
Get the LocationMap, an data structure used to identify the location of compiled expressions within the query source text.

This method is intended for internal use only. the LocationMap




getLocationURI
public String getLocationURI()(Code)
Get the location URI for a module



getModuleNamespace
public String getModuleNamespace()(Code)
Get the namespace of the current library module.

This method is intended primarily for internal use. the module namespace, or null if this is a main module




getModuleNamespaceCode
public short getModuleNamespaceCode()(Code)
Get the namesapce code of the current library module.

This method is intended primarily for internal use. the module namespace, or null if this is a main module




getModuleVariables
public Iterator getModuleVariables()(Code)
Get global variables declared in this module an Iterator whose items are GlobalVariableDefinition objects



getNamePool
public NamePool getNamePool()(Code)
Get the NamePool used for compiling expressions
since:
   8.4



getNamespaceResolver
public NamespaceResolver getNamespaceResolver()(Code)
Get a copy of the Namespace Context. This method is used internally by the query parser when a construct is encountered that needs to save the namespace context for use at run-time.

This method is for internal use only.




getStackFrameMap
public SlotManager getStackFrameMap()(Code)
Get the stack frame map for local variables in the "main" query expression.

This method is intended for internal use only.




getSystemId
public String getSystemId()(Code)
Get the system ID of the container of the expression. Used to construct error messages. Note that the systemID and the Base URI are currently identical, but they might be distinguished in the future. the Base URI
since:
   8.4



getTopLevelModule
public StaticQueryContext getTopLevelModule(StaticQueryContext start)(Code)
Get the Static Query Context for the top-level module. This will normally be a main module, but in the case of saxon:import-query it will be the library module that is imported into the stylesheet



getURIForPrefix
public String getURIForPrefix(String prefix) throws XPathException(Code)
Get the URI for a prefix. This method is used by the XQuery parser to resolve namespace prefixes.

This method is intended primarily for internal use.
Parameters:
  prefix - The prefix the corresponding namespace URI
throws:
  net.sf.saxon.trans.XPathException - if the prefix has not been declared




getUndeclaredVariables
public List getUndeclaredVariables(SlotManager globalVariableMap) throws StaticError(Code)
Get references to undeclared variables. a list of XPathException objects, one for each undeclared variable



getUserDefinedFunction
public UserFunction getUserDefinedFunction(String uri, String localName, int arity)(Code)
Get the function with a given name and arity. This method is provided so that XQuery functions can be called directly from a Java application. Note that there is no type checking or conversion of arguments when this is done: the arguments must be provided in exactly the form that the function signature declares them.
Parameters:
  uri - the uri of the function name
Parameters:
  localName - the local part of the function name
Parameters:
  arity - the number of arguments.
since:
   8.4



importsNamespace
public boolean importsNamespace(String uri)(Code)
Test whether this module directly imports a particular namespace



importsNamespaceIndirectly
public boolean importsNamespaceIndirectly(String uri)(Code)
Test whether this module imports a particular namespace directly or indirectly



isAllowedBuiltInType
public boolean isAllowedBuiltInType(AtomicType type)(Code)
Determine whether a built-in type is available in this context. This method caters for differences between host languages as to which set of types are built in.
Parameters:
  type - the supposedly built-in type. This will always be a type in theXS or XDT namespace. true if this type can be used in this static context



isImportedSchema
public boolean isImportedSchema(String namespace)(Code)
Get the schema for a given namespace, if it has been imported
Parameters:
  namespace - The namespace of the required schema. Supply "" fora no-namespace schema. The schema if found, or null if not found.
since:
   8.4



isInBackwardsCompatibleMode
public boolean isInBackwardsCompatibleMode()(Code)
Determine whether Backwards Compatible Mode is used false; XPath 1.0 compatibility mode is not supported in XQuery
since:
   8.4



isInheritNamespaces
public boolean isInheritNamespaces()(Code)
Get the namespace inheritance mode true if namespaces are inherited, false if not
since:
   8.4



isMainModule
public boolean isMainModule()(Code)
Test whether this is a "main" module, in the sense of the XQuery language specification



isPreserveNamespaces
public boolean isPreserveNamespaces()(Code)
Get the namespace copy mode true if namespaces are preserved, false if not
since:
   8.4



isTopLevelModule
public boolean isTopLevelModule()(Code)
Test whether this is a "top-level" module. This is true for a main module and also for a module directly imported into an XSLT stylesheet. It may also be true in future for independently-compiled modules



issueWarning
public void issueWarning(String s, SourceLocator locator)(Code)
Issue a compile-time warning. This method is used during XQuery expression compilation to output warning conditions.

This method is intended for internal use only.




iterateImportedNamespaces
public Iterator iterateImportedNamespaces()(Code)
Get an iterator over all the module namespaces that this module imports



makeEarlyEvaluationContext
public XPathContext makeEarlyEvaluationContext()(Code)
Construct a dynamic context for early evaluation of constant subexpressions



makeStaticQueryContext
public static StaticQueryContext makeStaticQueryContext(String baseURI, Executable executable, StaticQueryContext importer, String query, String namespaceURI) throws StaticError(Code)
Supporting method to load a query module. Used also by saxon:import-query in XSLT.

This method is intended for internal use only.
Parameters:
  baseURI - The base URI and location URI of the module
Parameters:
  executable - The Executable
Parameters:
  importer - The importing query module (used to check for cycles). This is nullwhen loading a query module from XSLT.
Parameters:
  query - The text of the query, after decoding and normalizing line endings
Parameters:
  namespaceURI - namespace of the query module to be loaded The StaticQueryContext representing the loaded query module
throws:
  net.sf.saxon.trans.StaticError -




mayImport
public boolean mayImport(String namespace)(Code)
Check whether this module is allowed to import a module with namespace N. Note that before calling this we have already handled the exception case where a module imports another in the same namespace (the only case where cycles are allowed)



reset
public void reset()(Code)
Reset the state of this StaticQueryContext to an uninitialized state
since:
   8.4



setBaseURI
public void setBaseURI(String baseURI)(Code)
Set the Base URI of the query
since:
   8.4



setConfiguration
public void setConfiguration(Configuration config)(Code)
Set the Configuration options
throws:
  IllegalArgumentException - if the configuration supplied is different from the existingconfiguration
since:
   8.4



setConstructionMode
public void setConstructionMode(int mode)(Code)
Set the construction mode for this module
Parameters:
  mode - one of Validation.STRIP, Validation.PRESERVE
since:
   8.4



setDefaultElementNamespace
public void setDefaultElementNamespace(String uri) throws StaticError(Code)
Set the default element namespace
since:
   8.4



setDefaultFunctionNamespace
public void setDefaultFunctionNamespace(String defaultFunctionNamespace)(Code)
Set the default function namespace
Parameters:
  defaultFunctionNamespace - The namespace to be used for unprefixed function calls
since:
   8.4



setExecutable
public void setExecutable(Executable executable)(Code)
Set the executable.

This method is intended for internal use only.
Parameters:
  executable - the Executable




setExternalNamespaceResolver
public void setExternalNamespaceResolver(NamespaceResolver resolver)(Code)
Set an external namespace resolver. If a namespace prefix cannot be resolved using any other mechanism, then as a last resort the external namespace resolver is called to obtain a URI for the given prefix.

Note that the external namespace resolver is used only for namespace prefixes that are resolved at compile time. Where namespace prefixes are resolved at run-time (which happens very rarely with XQuery: the only case is to resolve the computed name used in a computed element or attribute constructor), the external namespace resolver is not invoked.

Although the supplied object must implement the NamespaceResolver interface, the only method actually used is the method NamespaceResolver.getURIForPrefix(Stringboolean) . Other methods may throw an UnsupportedOperationException.




setFunctionLibraryList
public void setFunctionLibraryList(FunctionLibraryList functionLibrary)(Code)
Set the function library used for binding any function call appearing within the query module.

This method is available for use by advanced applications. The details of the FunctionLibrary interface are subject to change. Applications using this interface take responsibility for ensuring that the results conform to the constraints imposed by the XQuery language specification, for example that one function within a query module can call other functions defined in the same query module.
Parameters:
  functionLibrary - the FunctionLibrary to be used. This will typically be aFunctionLibraryList; in most cases it will be a slightly modified copy of a FunctionLibraryListconstructed by the system and obtained using the StaticQueryContext.getFunctionLibrary method.
See Also:   FunctionLibraryList




setInheritNamespaces
public void setInheritNamespaces(boolean inherit)(Code)
Set the namespace inheritance mode
Parameters:
  inherit - true if namespaces are inherited, false if not
since:
   8.4



setLocationURI
public void setLocationURI(String uri)(Code)
Set the location URI for a module



setModuleNamespace
public void setModuleNamespace(String uri)(Code)
Set the namespace for a library module.

This method is for internal use only.




setPreserveNamespaces
public void setPreserveNamespaces(boolean inherit)(Code)
Set the namespace copy mode
Parameters:
  inherit - true if namespaces are preserved, false if not
since:
   8.4



typeCheckGlobalVariables
public void typeCheckGlobalVariables(List compiledVars) throws StaticError(Code)



undeclareNamespace
public void undeclareNamespace()(Code)
Undeclare the most recently-declared active namespace. This method is called when a namespace declaration goes out of scope (while processing an element end tag). It is NOT called when an XML 1.1-style namespace undeclaration is encountered.

This method is intended for internal use only.
See Also:   StaticQueryContext.declareActiveNamespace(String,String)




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.