io.atlassian.util.adapter.jakarta.el.JakartaELContextEventAdapter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jakarta-adapters Show documentation
Show all versions of jakarta-adapters Show documentation
A collection of classes for adapting Servlet API 4.0 objects to Servlet API 5.0 and vice versa.
package io.atlassian.util.adapter.jakarta.el;
import io.atlassian.util.adapter.Adapted;
import io.atlassian.util.adapter.javax.el.JavaXELContextEventAdapter;
import jakarta.el.ELContextEvent;
import static io.atlassian.util.adapter.jakarta.JakartaJspAdapters.asJakartaJsp;
import static io.atlassian.util.adapter.util.WrapperUtil.applyIfNonNull;
public class JakartaELContextEventAdapter extends ELContextEvent implements Adapted {
private final javax.el.ELContextEvent delegate;
public static ELContextEvent from(javax.el.ELContextEvent delegate) {
if (delegate instanceof JavaXELContextEventAdapter castDelegate) {
return castDelegate.getDelegate();
}
return applyIfNonNull(delegate, JakartaELContextEventAdapter::new);
}
protected JakartaELContextEventAdapter(javax.el.ELContextEvent delegate) {
super(asJakartaJsp(delegate.getELContext()));
this.delegate = delegate;
}
@Override
public javax.el.ELContextEvent getDelegate() {
return delegate;
}
}