
net.cassite.pure.ioc.handlers.EmptyHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pure.ioc Show documentation
Show all versions of pure.ioc Show documentation
Lightweight type and annotation based dependency injection framework
The newest version!
package net.cassite.pure.ioc.handlers;
import java.lang.annotation.Annotation;
import java.util.List;
import java.util.Set;
import net.cassite.pure.ioc.AnnotationHandlingException;
import net.cassite.pure.ioc.Scope;
import net.cassite.style.reflect.ConstructorSup;
import net.cassite.style.reflect.MemberSup;
/**
* Handles every kind of annotations.
* false/null/exception would be returned/thrown in order to end the HandlingChain.
*
* @author wkgcass
*/
public class EmptyHandler implements ParamAnnotationHandler, TypeAnnotationHandler, ConstructorFilter {
private static EmptyHandler inst = null;
private EmptyHandler() {
}
public static EmptyHandler getInstance() {
if (null == inst) {
synchronized (EmptyHandler.class) {
if (null == inst) {
inst = new EmptyHandler();
}
}
}
return inst;
}
@Override
public boolean canHandle(Set annotations) {
return true;
}
@Override
public Object handle(Scope scope, MemberSup> caller, Class> cls, Class> expectedClass, Annotation[] toHandle, ParamHandlerChain chain) throws AnnotationHandlingException {
throw new IrrelevantAnnotationHandlingException();
}
@Override
public boolean canHandle(Annotation[] annotations) {
return true;
}
@Override
public Object handle(Scope scope, Class> cls, Class> expectedClass, TypeHandlerChain chain) throws AnnotationHandlingException {
throw new IrrelevantAnnotationHandlingException();
}
@Override
public ConstructorSup
© 2015 - 2025 Weber Informatics LLC | Privacy Policy