/** Parse the XEL method. */ private static void parseXelMethod(PageDefinition pgdef, ProcessingInstruction pi, Map<String, String> params) throws Exception { final String prefix = params.remove("prefix"); noELnorEmpty("prefix", prefix, pi); final String nm = params.remove("name"); noELnorEmpty("name", nm, pi); final String clsnm = params.remove("class"); noELnorEmpty("class", clsnm, pi); final String sig = params.remove("signature"); noELnorEmpty("signature", sig, pi); final Method mtd; try { final ClassResolver clsresolver = pgdef.getImportedClassResolver(); final Class cls = clsresolver.resolveClass(clsnm); mtd = Classes.getMethodBySignature(cls, sig, null, clsresolver); } catch (ClassNotFoundException ex) { throw new UiException(message("Class not found: " + ex.getMessage(), pi)); } catch (Exception ex) { throw new UiException(message("Method not found: " + sig + " in " + clsnm, pi)); } if ((mtd.getModifiers() & Modifier.STATIC) == 0) throw new UiException(message("Not a static method: " + mtd, pi)); pgdef.addXelMethod(prefix, nm, new MethodFunction(mtd)); }
final String clsnm = params.remove("class"); if (clsnm != null && clsnm.length() > 0) { noELnorEmpty("class", clsnm, pi); pgdef.setExpressionFactoryClass(pgdef.getImportedClassResolver().resolveClass(clsnm)); } else { //name has the lower priority
pgdef.setWidgetClass(val); } else if ("zscriptLanguage".equals(nm) || "zscript-language".equals(nm)) { //backward compatible with 2.4.x noELnorEmpty("zscriptLanguage", val, pi); pgdef.setZScriptLanguage(val); } else if ("cacheable".equals(nm)) { noELnorEmpty("cacheable", val, pi); pgdef.setCacheable(Boolean.valueOf("true".equals(val))); } else if ("automaticTimeout".equals(nm)) { noELnorEmpty("automaticTimeout", val, pi); pgdef.setAutomaticTimeout(Boolean.valueOf("true".equals(val))); } else if ("contentType".equals(nm)) {
final String cls = params.remove("class"); if (src != null) { noELnorEmpty("src", src, pi); noEL("directives", dirs, pi); imports.add(new String[] { src, dirs }); noELnorEmpty("class", cls, pi); impclses.add(cls); final String val = me.getValue(); if (val == null) { noELnorEmpty(nm, nm, pi); impclses.add(nm); } else {
throws Exception { final String name = params.remove("name"); noELnorEmpty("name", name, pi); noELnorEmpty("class", clsnm, pi);