- java.lang.Object
-
- com.aoapps.servlet.jsp.tagext.JspTagUtils
-
public final class JspTagUtils extends Object
Static utilities for JSP taglibs.- Author:
- AO Industries, Inc.
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <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.Please provide tag names torequireAncestor(java.lang.String, javax.servlet.jsp.tagext.JspTag, java.lang.String, java.lang.Class).static <T> TrequireAncestor(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> TrequireAncestor(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 Detail
-
findAncestor
public static <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.- Returns:
- the parent tag when found
- See Also:
SimpleTagSupport.findAncestorWithClass(javax.servlet.jsp.tagext.JspTag, java.lang.Class)
-
requireAncestor
public static <T,Ex extends Throwable> T requireAncestor(LocalizedSupplier<Ex> exceptionSupplier, String fromName, JspTag from, String ancestorName, Class<? extends T> ancestorClass) throws Ex extends Throwable
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 foundEx extends Throwable- See Also:
SimpleTagSupport.findAncestorWithClass(javax.servlet.jsp.tagext.JspTag, java.lang.Class)
-
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:
SimpleTagSupport.findAncestorWithClass(javax.servlet.jsp.tagext.JspTag, java.lang.Class)
-
requireAncestor
@Deprecated public static <T,Ex extends Throwable> T requireAncestor(LocalizedSupplier<Ex> exceptionSupplier, JspTag from, Class<? extends T> ancestorClass) throws Ex extends Throwable
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 foundEx extends Throwable- See Also:
SimpleTagSupport.findAncestorWithClass(javax.servlet.jsp.tagext.JspTag, java.lang.Class)
-
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:
SimpleTagSupport.findAncestorWithClass(javax.servlet.jsp.tagext.JspTag, java.lang.Class)
-
-