All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.dynamicextensionsalfresco.webscripts.ExceptionHandlerMethod Maven / Gradle / Ivy

Go to download

Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features

There is a newer version: 3.1.0
Show newest version
package com.github.dynamicextensionsalfresco.webscripts;

import com.github.dynamicextensionsalfresco.webscripts.annotations.ExceptionHandler;

import java.lang.reflect.Method;

class ExceptionHandlerMethod {

	private final Class[] 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 type : exceptionTypes) {
				if (type.isInstance(exception)) {
					return true;
				}
			}
			return false;
		}
	}

	public Method getMethod() {
		return method;
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy