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

com.g2forge.alexandria.reflection.object.AJavaMemberReflection Maven / Gradle / Ivy

Go to download

Generic type safe reflection library, which adds significant usability over the standard Java runtime.

There is a newer version: 0.0.18
Show newest version
package com.g2forge.alexandria.reflection.object;

import java.lang.reflect.AnnotatedElement;

import com.g2forge.alexandria.generic.type.java.member.IJavaMemberType;
import com.g2forge.alexandria.java.reflect.annotations.ElementJavaAnnotations;
import com.g2forge.alexandria.java.reflect.annotations.IJavaAnnotations;
import com.g2forge.alexandria.reflection.object.implementations.JavaConcreteReflection;

import lombok.Data;

@Data
public abstract class AJavaMemberReflection implements IJavaMemberReflection {
	protected final MT type;

	@Override
	public IJavaAnnotations getAnnotations() {
		return new ElementJavaAnnotations((AnnotatedElement /* Cast is safe, no idea why Java standard library doesn't allow this */ ) getType().getJavaMember());
	}

	@Override
	public IJavaConcreteReflection getDeclaringClass() {
		return new JavaConcreteReflection<>(type.getDeclaringClass());
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy