/** Adds a tag lib. */ public void addTaglib(Taglib taglib) { checkXelModifiable(); if (taglib == null) throw new IllegalArgumentException("null"); if (_taglibs == null) _taglibs = new LinkedList<Taglib>(); _taglibs.add(taglib); }
/** * Adds an imported class to the expression factory. * * @since 3.0.0 */ public void addExpressionImport(String nm, Class<?> cls) { checkXelModifiable(); if (nm == null || cls == null) throw new IllegalArgumentException(); if (_expimps == null) _expimps = new HashMap<String, Class<?>>(4); _expimps.put(nm, cls); }
/** * Sets the implementation of the expression factory that shall be used by this page. * * <p>Default: null (use the default). * * @param expfcls the implementation class, or null to use the default. Note: expfcls must * implement {@link ExpressionFactory}. If null is specified, the class defined in {@link * org.zkoss.zk.ui.util.Configuration#getExpressionFactoryClass} * @exception IllegalArgumentException if expfcls does not implement ExpressionFactory * @since 3.0.0 */ @SuppressWarnings("unchecked") public void setExpressionFactoryClass(Class<?> expfcls) { checkXelModifiable(); if (expfcls != null && !ExpressionFactory.class.isAssignableFrom(expfcls)) throw new IllegalArgumentException( ExpressionFactory.class + " must be implemented: " + expfcls); _expfcls = (Class) expfcls; }
/** * Adds a XEL method. * * @param prefix the prefix of the method name * @param name the method name. The final name is "prefix:name" * @param func the function. * @since 3.0.0 */ public void addXelMethod(String prefix, String name, Function func) { checkXelModifiable(); if (name == null || prefix == null || func == null) throw new IllegalArgumentException(); if (_xelfuncs == null) _xelfuncs = new LinkedList<FunctionDefinition>(); _xelfuncs.add(new FunctionDefinition(prefix, name, func)); }