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

org.hibernate.search.bridge.impl.XMemberToAnnotatedElementAdaptor Maven / Gradle / Ivy

There is a newer version: 5.11.12.Final
Show newest version
/*
 * Hibernate Search, full-text search for your domain model
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later
 * See the lgpl.txt file in the root directory or .
 */

package org.hibernate.search.bridge.impl;

import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;

import org.hibernate.annotations.common.reflection.XMember;

/**
 * @author Emmanuel Bernard
 */
class XMemberToAnnotatedElementAdaptor implements AnnotatedElement {

	private final XMember delegate;

	public XMemberToAnnotatedElementAdaptor(XMember member) {
		this.delegate = member;
	}

	@Override
	public boolean isAnnotationPresent(Class annotationClass) {
		return delegate.isAnnotationPresent( annotationClass );
	}

	@Override
	public  T getAnnotation(Class annotationClass) {
		return delegate.getAnnotation( annotationClass );
	}

	@Override
	public Annotation[] getAnnotations() {
		return delegate.getAnnotations();
	}

	@Override
	public Annotation[] getDeclaredAnnotations() {
		// Not an awesome delegate but XAnnotatedElement does not deal with the notion of declared annotaions
		return delegate.getAnnotations();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy