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

org.jboss.weld.annotated.slim.backed.BackedAnnotated Maven / Gradle / Ivy

There is a newer version: 3.0.0.Alpha1
Show newest version
package org.jboss.weld.annotated.slim.backed;

import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Type;
import java.util.Set;

import org.jboss.weld.annotated.slim.BaseAnnotated;
import org.jboss.weld.resources.ReflectionCache;
import org.jboss.weld.resources.SharedObjectCache;
import org.jboss.weld.util.LazyValueHolder;

public abstract class BackedAnnotated extends BaseAnnotated {

    private final LazyValueHolder> typeClosure;

    public BackedAnnotated(Type baseType, SharedObjectCache sharedObjectCache) {
        super(baseType);
        this.typeClosure = initTypeClosure(baseType, sharedObjectCache);
    }

    protected LazyValueHolder> initTypeClosure(Type baseType, SharedObjectCache cache) {
        return cache.getTypeClosureHolder(baseType);
    }

    public Set getTypeClosure() {
        return typeClosure.get();
    }

    protected abstract AnnotatedElement getAnnotatedElement();

    protected abstract ReflectionCache getReflectionCache();

    @Override
    public Set getAnnotations() {
        return getReflectionCache().getAnnotationSet(getAnnotatedElement());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy