|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectExpression
Instruction
InstructionWithContent
public abstract class InstructionWithContent
Base class that automates much of the tedious Saxon housekeeping for an extension instruction that supports arbitrary content.
| Field Summary | |
|---|---|
protected Map<String,Expression> |
attribs
|
protected Expression |
content
|
protected String |
name
|
private int |
nameCode
|
| Fields inherited from class Expression |
|---|
EVALUATE_METHOD, ITERATE_METHOD, locationId, PROCESS_METHOD, staticProperties |
| Constructor Summary | |
|---|---|
InstructionWithContent(String name,
Map<String,Expression> attribs,
Expression content)
Construct the content instruction. |
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class Instruction |
|---|
appendItem, assembleParams, assembleTunnelParams, computeCardinality, computeSpecialProperties, dynamicError, evaluateAsString, evaluateItem, getImplementationMethod, getInstructionInfo, getSourceLocator, isXSLT, iterate, process, promote |
| Methods inherited from class Expression |
|---|
adoptChildExpression, 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, typeError |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface SourceLocator |
|---|
getColumnNumber, getLineNumber, getPublicId, getSystemId |
| Field Detail |
|---|
protected final String name
private int nameCode
protected Map<String,Expression> attribs
protected Expression content
| Constructor Detail |
|---|
public InstructionWithContent(String name,
Map<String,Expression> attribs,
Expression content)
| Method Detail |
|---|
public String getAttribStr(String attrName,
XPathContext context)
throws XPathException
XPathException
public String getAttribStr(String attrName,
XPathContext context,
String defaultVal)
throws XPathException
XPathException
public boolean getAttribBool(String attrName,
XPathContext context,
boolean defaultVal)
throws XPathException
XPathException
public Expression simplify(StaticContext env)
throws XPathException
simplify in class InstructionXPathException - if an error is discovered during expression rewriting
public Expression typeCheck(StaticContext env,
ItemType contextItemType)
throws XPathException
typeCheck in class ExpressionXPathException
public 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 Instruction
protected void promoteInst(PromotionOffer offer)
throws XPathException
promoteInst in class Instructionoffer - The type of rewrite being offered
XPathExceptionpublic Iterator iterateSubExpressions()
iterateSubExpressions in class Expression
public boolean replaceSubExpression(Expression original,
Expression replacement)
replaceSubExpression in interface ContainerreplaceSubExpression in class Expressionoriginal - the original subexpressionreplacement - the replacement subexpression
public abstract TailCall processLeavingTail(XPathContext context)
throws XPathException
processLeavingTail in interface TailCallReturnerprocessLeavingTail in class InstructionXPathException
protected static String sequenceToString(Expression exp,
XPathContext context)
throws XPathException
XPathException
public 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
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||