io.atlassian.util.adapter.jakarta.el.JakartaMethodInfoAdapter 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.javax.el.JavaXMethodInfoAdapter;
import jakarta.el.MethodInfo;
import static io.atlassian.util.adapter.util.WrapperUtil.applyIfNonNull;
public class JakartaMethodInfoAdapter extends MethodInfo {
private final javax.el.MethodInfo delegate;
public static MethodInfo from(javax.el.MethodInfo delegate) {
if (delegate instanceof JavaXMethodInfoAdapter castDelegate) {
return castDelegate.getDelegate();
}
return applyIfNonNull(delegate, JakartaMethodInfoAdapter::new);
}
JakartaMethodInfoAdapter(javax.el.MethodInfo delegate) {
super(delegate.getName(), delegate.getReturnType(), delegate.getParamTypes());
this.delegate = delegate;
}
public javax.el.MethodInfo getDelegate() {
return delegate;
}
}