Class TagAdapter

java.lang.Object
jakarta.servlet.jsp.tagext.TagAdapter
All Implemented Interfaces:
JspTag, Tag

public class TagAdapter extends Object implements Tag
Wraps any SimpleTag and exposes it using a Tag interface. This is used to allow collaboration between classic Tag handlers and SimpleTag handlers.

Because SimpleTag does not extend Tag, and because Tag.setParent() only accepts a Tag instance, a classic tag handler (one that implements Tag) cannot have a SimpleTag as its parent. To remedy this, a TagAdapter is created to wrap the SimpleTag parent, and the adapter is passed to setParent() instead. A classic Tag Handler can call getAdaptee() to retrieve the encapsulated SimpleTag instance.

Since:
JSP 2.0