java.lang.Object
com.aoapps.servlet.jsp.tagext.JspTagUtils
Static utilities for JSP taglibs.
- Author:
- AO Industries, Inc.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Optional
<T> findAncestor
(JspTag from, Class<? extends T> ancestorClass) Finds the first parent tag of the provided class (or subclass) or implementing the provided interface.static <T,
Ex extends Throwable>
TrequireAncestor
(LocalizedSupplier<Ex> exceptionSupplier, String fromName, JspTag from, String ancestorName, Class<? extends T> ancestorClass) Finds the first parent tag of the provided class (or subclass) or implementing the provided interface.static <T,
Ex extends Throwable>
TrequireAncestor
(LocalizedSupplier<Ex> exceptionSupplier, JspTag from, Class<? extends T> ancestorClass) Deprecated.static <T> T
requireAncestor
(String fromName, JspTag from, String ancestorName, Class<? extends T> ancestorClass) Finds the first parent tag of the provided class (or subclass) or implementing the provided interface.static <T> T
requireAncestor
(JspTag from, Class<? extends T> ancestorClass) Deprecated.Please provide tag names torequireAncestor(java.lang.String, javax.servlet.jsp.tagext.JspTag, java.lang.String, java.lang.Class)
.
-
Method Details
-
findAncestor
Finds the first parent tag of the provided class (or subclass) or implementing the provided interface.- Returns:
- the parent tag when found
- See Also:
-
requireAncestor
public static <T,Ex extends Throwable> T requireAncestor(LocalizedSupplier<Ex> exceptionSupplier, String fromName, JspTag from, String ancestorName, Class<? extends T> ancestorClass) throws Ex Finds the first parent tag of the provided class (or subclass) or implementing the provided interface.- Parameters:
fromName
- The name of the tag searching from, used in generating the exception message, will typically be in the form"<prefix:name>"
or"<name>"
.ancestorName
- The name of the tag searching for, used in generating the exception message, will typically be in the form"<prefix:name>"
or"<name>"
.- Returns:
- the parent tag, never
null
- Throws:
Ex
- if parent not found- See Also:
-
requireAncestor
public static <T> T requireAncestor(String fromName, JspTag from, String ancestorName, Class<? extends T> ancestorClass) throws JspTagException Finds the first parent tag of the provided class (or subclass) or implementing the provided interface.- Parameters:
fromName
- The name of the tag searching from, used in generating the exception message, will typically be in the form"<prefix:name>"
or"<name>"
.ancestorName
- The name of the tag searching for, used in generating the exception message, will typically be in the form"<prefix:name>"
or"<name>"
.- Returns:
- the parent tag, never
null
- Throws:
JspTagException
- if parent not found- See Also:
-
requireAncestor
@Deprecated public static <T,Ex extends Throwable> T requireAncestor(LocalizedSupplier<Ex> exceptionSupplier, JspTag from, Class<? extends T> ancestorClass) throws Ex Deprecated.Please provide tag names torequireAncestor(java.lang.String, javax.servlet.jsp.tagext.JspTag, java.lang.String, java.lang.Class)
.Finds the first parent tag of the provided class (or subclass) or implementing the provided interface.- Returns:
- the parent tag, never
null
- Throws:
Ex
- if parent not found- See Also:
-
requireAncestor
@Deprecated public static <T> T requireAncestor(JspTag from, Class<? extends T> ancestorClass) throws JspTagException Deprecated.Please provide tag names torequireAncestor(java.lang.String, javax.servlet.jsp.tagext.JspTag, java.lang.String, java.lang.Class)
.Finds the first parent tag of the provided class (or subclass) or implementing the provided interface.- Returns:
- the parent tag, never
null
- Throws:
JspTagException
- if parent not found- See Also:
-
requireAncestor(java.lang.String, javax.servlet.jsp.tagext.JspTag, java.lang.String, java.lang.Class)
.