FuncExtFunction.java revision 286
286N/A * reserved comment block 286N/A * DO NOT REMOVE OR ALTER! 286N/A * Copyright 1999-2004 The Apache Software Foundation. 286N/A * Licensed under the Apache License, Version 2.0 (the "License"); 286N/A * you may not use this file except in compliance with the License. 286N/A * You may obtain a copy of the License at 286N/A * Unless required by applicable law or agreed to in writing, software 286N/A * distributed under the License is distributed on an "AS IS" BASIS, 286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 286N/A * See the License for the specific language governing permissions and 286N/A * limitations under the License. 286N/A * An object of this class represents an extension call expression. When 286N/A * the expression executes, it calls ExtensionsTable#extFunction, and then 286N/A * converts the result to the appropriate XObject. 286N/A * The namespace for the extension function, which should not normally 286N/A * The local name of the extension. 286N/A * Unique method key, which is passed to ExtensionsTable#extFunction in 286N/A * order to allow caching of the method. 286N/A * Array of static expressions which represent the parameters to the 286N/A * This function is used to fixup variables from QNames to stack frame 286N/A * indexes at stylesheet build time. 286N/A * @param vars List of QNames that correspond to variables. This list 286N/A * should be searched backwards for the first qualified name that 286N/A * corresponds to the variable reference qname. The position of the 286N/A * QName in the vector from the start of the vector will be its position 286N/A * in the stack frame (but variables above the globalsTop value will need 286N/A * to be offset to the current stack frame). 286N/A * NEEDSDOC @param globalsSize 286N/A * Return the namespace of the extension function. 286N/A * @return The namespace of the extension function. 286N/A * Return the name of the extension function. 286N/A * @return The name of the extension function. 286N/A * Return the method key of the extension function. 286N/A * @return The method key of the extension function. 286N/A * Return the nth argument passed to the extension function. 286N/A * @param n The argument number index. 286N/A * @return The Expression object at the given index. 286N/A * Return the number of arguments that were passed 286N/A * into this extension function. 286N/A * @return The number of arguments. 286N/A * Create a new FuncExtFunction based on the qualified name of the extension, 286N/A * and a unique method key. 286N/A * @param namespace The namespace for the extension function, which should 286N/A * not normally be null or empty. 286N/A * @param extensionName The local name of the extension. 286N/A * @param methodKey Unique method key, which is passed to 286N/A * ExtensionsTable#extFunction in order to allow caching 286N/A //try{throw new Exception("FuncExtFunction() " + namespace + " " + extensionName);} catch (Exception e){e.printStackTrace();} 286N/A * Execute the function. The function must return 286N/A * @param xctxt The current execution context. 286N/A * @return A valid XObject. 286N/A * @throws javax.xml.transform.TransformerException 286N/A * Should cache the arguments for func:function 286N/A * Set an argument expression for a function. This method is called by the 286N/A * @param arg non-null expression that represents the argument. 286N/A * @param argNum The argument number index. 286N/A * @throws WrongNumberArgsException If the argNum parameter is beyond what 286N/A * is specified for this function. 286N/A * Check that the number of arguments passed to this function is correct. 286N/A * @param argNum The number of arguments that is being passed to the function. 286N/A * @throws WrongNumberArgsException 286N/A * @see ExpressionOwner#getExpression() 286N/A * @see ExpressionOwner#setExpression(Expression) 286N/A * Call the visitors for the function arguments. 286N/A * For an extension function, we also need to set the parent 286N/A * node for all argument expressions. 286N/A * @param n The parent node 286N/A * Constructs and throws a WrongNumberArgException with the appropriate 286N/A * message for this function object. This class supports an arbitrary 286N/A * number of arguments, so this method must never be called. 286N/A * @throws WrongNumberArgsException 286N/A new Object[]{
"Programmer's assertion: the method FunctionMultiArgs.reportWrongNumberArgs() should never be called." });
286N/A * Return the name of the extesion function in string format