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

pack-priv final Class KeyCall

extends FunctionCall
Class Inheritance
Imports
com.sun.org.apache.bcel.internal.generic.ConstantPoolGen, .INVOKEVIRTUAL, .InstructionList, .PUSH, com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator, .MethodGenerator, .StringType, .Type, .TypeCheckError, java.util.List

Authors
Morten Jorgensen, Santiago Pericas-Geertsen

Field Summary

Modifier and TypeField and Description
private Expression
_name

The name of the key.

private QName
_resolvedQName

Expanded qname when name is literal.

private Expression
_value

The value to look up in the key/index.

private Type
_valueType

The value's data type.

Inherited from com.sun.org.apache.xalan.internal.xsltc.compiler.FunctionCall:
_thisArgumentEXSLT_COMMONEXSLT_DATETIMEEXSLT_MATHEXSLT_SETSEXSLT_STRINGSEXT_XALANEXT_XSLTCJAVA_EXT_XALANJAVA_EXT_XALAN_OLDJAVA_EXT_XSLTCNAMESPACE_FORMAT_CLASSNAMESPACE_FORMAT_CLASS_OR_PACKAGENAMESPACE_FORMAT_JAVANAMESPACE_FORMAT_PACKAGEXALAN_CLASSPACKAGE_NAMESPACE

Constructor Summary

AccessConstructor and Description
public
KeyCall(QName
The function name (should be 'key' or 'id')
fname
,
List<Expression>
A vector containing the arguments the the function
arguments
)

Get the parameters passed to function: key(String name, String value) key(String name, NodeSet value) The 'arguments' vector should contain two parameters for key() calls, one holding the key name and one holding the value(s) to look up.

Method Summary

Modifier and TypeMethod and Description
public void
addParentDependency()

If this call to key() is in a top-level element like another variable or param, add a dependency between that top-level element and the referenced key.

public void
translate(ClassGenerator
The Java class generator
classGen
,
MethodGenerator
The method generator
methodGen
)

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

This method is called when the constructor is compiled in Stylesheet.compileConstructor() and not as the syntax tree is traversed.

public Type
typeCheck(SymbolTable
The parser's symbol table
stable
)

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

Type check the parameters for the id() or key() function.

Inherited from com.sun.org.apache.xalan.internal.xsltc.compiler.FunctionCall:
argumentargumentargumentCountgetClassNameFromUrigetNamegetSignaturegetSignaturegetSignatureisExtensionisStandardreplaceDashsetArgumentsetParsertoStringtranslateDesynthesizedtypeCheckArgstypeCheckConstructortypeCheckExternaltypeCheckStandard

Field Detail

_nameback to summary
private Expression _name

The name of the key.

_resolvedQNameback to summary
private QName _resolvedQName

Expanded qname when name is literal.

_valueback to summary
private Expression _value

The value to look up in the key/index.

_valueTypeback to summary
private Type _valueType

The value's data type.

Constructor Detail

KeyCallback to summary
public KeyCall(QName fname, List<Expression> arguments)

Get the parameters passed to function: key(String name, String value) key(String name, NodeSet value) The 'arguments' vector should contain two parameters for key() calls, one holding the key name and one holding the value(s) to look up. The vector has only one parameter for id() calls (the key name is always "##id" for id() calls).

Parameters
fname:QName

The function name (should be 'key' or 'id')

arguments:List<Expression>

A vector containing the arguments the the function

Method Detail

addParentDependencyback to summary
public void addParentDependency()

If this call to key() is in a top-level element like another variable or param, add a dependency between that top-level element and the referenced key. For example, <xsl:key name="x" .../> <xsl:variable name="y" select="key('x', 1)"/> and assuming this class represents "key('x', 1)", add a reference between variable y and key x. Note that if 'x' is unknown statically in key('x', 1), there's nothing we can do at this point.

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

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

This method is called when the constructor is compiled in Stylesheet.compileConstructor() and not as the syntax tree is traversed.

This method will generate byte code that produces an iterator for the nodes in the node set for the key or id function call.

Parameters
classGen:ClassGenerator

The Java class generator

methodGen:MethodGenerator

The method generator

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

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

Type check the parameters for the id() or key() function. The index name (for key() call only) must be a string or convertable to a string, and the lookup-value must be a string or a node-set.

Parameters
stable:SymbolTable

The parser's symbol table

Exceptions
TypeCheckError:
When the parameters have illegal type