/** * Get the FunctionInfo for a given function name, looking through all the * functions in this tag library. * * @param name The name (no prefix) of the function * @return the FunctionInfo for the function with the given name, or null * if no such function exists * @since JSP 2.0 */ public FunctionInfo getFunction(String name) { if (functions == null || functions.length == 0) { System.err.println("No functions"); return null; } for (int i=0; i < functions.length; i++) { if (functions[i].getName().equals(name)) { return functions[i]; } } return null; }
public void addFunction(String name, String klass, String signature) { functions.add(new FunctionInfo(name, klass, signature)); }
/** * Get the method name from the signature. */ private String getMethod(ELNode.Function func) throws JasperException { FunctionInfo funcInfo = func.getFunctionInfo(); String signature = funcInfo.getFunctionSignature(); Matcher m = METHOD_NAME_PATTERN.matcher(signature); if (!m.matches()) { err.jspError("jsp.error.tld.fn.invalid.signature", func .getPrefix(), func.getName()); } return m.group(1); }
} else { ds.append(funcMethod + "(\"" + fnQName + "\", " + getCanonicalName(funcInfo.getFunctionClass()) + ".class, " + '\"' + f.getMethodName() + "\", " + "new Class[] {");
public void addFunction(String name, String klass, String signature) { functions.add(new FunctionInfo(name, klass, signature)); }
throws JasperException { FunctionInfo funcInfo = func.getFunctionInfo(); String signature = funcInfo.getFunctionSignature(); ArrayList<String> params = new ArrayList<>();
String key = f.getPrefix()+ ":" + f.getName(); ds.append(funcMethod + "(\"" + key + "\", " + funcInfo.getFunctionClass() + ".class, " + '\"' + f.getMethodName() + "\", " + "new Class[] {");
/** * Get the FunctionInfo for a given function name, looking through all the * functions in this tag library. * * @param name The name (no prefix) of the function * @return the FunctionInfo for the function with the given name, or null * if no such function exists * @since JSP 2.0 */ public FunctionInfo getFunction(String name) { if (functions == null || functions.length == 0) { System.err.println("No functions"); return null; } for (int i=0; i < functions.length; i++) { if (functions[i].getName().equals(name)) { return functions[i]; } } return null; }
public void addFunction(String name, String klass, String signature) { functions.add(new FunctionInfo(name, klass, signature)); }
throws JasperException { FunctionInfo funcInfo = func.getFunctionInfo(); String signature = funcInfo.getFunctionSignature(); List<String> params = new ArrayList<>();
String key = f.getPrefix() + ":" + f.getName(); ds.append(funcMethod + "(\"" + key + "\", " + funcInfo.getFunctionClass() + ".class, " + '\"' + f.getMethodName() + "\", " + "new Class[] {"); String params[] = f.getParameters();
/** * Returns the named function. * * @since JSP 2.0 */ public FunctionInfo getFunction(String name) { if (this.functions == null) return null; for (int i = 0; i < this.functions.length; i++) if (this.functions[i].getName().equals(name)) return this.functions[i]; return null; }
public FunctionInfo toFunctionInfo() { return new FunctionInfo(_name, _functionClass.getName(), _signature.getSignature()); }
throws JasperException { FunctionInfo funcInfo = func.getFunctionInfo(); String signature = funcInfo.getFunctionSignature(); ArrayList<String> params = new ArrayList<String>();
String key = f.getPrefix()+ ":" + f.getName(); ds.append(funcMethod + "(\"" + key + "\", " + getCanonicalName(funcInfo.getFunctionClass()) + ".class, " + '\"' + f.getMethodName() + "\", " + "new Class[] {");
/** * Get the FunctionInfo for a given function name, looking through all the * functions in this tag library. * * @param name * The name (no prefix) of the function * @return the FunctionInfo for the function with the given name, or null if * no such function exists * @since 2.0 */ public FunctionInfo getFunction(String name) { if (functions == null || functions.length == 0) { return null; } for (int i = 0; i < functions.length; i++) { if (functions[i].getName().equals(name)) { return functions[i]; } } return null; }
private FunctionInfo createFunctionInfo(TreeNode elem) throws JasperException { String name = null; String klass = null; String signature = null; Iterator list = elem.findChildren(); while (list.hasNext()) { TreeNode element = (TreeNode) list.next(); String tname = element.getName(); if ("name".equals(tname)) { name = element.getBody(); } else if ("function-class".equals(tname)) { klass = element.getBody(); } else if ("function-signature".equals(tname)) { signature = element.getBody(); } else if ("display-name".equals(tname) || // Ignored elements "small-icon".equals(tname) || "large-icon".equals(tname) || "description".equals(tname) || "example".equals(tname)) { } else { err.jspError("jsp.error.unknown.element.in.function", tname); } } return new FunctionInfo(name, klass, signature); }
throws JasperException { FunctionInfo funcInfo = func.getFunctionInfo(); String signature = funcInfo.getFunctionSignature(); ArrayList<String> params = new ArrayList<String>();
String key = f.getPrefix()+ ":" + f.getName(); ds.append(funcMethod + "(\"" + key + "\", " + getCanonicalName(funcInfo.getFunctionClass()) + ".class, " + '\"' + f.getMethodName() + "\", " + "new Class[] {");
/** * Get the FunctionInfo for a given function name, looking through all the * functions in this tag library. * * @param name The name (no prefix) of the function * @return the FunctionInfo for the function with the given name, or null * if no such function exists * @since JSP 2.0 */ public FunctionInfo getFunction(String name) { if (functions == null || functions.length == 0) { System.err.println("No functions"); return null; } for (int i=0; i < functions.length; i++) { if (functions[i].getName().equals(name)) { return functions[i]; } } return null; }