public abstract class InstructionWithContent
extends Instruction
| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Expression> |
attribs |
protected Expression |
content |
protected String |
name |
private int |
nameCode |
| Constructor and Description |
|---|
InstructionWithContent(String name,
Map<String,Expression> attribs,
Expression content)
Construct the content instruction.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
createsNewNodes()
Determine whether this instruction creates new nodes.
|
void |
display(int level,
PrintStream out,
Configuration config)
Diagnostic print of expression structure.
|
protected void |
dynamicError(Throwable cause,
String message,
String code,
XPathContext context)
Special version of dynamicError that includes a cause with the exception.
|
boolean |
getAttribBool(String attrName,
XPathContext context,
boolean defaultVal) |
String |
getAttribStr(String attrName,
XPathContext context) |
String |
getAttribStr(String attrName,
XPathContext context,
String defaultVal) |
int |
getCardinality() |
int |
getInstructionNameCode()
Get the name of this instruction for diagnostic and tracing purposes
|
ItemType |
getItemType(TypeHierarchy th) |
Iterator |
iterateSubExpressions()
Get all the XPath expressions associated with this instruction
(in XSLT terms, the expression present on attributes of the instruction,
as distinct from the child instructions in a sequence construction)
|
Expression |
optimize(Optimizer opt,
StaticContext env,
ItemType contextItemType) |
abstract TailCall |
processLeavingTail(XPathContext context)
This is where the main work should be performed.
|
protected void |
promoteInst(PromotionOffer offer)
Handle promotion offers, that is, non-local tree rewrites.
|
boolean |
replaceSubExpression(Expression original,
Expression replacement)
Replace one subexpression by a replacement subexpression
|
protected static String |
sequenceToString(Expression exp,
XPathContext context)
Utility function to convert an expression (which might be a sequence) to a string
value.
|
Expression |
simplify(StaticContext env)
Simplify an expression.
|
Expression |
typeCheck(StaticContext env,
ItemType contextItemType) |
appendItem, assembleParams, assembleTunnelParams, computeCardinality, computeSpecialProperties, dynamicError, evaluateAsString, evaluateItem, getImplementationMethod, getInstructionInfo, getSourceLocator, isXSLT, iterate, process, promoteadoptChildExpression, checkPermittedContents, computeDependencies, computeStaticProperties, doPromotion, dynamicError, effectiveBooleanValue, getColumnNumber, getConstructType, getContainingProcedure, getDependencies, getExecutable, getHostLanguage, getIntrinsicDependencies, getLineNumber, getLocationId, getLocationProvider, getParentExpression, getPublicId, getSlotsUsed, getSpecialProperties, getSystemId, hasBadParentPointer, markTailFunctionCalls, resetStaticProperties, setLocationId, setParentExpression, setParentExpression, suppressValidation, typeErrorprotected final String name
private int nameCode
protected Map<String,Expression> attribs
protected Expression content
public InstructionWithContent(String name,
Map<String,Expression> attribs,
Expression content)
public String getAttribStr(String attrName,
XPathContext context)
throws XPathException
XPathExceptionpublic String getAttribStr(String attrName,
XPathContext context,
String defaultVal)
throws XPathException
XPathExceptionpublic boolean getAttribBool(String attrName,
XPathContext context,
boolean defaultVal)
throws XPathException
XPathExceptionpublic Expression simplify(StaticContext env)
throws XPathException
simplify in class InstructionXPathException - if an error is discovered during expression rewritingpublic Expression typeCheck(StaticContext env,
ItemType contextItemType)
throws XPathException
typeCheck in class ExpressionXPathExceptionpublic Expression optimize(Optimizer opt,
StaticContext env,
ItemType contextItemType)
throws XPathException
optimize in class ExpressionXPathExceptionpublic int getInstructionNameCode()
getInstructionNameCode in class Instructionpublic ItemType getItemType(TypeHierarchy th)
getItemType in class Instructionpublic int getCardinality()
getCardinality in class Expressionpublic final boolean createsNewNodes()
createsNewNodes in class Instructionprotected void promoteInst(PromotionOffer offer)
throws XPathException
promoteInst in class Instructionoffer - The type of rewrite being offeredXPathExceptionpublic Iterator iterateSubExpressions()
iterateSubExpressions in class Expressionpublic boolean replaceSubExpression(Expression original,
Expression replacement)
replaceSubExpression in interface ContainerreplaceSubExpression in class Expressionoriginal - the original subexpressionreplacement - the replacement subexpressionpublic abstract TailCall processLeavingTail(XPathContext context)
throws XPathException
processLeavingTail in interface TailCallReturnerprocessLeavingTail in class InstructionXPathExceptionprotected static String sequenceToString(Expression exp,
XPathContext context)
throws XPathException
XPathExceptionpublic void display(int level,
PrintStream out,
Configuration config)
display in class Expressionlevel - indentation level for this expressionout - config - protected void dynamicError(Throwable cause,
String message,
String code,
XPathContext context)
throws DynamicError
DynamicError