APIdia Launch Partner
Top Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.compiler

pack-priv final Class WithParam

extends Instruction
Class Inheritance
Imports
com.sun.org.apache.bcel.internal.generic.ALOAD, .ASTORE, .CHECKCAST, .ConstantPoolGen, .INVOKEINTERFACE, .INVOKEVIRTUAL, .InstructionList, .LocalVariableGen, .PUSH, com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator, .ErrorMsg, .MethodGenerator, .ReferenceType, .Type, .TypeCheckError, .Util, com.sun.org.apache.xml.internal.utils.XML11Char

Authors
Jacek Ambroziak, Santiago Pericas-Geertsen, Morten Jorgensen, John Howard

Field Summary

Modifier and TypeField and Description
private LocalVariableGen
_domAdapter

Reference to JVM variable holding temporary result tree.

private boolean
_doParameterOptimization

%OPT% This is set to true when the WithParam is used in a CallTemplate for a simple named template.

protected String
_escapedName

The escaped qname of the with-param.

private QName
_name

Parameter's name.

private Expression
_select

Parameter's default value.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
display(int indent)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.display.

Displays the contents of this element

public String
getEscapedName()

Returns the escaped qname of the parameter

public QName
getName()

Return the name of this WithParam.

public void
parseContents(Parser parser)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.parseContents.

The contents of a <xsl:with-param> elements are either in the element's 'select' attribute (this has precedence) or in the element body.

public void
releaseResultTree(ClassGenerator classGen, MethodGenerator methodGen)

Release the compiled result tree.

public void
setDoParameterOptimization(boolean flag)

Set the do parameter optimization flag

public void
setName(QName name)

Set the name of the variable or paremeter.

public void
translate(ClassGenerator classGen, MethodGenerator methodGen)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Instruction.translate.

This code generates a sequence of bytecodes that call the addParameter() method in AbstractTranslet.

public void
translateValue(ClassGenerator classGen, MethodGenerator methodGen)

Compile the value of the parameter, which is either in an expression in a 'select' attribute, or in the with-param element's body

public Type
typeCheck(SymbolTable stable)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Instruction.typeCheck.

Type-check either the select attribute or the element body, depending on which is in use.

Field Detail

_domAdapterback to summary
private LocalVariableGen _domAdapter

Reference to JVM variable holding temporary result tree.

_doParameterOptimizationback to summary
private boolean _doParameterOptimization

%OPT% This is set to true when the WithParam is used in a CallTemplate for a simple named template. If this is true, the parameters are passed to the named template through method arguments rather than using the expensive Translet.addParameter() call.

_escapedNameback to summary
protected String _escapedName

The escaped qname of the with-param.

_nameback to summary
private QName _name

Parameter's name.

_selectback to summary
private Expression _select

Parameter's default value.

Constructor Detail

WithParamback to summary
pack-priv WithParam()

Method Detail

displayback to summary
public void display(int indent)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.display.

Displays the contents of this element

getEscapedNameback to summary
public String getEscapedName()

Returns the escaped qname of the parameter

getNameback to summary
public QName getName()

Return the name of this WithParam.

parseContentsback to summary
public void parseContents(Parser parser)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.SyntaxTreeNode.parseContents.

The contents of a <xsl:with-param> elements are either in the element's 'select' attribute (this has precedence) or in the element body.

releaseResultTreeback to summary
public void releaseResultTree(ClassGenerator classGen, MethodGenerator methodGen)

Release the compiled result tree.

setDoParameterOptimizationback to summary
public void setDoParameterOptimization(boolean flag)

Set the do parameter optimization flag

setNameback to summary
public void setName(QName name)

Set the name of the variable or paremeter. Escape all special chars.

translateback to summary
public void translate(ClassGenerator classGen, MethodGenerator methodGen)

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Instruction.translate.

This code generates a sequence of bytecodes that call the addParameter() method in AbstractTranslet. The method call will add (or update) the parameter frame with the new parameter value.

translateValueback to summary
public void translateValue(ClassGenerator classGen, MethodGenerator methodGen)

Compile the value of the parameter, which is either in an expression in a 'select' attribute, or in the with-param element's body

typeCheckback to summary
public Type typeCheck(SymbolTable stable) throws TypeCheckError

Overrides com.sun.org.apache.xalan.internal.xsltc.compiler.Instruction.typeCheck.

Type-check either the select attribute or the element body, depending on which is in use.