/** * Get the function declaration corresponding to a given function name and arity * @return the XQueryFunction if there is one, or null if not. */ public XQueryFunction getDeclaration(StructuredQName functionName, Expression[] staticArgs) { String functionKey = XQueryFunction.getIdentificationKey( functionName, staticArgs.length); return (XQueryFunction)functions.get(functionKey); }
/** * Get the function declaration corresponding to a given function name and arity * * @return the XQueryFunction if there is one, or null if not. */ public XQueryFunction getDeclaration(StructuredQName functionName, int staticArgs) { SymbolicName functionKey = XQueryFunction.getIdentificationKey( functionName, staticArgs); return functions.get(functionKey); }
/** * Get the function declaration corresponding to a given function name and arity * @return the XQueryFunction if there is one, or null if not. */ public XQueryFunction getDeclaration(StructuredQName functionName, Expression[] staticArgs) { String functionKey = XQueryFunction.getIdentificationKey( functionName, staticArgs.length); return (XQueryFunction)functions.get(functionKey); }
/** * Get the function declaration corresponding to a given function name and arity * * @return the XQueryFunction if there is one, or null if not. */ public XQueryFunction getDeclaration(StructuredQName functionName, int staticArgs) { SymbolicName functionKey = XQueryFunction.getIdentificationKey( functionName, staticArgs); return functions.get(functionKey); }
/** * Test whether a function with a given name and arity is available. This supports * the function-available() function in XSLT. This method may be called either at compile time * or at run time. * @param functionName the QName identifying the function * @param arity The number of arguments. This is set to -1 in the case of the single-argument * function-available() function; in this case the method should return true if there is some */ public boolean isAvailable(StructuredQName functionName, int arity) { if (arity == -1) { // we'll just test arity 0..20. Since this method is supporting an XSLT-only interrogative // on an XQuery function library, the outcome isn't too important. for (int i=0; i<20; i++) { if (isAvailable(functionName, i)) { return true; } } return false; } return (functions.get(XQueryFunction.getIdentificationKey(functionName, arity)) != null); }
/** * Test whether a function with a given name and arity is available. This supports * the function-available() function in XSLT. This method may be called either at compile time * or at run time. * @param functionName the QName identifying the function * @param arity The number of arguments. This is set to -1 in the case of the single-argument * function-available() function; in this case the method should return true if there is some */ public boolean isAvailable(StructuredQName functionName, int arity) { if (arity == -1) { // we'll just test arity 0..20. Since this method is supporting an XSLT-only interrogative // on an XQuery function library, the outcome isn't too important. for (int i=0; i<20; i++) { if (isAvailable(functionName, i)) { return true; } } return false; } return (functions.get(XQueryFunction.getIdentificationKey(functionName, arity)) != null); }
/** * Get the function with a given name and arity. This method is provided so that XQuery functions * can be called directly from a Java application. Note that there is no type checking or conversion * of arguments when this is done: the arguments must be provided in exactly the form that the function * signature declares them. * @param uri the uri of the function name * @param localName the local part of the function name * @param arity the number of arguments. * @return the function identified by the URI, local name, and arity; or null if there is no such function */ public UserFunction getUserDefinedFunction(String uri, String localName, int arity) { String functionKey = XQueryFunction.getIdentificationKey(uri, localName, arity); XQueryFunction fd = (XQueryFunction)functions.get(functionKey); if (fd==null) { return null; } return fd.getUserFunction(); }
/** * Get the function with a given name and arity. This method is provided so that XQuery functions * can be called directly from a Java application. Note that there is no type checking or conversion * of arguments when this is done: the arguments must be provided in exactly the form that the function * signature declares them. * @param uri the uri of the function name * @param localName the local part of the function name * @param arity the number of arguments. * @return the function identified by the URI, local name, and arity; or null if there is no such function */ public UserFunction getUserDefinedFunction(String uri, String localName, int arity) { String functionKey = XQueryFunction.getIdentificationKey(uri, localName, arity); XQueryFunction fd = (XQueryFunction)functions.get(functionKey); if (fd==null) { return null; } return fd.getUserFunction(); }
/** * Register a user-defined XQuery function * @param function the function to be registered * @throws XPathException if there is an existing function with the same name and arity */ public void declareFunction(XQueryFunction function) throws XPathException { String keyObj = function.getIdentificationKey(); XQueryFunction existing = (XQueryFunction)functions.get(keyObj); if (existing != null) { XPathException err = new XPathException("Duplicate definition of function " + function.getDisplayName() + " (see line " + existing.getLineNumber() + " in " + existing.getSystemId() + ')'); err.setErrorCode("XQST0034"); err.setIsStaticError(true); err.setLocator(function); throw err; } functions.put(keyObj, function); }
/** * Register a user-defined XQuery function * @param function the function to be registered * @throws XPathException if there is an existing function with the same name and arity */ public void declareFunction(XQueryFunction function) throws XPathException { String keyObj = function.getIdentificationKey(); XQueryFunction existing = (XQueryFunction)functions.get(keyObj); if (existing != null) { XPathException err = new XPathException("Duplicate definition of function " + function.getDisplayName() + " (see line " + existing.getLineNumber() + " in " + existing.getSystemId() + ')'); err.setErrorCode("XQST0034"); err.setIsStaticError(true); err.setLocator(function); throw err; } functions.put(keyObj, function); }
/** * Register a user-defined XQuery function * * @param function the function to be registered * @throws XPathException if there is an existing function with the same name and arity */ public void declareFunction(/*@NotNull*/ XQueryFunction function) throws XPathException { SymbolicName keyObj = function.getIdentificationKey(); XQueryFunction existing = functions.get(keyObj); if (existing == function) { return; } if (existing != null) { XPathException err = new XPathException("Duplicate definition of function " + function.getDisplayName() + " (see line " + existing.getLineNumber() + " in " + existing.getSystemId() + ')'); err.setErrorCode("XQST0034"); err.setIsStaticError(true); err.setLocator(function); throw err; } functions.put(keyObj, function); }
/** * Register a user-defined XQuery function * * @param function the function to be registered * @throws XPathException if there is an existing function with the same name and arity */ public void declareFunction(/*@NotNull*/ XQueryFunction function) throws XPathException { SymbolicName keyObj = function.getIdentificationKey(); XQueryFunction existing = functions.get(keyObj); if (existing == function) { return; } if (existing != null) { XPathException err = new XPathException("Duplicate definition of function " + function.getDisplayName() + " (see line " + existing.getLineNumber() + " in " + existing.getSystemId() + ')'); err.setErrorCode("XQST0034"); err.setIsStaticError(true); err.setLocator(function); throw err; } functions.put(keyObj, function); }
String functionKey = XQueryFunction.getIdentificationKey( functionName, arguments.length); XQueryFunction fd = (XQueryFunction)functions.get(functionKey);
String functionKey = XQueryFunction.getIdentificationKey( functionName, arguments.length); XQueryFunction fd = (XQueryFunction)functions.get(functionKey);