
org.johnnei.enjin.internal.AnnotationUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of enjin-api-impl Show documentation
Show all versions of enjin-api-impl Show documentation
The specification of the Enjin API
The newest version!
package org.johnnei.enjin.internal;
import org.johnnei.enjin.EnjinException;
import org.johnnei.enjin.spec.EnjinMethod;
public class AnnotationUtils {
public static EnjinMethod getMethod(Class> clazz, String method, Class>... parameters) {
try {
EnjinMethod enjinMethod = clazz.getMethod(method, parameters).getAnnotation(EnjinMethod.class);
if (enjinMethod == null) {
throw new EnjinException("Missing Method metadata");
}
return enjinMethod;
} catch (NoSuchMethodException | SecurityException e) {
throw new EnjinException(String.format(
"Failed to retrieve Method value for %s#%s(%s)",
clazz.getName(),
method,
parameters), e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy