com.g2forge.alexandria.reflection.object.AJavaMemberReflection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ax-reflection Show documentation
Show all versions of ax-reflection Show documentation
Generic type safe reflection library, which adds significant usability over the standard Java runtime.
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());
}
}