jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/KeyCall.java
author joehw
Thu, 12 Apr 2012 08:38:26 -0700
changeset 12457 c348e06f0e82
parent 6 jaxp/src/share/classes/com/sun/org/apache/xalan/internal/xsltc/compiler/KeyCall.java@7f561c08de6b
permissions -rw-r--r--
7160496: Rename JDK8 JAXP source directory Summary: moving src/share/classes to src Reviewed-by: ohair
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * reserved comment block
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 * DO NOT REMOVE OR ALTER!
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * Copyright 2001-2006 The Apache Software Foundation.
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * Licensed under the Apache License, Version 2.0 (the "License");
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 * you may not use this file except in compliance with the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * You may obtain a copy of the License at
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 *     http://www.apache.org/licenses/LICENSE-2.0
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * Unless required by applicable law or agreed to in writing, software
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 * distributed under the License is distributed on an "AS IS" BASIS,
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * See the License for the specific language governing permissions and
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * limitations under the License.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * $Id: KeyCall.java,v 1.7 2006/06/19 19:49:04 spericas Exp $
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
package com.sun.org.apache.xalan.internal.xsltc.compiler;
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
import java.util.Vector;
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
import com.sun.org.apache.bcel.internal.generic.ALOAD;
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
import com.sun.org.apache.bcel.internal.generic.ASTORE;
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
import com.sun.org.apache.bcel.internal.generic.BranchHandle;
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
import com.sun.org.apache.bcel.internal.generic.ConstantPoolGen;
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
import com.sun.org.apache.bcel.internal.generic.GOTO;
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
import com.sun.org.apache.bcel.internal.generic.IFGT;
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
import com.sun.org.apache.bcel.internal.generic.INVOKEINTERFACE;
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
import com.sun.org.apache.bcel.internal.generic.INVOKESPECIAL;
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
import com.sun.org.apache.bcel.internal.generic.INVOKEVIRTUAL;
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
import com.sun.org.apache.bcel.internal.generic.InstructionHandle;
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
import com.sun.org.apache.bcel.internal.generic.InstructionList;
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
import com.sun.org.apache.bcel.internal.generic.LocalVariableGen;
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
import com.sun.org.apache.bcel.internal.generic.NEW;
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
import com.sun.org.apache.bcel.internal.generic.PUSH;
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.ClassGenerator;
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.MethodGenerator;
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.StringType;
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Type;
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TypeCheckError;
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
import com.sun.org.apache.xalan.internal.xsltc.compiler.util.Util;
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
 * @author Morten Jorgensen
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
 * @author Santiago Pericas-Geertsen
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
final class KeyCall extends FunctionCall {
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
     * The name of the key.
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
    private Expression _name;
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
     * The value to look up in the key/index.
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
    private Expression _value;
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
     * The value's data type.
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
    private Type _valueType; // The value's data type
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
     * Expanded qname when name is literal.
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
    private QName _resolvedQName = null;
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
     * Get the parameters passed to function:
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
     *   key(String name, String value)
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
     *   key(String name, NodeSet value)
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
     * The 'arguments' vector should contain two parameters for key() calls,
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
     * one holding the key name and one holding the value(s) to look up. The
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
     * vector has only one parameter for id() calls (the key name is always
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
     * "##id" for id() calls).
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
     * @param fname The function name (should be 'key' or 'id')
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
     * @param arguments A vector containing the arguments the the function
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
    public KeyCall(QName fname, Vector arguments) {
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
        super(fname, arguments);
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
        switch(argumentCount()) {
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
        case 1:
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
            _name = null;
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
            _value = argument(0);
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
            break;
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
        case 2:
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
            _name = argument(0);
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
            _value = argument(1);
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
            break;
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
        default:
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
            _name = _value = null;
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
            break;
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   103
7f561c08de6b Initial load
duke
parents:
diff changeset
   104
     /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   105
     * If this call to key() is in a top-level element like  another variable
7f561c08de6b Initial load
duke
parents:
diff changeset
   106
     * or param, add a dependency between that top-level element and the
7f561c08de6b Initial load
duke
parents:
diff changeset
   107
     * referenced key. For example,
7f561c08de6b Initial load
duke
parents:
diff changeset
   108
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   109
     *   <xsl:key name="x" .../>
7f561c08de6b Initial load
duke
parents:
diff changeset
   110
     *   <xsl:variable name="y" select="key('x', 1)"/>
7f561c08de6b Initial load
duke
parents:
diff changeset
   111
     *
7f561c08de6b Initial load
duke
parents:
diff changeset
   112
     * and assuming this class represents "key('x', 1)", add a reference
7f561c08de6b Initial load
duke
parents:
diff changeset
   113
     * between variable y and key x. Note that if 'x' is unknown statically
7f561c08de6b Initial load
duke
parents:
diff changeset
   114
     * in key('x', 1), there's nothing we can do at this point.
7f561c08de6b Initial load
duke
parents:
diff changeset
   115
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   116
    public void addParentDependency() {
7f561c08de6b Initial load
duke
parents:
diff changeset
   117
        // If name unknown statically, there's nothing we can do
7f561c08de6b Initial load
duke
parents:
diff changeset
   118
        if (_resolvedQName == null) return;
7f561c08de6b Initial load
duke
parents:
diff changeset
   119
7f561c08de6b Initial load
duke
parents:
diff changeset
   120
        SyntaxTreeNode node = this;
7f561c08de6b Initial load
duke
parents:
diff changeset
   121
        while (node != null && node instanceof TopLevelElement == false) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   122
            node = node.getParent();
7f561c08de6b Initial load
duke
parents:
diff changeset
   123
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   124
7f561c08de6b Initial load
duke
parents:
diff changeset
   125
        TopLevelElement parent = (TopLevelElement) node;
7f561c08de6b Initial load
duke
parents:
diff changeset
   126
        if (parent != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   127
            parent.addDependency(getSymbolTable().getKey(_resolvedQName));
7f561c08de6b Initial load
duke
parents:
diff changeset
   128
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   129
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   130
7f561c08de6b Initial load
duke
parents:
diff changeset
   131
   /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   132
     * Type check the parameters for the id() or key() function.
7f561c08de6b Initial load
duke
parents:
diff changeset
   133
     * The index name (for key() call only) must be a string or convertable
7f561c08de6b Initial load
duke
parents:
diff changeset
   134
     * to a string, and the lookup-value must be a string or a node-set.
7f561c08de6b Initial load
duke
parents:
diff changeset
   135
     * @param stable The parser's symbol table
7f561c08de6b Initial load
duke
parents:
diff changeset
   136
     * @throws TypeCheckError When the parameters have illegal type
7f561c08de6b Initial load
duke
parents:
diff changeset
   137
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   138
    public Type typeCheck(SymbolTable stable) throws TypeCheckError {
7f561c08de6b Initial load
duke
parents:
diff changeset
   139
        final Type returnType = super.typeCheck(stable);
7f561c08de6b Initial load
duke
parents:
diff changeset
   140
7f561c08de6b Initial load
duke
parents:
diff changeset
   141
        // Run type check on the key name (first argument) - must be a string,
7f561c08de6b Initial load
duke
parents:
diff changeset
   142
        // and if it is not it must be converted to one using string() rules.
7f561c08de6b Initial load
duke
parents:
diff changeset
   143
        if (_name != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   144
            final Type nameType = _name.typeCheck(stable);
7f561c08de6b Initial load
duke
parents:
diff changeset
   145
7f561c08de6b Initial load
duke
parents:
diff changeset
   146
            if (_name instanceof LiteralExpr) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   147
                final LiteralExpr literal = (LiteralExpr) _name;
7f561c08de6b Initial load
duke
parents:
diff changeset
   148
                _resolvedQName =
7f561c08de6b Initial load
duke
parents:
diff changeset
   149
                    getParser().getQNameIgnoreDefaultNs(literal.getValue());
7f561c08de6b Initial load
duke
parents:
diff changeset
   150
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
   151
            else if (nameType instanceof StringType == false) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   152
                _name = new CastExpr(_name, Type.String);
7f561c08de6b Initial load
duke
parents:
diff changeset
   153
            }
7f561c08de6b Initial load
duke
parents:
diff changeset
   154
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   155
7f561c08de6b Initial load
duke
parents:
diff changeset
   156
        // Run type check on the value for this key. This value can be of
7f561c08de6b Initial load
duke
parents:
diff changeset
   157
        // any data type, so this should never cause any type-check errors.
7f561c08de6b Initial load
duke
parents:
diff changeset
   158
        // If the value is a reference, then we have to defer the decision
7f561c08de6b Initial load
duke
parents:
diff changeset
   159
        // of how to process it until run-time.
7f561c08de6b Initial load
duke
parents:
diff changeset
   160
        // If the value is known not to be a node-set, then it should be
7f561c08de6b Initial load
duke
parents:
diff changeset
   161
        // converted to a string before the lookup is done. If the value is
7f561c08de6b Initial load
duke
parents:
diff changeset
   162
        // known to be a node-set then this process (convert to string, then
7f561c08de6b Initial load
duke
parents:
diff changeset
   163
        // do lookup) should be applied to every node in the set, and the
7f561c08de6b Initial load
duke
parents:
diff changeset
   164
        // result from all lookups should be added to the resulting node-set.
7f561c08de6b Initial load
duke
parents:
diff changeset
   165
        _valueType = _value.typeCheck(stable);
7f561c08de6b Initial load
duke
parents:
diff changeset
   166
7f561c08de6b Initial load
duke
parents:
diff changeset
   167
        if (_valueType != Type.NodeSet
7f561c08de6b Initial load
duke
parents:
diff changeset
   168
                && _valueType != Type.Reference
7f561c08de6b Initial load
duke
parents:
diff changeset
   169
                && _valueType != Type.String) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   170
            _value = new CastExpr(_value, Type.String);
7f561c08de6b Initial load
duke
parents:
diff changeset
   171
            _valueType = _value.typeCheck(stable);
7f561c08de6b Initial load
duke
parents:
diff changeset
   172
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   173
7f561c08de6b Initial load
duke
parents:
diff changeset
   174
        // If in a top-level element, create dependency to the referenced key
7f561c08de6b Initial load
duke
parents:
diff changeset
   175
        addParentDependency();
7f561c08de6b Initial load
duke
parents:
diff changeset
   176
7f561c08de6b Initial load
duke
parents:
diff changeset
   177
        return returnType;
7f561c08de6b Initial load
duke
parents:
diff changeset
   178
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   179
7f561c08de6b Initial load
duke
parents:
diff changeset
   180
    /**
7f561c08de6b Initial load
duke
parents:
diff changeset
   181
     * This method is called when the constructor is compiled in
7f561c08de6b Initial load
duke
parents:
diff changeset
   182
     * Stylesheet.compileConstructor() and not as the syntax tree is traversed.
7f561c08de6b Initial load
duke
parents:
diff changeset
   183
     * <p>This method will generate byte code that produces an iterator
7f561c08de6b Initial load
duke
parents:
diff changeset
   184
     * for the nodes in the node set for the key or id function call.
7f561c08de6b Initial load
duke
parents:
diff changeset
   185
     * @param classGen The Java class generator
7f561c08de6b Initial load
duke
parents:
diff changeset
   186
     * @param methodGen The method generator
7f561c08de6b Initial load
duke
parents:
diff changeset
   187
     */
7f561c08de6b Initial load
duke
parents:
diff changeset
   188
    public void translate(ClassGenerator classGen,
7f561c08de6b Initial load
duke
parents:
diff changeset
   189
                          MethodGenerator methodGen) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   190
        final ConstantPoolGen cpg = classGen.getConstantPool();
7f561c08de6b Initial load
duke
parents:
diff changeset
   191
        final InstructionList il = methodGen.getInstructionList();
7f561c08de6b Initial load
duke
parents:
diff changeset
   192
7f561c08de6b Initial load
duke
parents:
diff changeset
   193
        // Returns the KeyIndex object of a given name
7f561c08de6b Initial load
duke
parents:
diff changeset
   194
        final int getKeyIndex = cpg.addMethodref(TRANSLET_CLASS,
7f561c08de6b Initial load
duke
parents:
diff changeset
   195
                                                 "getKeyIndex",
7f561c08de6b Initial load
duke
parents:
diff changeset
   196
                                                 "(Ljava/lang/String;)"+
7f561c08de6b Initial load
duke
parents:
diff changeset
   197
                                                 KEY_INDEX_SIG);
7f561c08de6b Initial load
duke
parents:
diff changeset
   198
7f561c08de6b Initial load
duke
parents:
diff changeset
   199
        // KeyIndex.setDom(Dom, node) => void
7f561c08de6b Initial load
duke
parents:
diff changeset
   200
        final int keyDom = cpg.addMethodref(KEY_INDEX_CLASS,
7f561c08de6b Initial load
duke
parents:
diff changeset
   201
                                            "setDom",
7f561c08de6b Initial load
duke
parents:
diff changeset
   202
                                            "(" + DOM_INTF_SIG + "I)V");
7f561c08de6b Initial load
duke
parents:
diff changeset
   203
7f561c08de6b Initial load
duke
parents:
diff changeset
   204
        // Initialises a KeyIndex to return nodes with specific values
7f561c08de6b Initial load
duke
parents:
diff changeset
   205
        final int getKeyIterator =
7f561c08de6b Initial load
duke
parents:
diff changeset
   206
                        cpg.addMethodref(KEY_INDEX_CLASS,
7f561c08de6b Initial load
duke
parents:
diff changeset
   207
                                         "getKeyIndexIterator",
7f561c08de6b Initial load
duke
parents:
diff changeset
   208
                                         "(" + _valueType.toSignature() + "Z)"
7f561c08de6b Initial load
duke
parents:
diff changeset
   209
                                             + KEY_INDEX_ITERATOR_SIG);
7f561c08de6b Initial load
duke
parents:
diff changeset
   210
7f561c08de6b Initial load
duke
parents:
diff changeset
   211
        // Initialise the index specified in the first parameter of key()
7f561c08de6b Initial load
duke
parents:
diff changeset
   212
        il.append(classGen.loadTranslet());
7f561c08de6b Initial load
duke
parents:
diff changeset
   213
        if (_name == null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   214
            il.append(new PUSH(cpg,"##id"));
7f561c08de6b Initial load
duke
parents:
diff changeset
   215
        } else if (_resolvedQName != null) {
7f561c08de6b Initial load
duke
parents:
diff changeset
   216
            il.append(new PUSH(cpg, _resolvedQName.toString()));
7f561c08de6b Initial load
duke
parents:
diff changeset
   217
        } else {
7f561c08de6b Initial load
duke
parents:
diff changeset
   218
            _name.translate(classGen, methodGen);
7f561c08de6b Initial load
duke
parents:
diff changeset
   219
        }
7f561c08de6b Initial load
duke
parents:
diff changeset
   220
7f561c08de6b Initial load
duke
parents:
diff changeset
   221
        // Generate following byte code:
7f561c08de6b Initial load
duke
parents:
diff changeset
   222
        //
7f561c08de6b Initial load
duke
parents:
diff changeset
   223
        //   KeyIndex ki = translet.getKeyIndex(_name)
7f561c08de6b Initial load
duke
parents:
diff changeset
   224
        //   ki.setDom(translet.dom);
7f561c08de6b Initial load
duke
parents:
diff changeset
   225
        //   ki.getKeyIndexIterator(_value, true)  - for key()
7f561c08de6b Initial load
duke
parents:
diff changeset
   226
        //        OR
7f561c08de6b Initial load
duke
parents:
diff changeset
   227
        //   ki.getKeyIndexIterator(_value, false)  - for id()
7f561c08de6b Initial load
duke
parents:
diff changeset
   228
        il.append(new INVOKEVIRTUAL(getKeyIndex));
7f561c08de6b Initial load
duke
parents:
diff changeset
   229
        il.append(DUP);
7f561c08de6b Initial load
duke
parents:
diff changeset
   230
        il.append(methodGen.loadDOM());
7f561c08de6b Initial load
duke
parents:
diff changeset
   231
        il.append(methodGen.loadCurrentNode());
7f561c08de6b Initial load
duke
parents:
diff changeset
   232
        il.append(new INVOKEVIRTUAL(keyDom));
7f561c08de6b Initial load
duke
parents:
diff changeset
   233
7f561c08de6b Initial load
duke
parents:
diff changeset
   234
        _value.translate(classGen, methodGen);
7f561c08de6b Initial load
duke
parents:
diff changeset
   235
        il.append((_name != null) ? ICONST_1: ICONST_0);
7f561c08de6b Initial load
duke
parents:
diff changeset
   236
        il.append(new INVOKEVIRTUAL(getKeyIterator));
7f561c08de6b Initial load
duke
parents:
diff changeset
   237
    }
7f561c08de6b Initial load
duke
parents:
diff changeset
   238
}