
io.github.sporklibrary.caching.AnnotatedMethodBinder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spork Show documentation
Show all versions of spork Show documentation
Annotation binding library
package io.github.sporklibrary.caching;
import io.github.sporklibrary.binders.MethodBinder;
import io.github.sporklibrary.interfaces.ObjectBinder;
import io.github.sporklibrary.reflection.AnnotatedMethod;
import java.lang.annotation.Annotation;
import java.util.Set;
/**
* A binder that caches method bindings for a specific class.
*
* @param the annotation type that is being bound
*/
class AnnotatedMethodBinder implements ObjectBinder
{
private final Set> annotatedMethods;
private final MethodBinder methodBinder;
AnnotatedMethodBinder(MethodBinder methodBinder, Set> annotatedMethods)
{
this.methodBinder = methodBinder;
this.annotatedMethods = annotatedMethods;
}
/**
* {@inheritDoc}
*/
@Override
public void bind(Object object)
{
// Bind all methods for this object
for (AnnotatedMethod annotated_method : annotatedMethods)
{
methodBinder.bind(object, annotated_method);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy