/** * Test whether a function with a given name and arity is available * <p>This supports the function-available() function in XSLT.</p> * * @param functionName the qualified name of the function being called * @return true if a function of this name and arity is available for calling */ public boolean isAvailable(SymbolicName.F functionName) { if (base instanceof StylesheetFunctionLibrary) { StylesheetPackage pack = ((StylesheetFunctionLibrary)base).getStylesheetPackage(); UserFunction fn = pack.getFunction(functionName); if (fn != null) { Visibility v = fn.getDeclaredVisibility(); return v == Visibility.PUBLIC || v == Visibility.FINAL; } else { return false; } } else { return base.isAvailable(functionName); } }
/** * Test whether a function with a given name and arity is available * <p>This supports the function-available() function in XSLT.</p> * * @param functionName the qualified name of the function being called * @return true if a function of this name and arity is available for calling */ public boolean isAvailable(SymbolicName.F functionName) { if (base instanceof StylesheetFunctionLibrary) { StylesheetPackage pack = ((StylesheetFunctionLibrary)base).getStylesheetPackage(); UserFunction fn = pack.getFunction(functionName); if (fn != null) { Visibility v = fn.getDeclaredVisibility(); return v == Visibility.PUBLIC || v == Visibility.FINAL; } else { return false; } } else { return base.isAvailable(functionName); } }