com.github.dynamicextensionsalfresco.webscripts.ExceptionHandlerMethod Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of annotations-runtime Show documentation
Show all versions of annotations-runtime Show documentation
Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features
package com.github.dynamicextensionsalfresco.webscripts;
import com.github.dynamicextensionsalfresco.webscripts.annotations.ExceptionHandler;
import java.lang.reflect.Method;
class ExceptionHandlerMethod {
private final Class extends Throwable>[] exceptionTypes;
private final Method method;
ExceptionHandlerMethod(final ExceptionHandler exceptionHandlerAnnotation, final Method method) {
this.exceptionTypes = exceptionHandlerAnnotation.value();
this.method = method;
}
public boolean canHandle(final Throwable exception) {
if (exceptionTypes.length == 0) {
return true;
} else {
for (final Class extends Throwable> type : exceptionTypes) {
if (type.isInstance(exception)) {
return true;
}
}
return false;
}
}
public Method getMethod() {
return method;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy