
io.github.sporklibrary.caching.AnnotatedFieldBinder 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.FieldBinder;
import io.github.sporklibrary.interfaces.ObjectBinder;
import io.github.sporklibrary.reflection.AnnotatedField;
import java.lang.annotation.Annotation;
import java.util.Set;
/**
* A binder that caches field bindings for a specific class.
*
* @param the annotation type that is being bound
*/
class AnnotatedFieldBinder implements ObjectBinder
{
private final Set> annotatedFields;
private final FieldBinder fieldBinder;
AnnotatedFieldBinder(FieldBinder fieldBinder, Set> annotatedFields)
{
this.fieldBinder = fieldBinder;
this.annotatedFields = annotatedFields;
}
/**
* {@inheritDoc}
*/
@Override
public void bind(Object object)
{
// Bind all fields for this object
for (AnnotatedField annotated_field : annotatedFields)
{
fieldBinder.bind(object, annotated_field);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy