|
|||||||||
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. |
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 Expression simplify(StaticContext env) throws XPathException
simplify
in class Instruction
XPathException
- if an error is discovered during expression rewritingpublic Expression typeCheck(StaticContext env, ItemType contextItemType) throws XPathException
typeCheck
in class Expression
XPathException
public Expression optimize(Optimizer opt, StaticContext env, ItemType contextItemType) throws XPathException
optimize
in class Expression
XPathException
public int getInstructionNameCode()
getInstructionNameCode
in class Instruction
public ItemType getItemType(TypeHierarchy th)
getItemType
in class Instruction
public int getCardinality()
getCardinality
in class Expression
public final boolean createsNewNodes()
createsNewNodes
in class Instruction
protected void promoteInst(PromotionOffer offer) throws XPathException
promoteInst
in class Instruction
offer
- The type of rewrite being offered
XPathException
public Iterator iterateSubExpressions()
iterateSubExpressions
in class Expression
public boolean replaceSubExpression(Expression original, Expression replacement)
replaceSubExpression
in interface Container
replaceSubExpression
in class Expression
original
- the original subexpressionreplacement
- the replacement subexpression
public abstract TailCall processLeavingTail(XPathContext context) throws XPathException
processLeavingTail
in interface TailCallReturner
processLeavingTail
in class Instruction
XPathException
protected static String sequenceToString(Expression exp, XPathContext context) throws XPathException
XPathException
public void display(int level, PrintStream out, Configuration config)
display
in class Expression
level
- indentation level for this expressionout
- config
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |