|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.instruct.Executable
public class Executable
A compiled stylesheet or a query in executable form. Note that the original stylesheet tree is not retained.
Constructor Summary | |
---|---|
Executable(Configuration config)
Create a new Executable (a collection of stylesheet modules and/or query modules) |
Method Summary | |
---|---|
void |
addQueryLibraryModule(QueryModule module)
Add an XQuery library module to the configuration. |
void |
addRequiredParam(StructuredQName qName)
Add a required parameter |
void |
checkAllRequiredParamsArePresent(GlobalParameterSet params)
Check that all required parameters have been supplied |
void |
explainGlobalVariables(ExpressionPresenter presenter)
Explain (that is, output an expression tree) the global variables |
void |
explainNamedTemplates(ExpressionPresenter presenter)
Explain the expression tree for named templates in a stylesheet |
void |
fixupQueryModules(QueryModule main)
Fix up global variables and functions in all query modules. |
HashMap |
getCharacterMapIndex()
Get the index of named character maps |
CollationMap |
getCollationTable()
Get the table of collations |
HashMap |
getCompiledGlobalVariables()
Get the index of global variables |
Configuration |
getConfiguration()
Get the configuration |
DecimalFormatManager |
getDecimalFormatManager()
Get the DecimalFormatManager which handles decimal-format definitions |
StringCollator |
getDefaultCollation()
Get the default collation |
String |
getDefaultCollationName()
Get the name of the default collation |
Properties |
getDefaultOutputProperties()
Get the default output properties |
FunctionLibrary |
getFunctionLibrary()
Get the library containing all the in-scope functions in the static context |
SlotManager |
getGlobalVariableMap()
Get the global variable map |
int |
getHostLanguage()
Get the host language |
KeyManager |
getKeyManager()
Get the KeyManager which handles key definitions |
int |
getLargestPatternStackFrame()
Determine the size of the stack frame needed for evaluating match patterns |
LocationMap |
getLocationMap()
Get the location map |
StringCollator |
getNamedCollation(String name)
Find a named collation. |
Template |
getNamedTemplate(StructuredQName qName)
Get the named template with a given name. |
Properties |
getOutputProperties(StructuredQName qName)
Get a named output format |
Iterator |
getQueryLibraryModules()
Get an iterator over all the query library modules (does not include the main module) |
List |
getQueryLibraryModules(String namespace)
Locate the known XQuery library modules for a given module namespace. |
QueryModule |
getQueryModuleWithSystemId(String systemId,
QueryModule topModule)
Get the query library module with a given systemID |
String |
getReasonUnableToCompile()
Determine whether this executable can be compiled; and if it can't, return the reason why |
RuleManager |
getRuleManager()
Get the RuleManager which handles template rules |
Mode |
getStripperRules()
Get the rules determining which nodes are to be stripped from the tree |
void |
initializeBindery(Bindery bindery)
Allocate space in bindery for all the variables needed |
Stripper |
newStripper()
Create a Stripper which handles whitespace stripping definitions |
void |
putNamedTemplate(StructuredQName templateName,
Template template)
Register the named template with a given name |
void |
registerGlobalVariable(GlobalVariable variable)
Register a global variable |
void |
setCharacterMapIndex(HashMap cmi)
Set the index of named character maps |
void |
setCollationTable(CollationMap table)
Set the table of collations |
void |
setConfiguration(Configuration config)
Set the configuration |
void |
setDecimalFormatManager(DecimalFormatManager dfm)
Set the DecimalFormatManager which handles decimal-format definitions |
void |
setDefaultCollationName(String name)
Set the default collation |
void |
setDefaultOutputProperties(Properties properties)
Set the default output properties (the properties for the unnamed output format) |
void |
setFunctionLibrary(FunctionLibrary functionLibrary)
Set the library containing all the in-scope functions in the static context |
void |
setHostLanguage(int language)
Set the host language |
void |
setKeyManager(KeyManager km)
Set the KeyManager which handles key definitions |
void |
setLocationMap(LocationMap map)
Set the location map |
void |
setOutputProperties(StructuredQName qName,
Properties properties)
Add a named output format |
void |
setPatternSlotSpace(int patternLocals)
Set the space requirements for variables used in template match patterns |
void |
setReasonUnableToCompile(String reason)
If this Executable can't be compiled, set a message explaining why |
void |
setRuleManager(RuleManager rm)
Set the RuleManager that handles template rules |
void |
setStripperRules(Mode rules)
Set the rules determining which nodes are to be stripped from the tree |
void |
setStripsInputTypeAnnotations(boolean strips)
Set whether source documents are to have their type annotations stripped |
void |
setStripsWhitespace(boolean strips)
Indicate that the stylesheet does some whitespace stripping |
boolean |
stripsInputTypeAnnotations()
Ask whether source documents are to have their type annotations stripped |
boolean |
stripsWhitespace()
Determine whether this stylesheet does any whitespace stripping |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Executable(Configuration config)
config
- the Saxon ConfigurationMethod Detail |
---|
public void setConfiguration(Configuration config)
config
- the Configurationpublic Configuration getConfiguration()
public void setHostLanguage(int language)
language
- the host language, as a constant such as Configuration.XSLT
or
Configuration.XQUERY
public int getHostLanguage()
Configuration.XQUERY
or Configuration.XSLT
or Configuration.JAVA_APPLICATION
public void setRuleManager(RuleManager rm)
rm
- the RuleManager containing details of all the template rulespublic RuleManager getRuleManager()
public Template getNamedTemplate(StructuredQName qName)
qName
- The template name
public void putNamedTemplate(StructuredQName templateName, Template template)
templateName
- the name of a named XSLT templatetemplate
- the templatepublic FunctionLibrary getFunctionLibrary()
public void setFunctionLibrary(FunctionLibrary functionLibrary)
functionLibrary
- the function libarypublic void setCharacterMapIndex(HashMap cmi)
cmi
- a hash table that maps the names of character maps
to the HashMap objects representing the character mapspublic HashMap getCharacterMapIndex()
public void setStripperRules(Mode rules)
rules
- a Mode object containing the whitespace stripping rules. A Mode
is generally a collection of template rules, but it is reused here to represent
a collection of stripping rules.public Mode getStripperRules()
public void setStripsWhitespace(boolean strips)
strips
- true if the stylesheet performs whitespace stripping
of one or more elements.public Stripper newStripper()
public boolean stripsWhitespace()
public void setStripsInputTypeAnnotations(boolean strips)
strips
- true if type annotations are to be strippedpublic boolean stripsInputTypeAnnotations()
public void setKeyManager(KeyManager km)
km
- the KeyManager containing the xsl:key definitionspublic KeyManager getKeyManager()
public void setDefaultOutputProperties(Properties properties)
properties
- the output properties to be used when the unnamed output format
is selectedpublic Properties getDefaultOutputProperties()
public void setOutputProperties(StructuredQName qName, Properties properties)
qName
- the structured QName of the output formatproperties
- the properties of the output formatpublic Properties getOutputProperties(StructuredQName qName)
qName
- the name of the output format
public void setDecimalFormatManager(DecimalFormatManager dfm)
dfm
- the DecimalFormatManager containing the named xsl:decimal-format definitionspublic DecimalFormatManager getDecimalFormatManager()
public void setDefaultCollationName(String name)
name
- the name of the default collationpublic String getDefaultCollationName()
public StringCollator getDefaultCollation()
public void setCollationTable(CollationMap table)
table
- a hash table that maps collation names (URIs) to objects representing the
collation informationpublic CollationMap getCollationTable()
public StringCollator getNamedCollation(String name)
name
- identifies the name of the collation required; null indicates that the default
collation is required
public void addQueryLibraryModule(QueryModule module)
module
- the library module to be added to this executablepublic List getQueryLibraryModules(String namespace)
namespace
- the module namespace URI
public QueryModule getQueryModuleWithSystemId(String systemId, QueryModule topModule)
systemId
- the SystemId of the required moduletopModule
-
public Iterator getQueryLibraryModules()
QueryModule
public void fixupQueryModules(QueryModule main) throws XPathException
main
- the main query module
XPathException
public void setPatternSlotSpace(int patternLocals)
patternLocals
- The largest number of local variables used in the match pattern of any template rulepublic SlotManager getGlobalVariableMap()
public HashMap getCompiledGlobalVariables()
StructuredQName
of the variable name, and the value is the GlobalVariable object representing the compiled
global variable. If there are no global variables, the method may return null.public void explainGlobalVariables(ExpressionPresenter presenter)
presenter
- the destination for the explanation of the global variablespublic void registerGlobalVariable(GlobalVariable variable)
variable
- the global variable to be registeredpublic void initializeBindery(Bindery bindery)
bindery
- The bindery to be initializedpublic int getLargestPatternStackFrame()
public void setLocationMap(LocationMap map)
map
- the location map, which is used to identify the module URI and line number of locations of errorspublic LocationMap getLocationMap()
public void addRequiredParam(StructuredQName qName)
qName
- the name of the required parameterpublic void checkAllRequiredParamsArePresent(GlobalParameterSet params) throws XPathException
params
- the set of parameters that have been supplied
XPathException
- if there is a required parameter for which no value has been suppliedpublic void setReasonUnableToCompile(String reason)
reason
- a message explaining why compilation is not possiblepublic String getReasonUnableToCompile()
public void explainNamedTemplates(ExpressionPresenter presenter)
presenter
- destination for the explanatory output
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |