Package net.sf.saxon.expr.instruct
Class GlobalContextRequirement
java.lang.Object
net.sf.saxon.expr.instruct.GlobalContextRequirement
Information about the requirements placed by a query or stylesheet on the global
 context item: whether it is mandatory or optional, what its type must be, and
 whether it has a default value.
 In XSLT, if more than one module specifies a global context item type, they must be the same.
 In XQuery, several modules can specify different required types, and the actual context item
 must satisfy them all.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddRequiredItemType(ItemType requiredItemType) Specify the required item type of the context itemvoidExport the global context item declaration to an SEF export fileGet the expression that supplies the default value of the context item, if any.Get the required item type of the context item.Get all the required item types.booleanAsk whether the global context item for a query or stylesheet will be absent.booleanAsk whether (in XQuery) the global context item is declared as externalbooleanAsk whether it is OK for the application to supply no context itemmakeGlobalContextInfo(Configuration config) Make a ContextItemStaticInfo object describing the global context itemvoidsetAbsentFocus(boolean absent) Say whether the global context item for a query or stylesheet will be absent.voidsetDefaultValue(Expression defaultValue) Set the expression used to compute the default value of the global context itemvoidsetExternal(boolean external) Say whether (in XQuery) the global context item is declared as externalvoidsetMayBeOmitted(boolean mayOmit) Say whether it is OK for the application to supply no context item
- 
Constructor Details- 
GlobalContextRequirementpublic GlobalContextRequirement()
 
- 
- 
Method Details- 
getRequiredItemTypeGet the required item type of the context item. If several required item types have been registered (which only happens in XQuery with multiple modules) then this returns the first.- Returns:
- The first registered required item type
 
- 
getRequiredItemTypesGet all the required item types. In XSLT there can only be one, but in XQuery there can be several, one for each module (the actual context item must satisfy them all)- Returns:
- the list of required item types
 
- 
addRequiredItemTypeSpecify the required item type of the context item- Parameters:
- requiredItemType- the required item type
 
- 
getDefaultValueGet the expression that supplies the default value of the context item, if any. This is used only in XQuery.- Returns:
- the expression used to compute the value of the context item, in the absence of an externally-supplied value
 
- 
setDefaultValueSet the expression used to compute the default value of the global context item- Parameters:
- defaultValue- the expression used to compute the default value.
 
- 
exportExport the global context item declaration to an SEF export file- Parameters:
- out- the export destination
- Throws:
- XPathException- if things go wrong
 
- 
setAbsentFocuspublic void setAbsentFocus(boolean absent) Say whether the global context item for a query or stylesheet will be absent. This is relevant only for XSLT.- Parameters:
- absent- true if there will be no context item (externally or internally supplied).
 
- 
isAbsentFocuspublic boolean isAbsentFocus()Ask whether the global context item for a query or stylesheet will be absent. This is relevant only for XSLT.- Returns:
- true if there will be no context item (externally or internally supplied).
 
- 
setMayBeOmittedpublic void setMayBeOmitted(boolean mayOmit) Say whether it is OK for the application to supply no context item- Parameters:
- mayOmit- true if it is OK for the application to supply to context item
 
- 
isMayBeOmittedpublic boolean isMayBeOmitted()Ask whether it is OK for the application to supply no context item- Returns:
- true if it is OK for the application to supply to context item
 
- 
setExternalpublic void setExternal(boolean external) Say whether (in XQuery) the global context item is declared as external- Parameters:
- external- true if the global context item is declared as external
 
- 
isExternalpublic boolean isExternal()Ask whether (in XQuery) the global context item is declared as external- Returns:
- true if the global context item is declared as external
 
- 
makeGlobalContextInfoMake a ContextItemStaticInfo object describing the global context item- Parameters:
- config- the Configuration
- Returns:
- a suitable ContextItemStaticInfo
 
 
-