Package org.zkoss.xel.taglib
Class Taglibs
java.lang.Object
org.zkoss.xel.taglib.Taglibs
Utilities to handle taglib.
- Since:
- 3.0.0
- Author:
- tomyeh
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final URLgetDefaultURL(String uri) Returns the URL associated with the specified taglib URI, or null if not found.static final FunctionMappergetFunctionMapper(Collection<Taglib> taglibs, Map<String, Class<?>> imports, Collection<FunctionDefinition> funcs, Locator loc) Returns the function mapper representing a collection ofTaglib, imports and functions, or null if nothing is loaded.static final FunctionMappergetFunctionMapper(Collection<Taglib> taglibs, Map<String, Class<?>> imports, Locator loc) Returns the function mapper representing a collection ofTagliband imports, or null if nothing is loaded.static final FunctionMappergetFunctionMapper(Collection<Taglib> taglibs, Locator loc) Returns the function mapper representing a collection ofTaglib, or null if nothing is loaded.static final FunctionMappergetFunctionMapper(List<Taglib> taglibs, Map<String, Class<?>> imports, List<FunctionDefinition> funcs, Locator loc) Returns the function mapper representing a list ofTaglib, imports and functions, or null if nothing is loaded.static final FunctionMapperReturns the function mapper representing a list ofTagliband imports, or null if nothing is loaded.static final FunctionMappergetFunctionMapper(List<Taglib> taglibs, Locator loc) Returns the function mapper representing a list ofTaglib, or null if nothing is loaded.static final TaglibDefinitionLoads functions and imports defined in the specified URL.static final TaglibDefinitionLoads functions and imports defined in the specified DOM.loadFunctions(URL xmlURL) Loads functions defined in the specified URL.loadFunctions(Element root) Loads functions defined in the specified DOM.
-
Constructor Details
-
Taglibs
public Taglibs()
-
-
Method Details
-
getFunctionMapper
public static final FunctionMapper getFunctionMapper(List<Taglib> taglibs, Map<String, Class<?>> imports, Locator loc) Returns the function mapper representing a list ofTagliband imports, or null if nothing is loaded.The returned mapper is serializable.
- Parameters:
taglibs- a list ofTaglib.imports- a map of imported classes, Map<String nm, Class cls> Note: imports has the higher priority than import classes defined in taglibs.loc- the locator used to load taglib- Since:
- 3.0.0
-
getFunctionMapper
public static final FunctionMapper getFunctionMapper(Collection<Taglib> taglibs, Map<String, Class<?>> imports, Locator loc) Returns the function mapper representing a collection ofTagliband imports, or null if nothing is loaded.The returned mapper is serializable.
- Parameters:
taglibs- a collection ofTaglib.imports- a map of imported classes, Map<String nm, Class cls> Note: imports has the higher priority than import classes defined in taglibs.loc- the locator used to load taglib- Since:
- 5.0.0
-
getFunctionMapper
public static final FunctionMapper getFunctionMapper(List<Taglib> taglibs, Map<String, Class<?>> imports, List<FunctionDefinition> funcs, Locator loc) Returns the function mapper representing a list ofTaglib, imports and functions, or null if nothing is loaded.The returned mapper is serializable.
- Parameters:
taglibs- a list ofTaglib.imports- a map of imported classes, Map<String nm, Class cls>. Ignored if null. Note: imports has the higher priority than import classes defined in taglibs.funcs- a list of three-element arrays, Map<String prefix, String name, Function func]>. Ignored if null.loc- the locator used to load taglib- Since:
- 3.0.0
-
getFunctionMapper
public static final FunctionMapper getFunctionMapper(Collection<Taglib> taglibs, Map<String, Class<?>> imports, Collection<FunctionDefinition> funcs, Locator loc) Returns the function mapper representing a collection ofTaglib, imports and functions, or null if nothing is loaded.The returned mapper is serializable.
- Parameters:
taglibs- a collection ofTaglib.imports- a map of imported classes, Map<String nm, Class cls>. Ignored if null. Note: imports has the higher priority than import classes defined in taglibs.funcs- a collection of three-element arrays, Map<String prefix, String name, Function func]>. Ignored if null.loc- the locator used to load taglib- Since:
- 5.0.0
-
getFunctionMapper
Returns the function mapper representing a list ofTaglib, or null if nothing is loaded.The returned mapper is serializable.
- Parameters:
taglibs- a list ofTaglib.loc- the locator used to load taglib
-
getFunctionMapper
Returns the function mapper representing a collection ofTaglib, or null if nothing is loaded.The returned mapper is serializable.
- Parameters:
taglibs- a collection ofTaglib.loc- the locator used to load taglib- Since:
- 5.0.0
-
loadFunctions
Loads functions defined in the specified URL.Note: this method will cache the result, so next invocation with the same xmlURL will read directly from the cache.
- Returns:
- a map of functions: (String name, Function mtd).
- Throws:
Exception
-
loadFunctions
Loads functions defined in the specified DOM.Unlike
loadFunctions(URL), this method doesn't use cache.- Returns:
- a map of function: (String name, Function mtd).
- Throws:
Exception
-
load
Loads functions and imports defined in the specified URL.Note: this method will cache the result, so next invocation with the same xmlURL will read directly from the cache.
- Returns:
- the content of the taglib.
- Throws:
Exception- Since:
- 6.0.0
-
load
Loads functions and imports defined in the specified DOM.Unlike
loadFunctions(URL), this method doesn't use cache.- Returns:
- a two-element array [Map<String nm, Function mtd>, Map<String nm, Class cls>]. The first element is the map of the functions. The second element is the map of classes to import.
- Throws:
Exception- Since:
- 3.0.0
-
getDefaultURL
Returns the URL associated with the specified taglib URI, or null if not found.- Parameters:
uri- the URI of taglib that are defined as the taglib-uri element in the /metainfo/tld/config.xml file. Both config.xml and TLD files must be locatable by the class loader (i.e., must be part of class path).
-