Package io.micronaut.inject.ast
Interface MemberElement
-
- All Superinterfaces:
io.micronaut.core.annotation.AnnotatedElement
,io.micronaut.core.annotation.AnnotationMetadata
,io.micronaut.core.annotation.AnnotationMetadataDelegate
,io.micronaut.core.annotation.AnnotationMetadataProvider
,io.micronaut.core.annotation.AnnotationSource
,io.micronaut.core.naming.Described
,Element
,io.micronaut.core.naming.Named
- All Known Subinterfaces:
BeanConstructorElement
,BeanFieldElement
,BeanMethodElement
,ConstructorElement
,EnumConstantElement
,FieldElement
,MethodElement
,PropertyElement
public interface MemberElement extends Element
A member element is an element that is contained within aClassElement
. ThegetDeclaringType()
method returns the class that declares the element.- Since:
- 1.0
-
-
Field Summary
-
Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
-
Fields inherited from interface io.micronaut.inject.ast.Element
EMPTY_ELEMENT_ARRAY
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description ClassElement
getDeclaringType()
default java.util.Set<ElementModifier>
getModifiers()
default ClassElement
getOwningType()
The owing type is the type that owns this element.default boolean
isAccessible()
Returns whether this member element can be invoked or retrieved at runtime.default boolean
isAccessible(ClassElement callingType)
Returns whether this member element can be invoked or retrieved at runtime.default boolean
isReflectionRequired()
Returns whether this member element will require reflection to invoke or retrieve at runtime.default boolean
isReflectionRequired(ClassElement callingType)
Returns whether this member element will require reflection to invoke or retrieve at runtime.-
Methods inherited from interface io.micronaut.core.annotation.AnnotatedElement
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
getAnnotationValuesByName, getAnnotationValuesByStereotype, getDeclaredAnnotationValuesByName, getValues, hasDeclaredStereotype, isAnnotationPresent, isDeclaredAnnotationPresent
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataDelegate
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, doubleValue, doubleValue, doubleValue, enumValue, enumValue, enumValue, enumValue, enumValues, enumValues, enumValues, enumValues, findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, findRepeatableAnnotation, findRepeatableAnnotation, getAnnotation, getAnnotation, getAnnotationNameByStereotype, getAnnotationNameByStereotype, getAnnotationNames, getAnnotationNamesByStereotype, getAnnotationNamesByStereotype, getAnnotationType, getAnnotationType, getAnnotationTypeByStereotype, getAnnotationTypeByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationTypesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValues, getValues, hasAnnotation, hasAnnotation, hasDeclaredAnnotation, hasDeclaredAnnotation, hasDeclaredStereotype, hasDeclaredStereotype, hasDeclaredStereotype, hasPropertyExpressions, hasSimpleAnnotation, hasSimpleDeclaredAnnotation, hasStereotype, hasStereotype, hasStereotype, hasStereotype, intValue, intValue, intValue, isAnnotationPresent, isDeclaredAnnotationPresent, isEmpty, isFalse, isFalse, isPresent, isPresent, isRepeatableAnnotation, isRepeatableAnnotation, isTrue, isTrue, longValue, longValue, stringValue, stringValue, stringValue, stringValue, stringValues, stringValues, stringValues, stringValues, synthesize, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
getAnnotationMetadata
-
Methods inherited from interface io.micronaut.inject.ast.Element
annotate, annotate, annotate, annotate, annotate, getDescription, getDescription, getDocumentation, getName, getNativeType, getSimpleName, isAbstract, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotype
-
-
-
-
Method Detail
-
getDeclaringType
ClassElement getDeclaringType()
- Returns:
- The declaring type of the element.
-
getOwningType
default ClassElement getOwningType()
The owing type is the type that owns this element. This can differ fromgetDeclaringType()
in the case of inheritance since this method will return the subclass that owners the inherited member, whilstgetDeclaringType()
will return the super class that declares the type.- Returns:
- The owning type.
-
getModifiers
default java.util.Set<ElementModifier> getModifiers()
- Specified by:
getModifiers
in interfaceElement
- Returns:
- The
ElementModifier
types for this class element - Since:
- 3.0.0
-
isReflectionRequired
default boolean isReflectionRequired()
Returns whether this member element will require reflection to invoke or retrieve at runtime.This method uses
getOwningType()
as the calling type for this method.- Returns:
- Will return
true
if reflection is required. - Since:
- 3.4.0
-
isReflectionRequired
default boolean isReflectionRequired(@NonNull ClassElement callingType)
Returns whether this member element will require reflection to invoke or retrieve at runtime.- Parameters:
callingType
- The calling type- Returns:
- Will return
true
if reflection is required. - Since:
- 3.4.0
-
isAccessible
default boolean isAccessible()
Returns whether this member element can be invoked or retrieved at runtime. It can be accessible by a simple invocation or a reflection invocation.This method uses
isReflectionRequired()
with a checks if the reflection access is allowed. By checking forReflectiveAccess
annotation.- Returns:
- Will return
true
if is accessible. - Since:
- 3.7.0
-
isAccessible
default boolean isAccessible(@NonNull ClassElement callingType)
Returns whether this member element can be invoked or retrieved at runtime. It can be accessible by a simple invocation or a reflection invocation.This method uses
isReflectionRequired()
with a checks if the reflection access is allowed. By checking forReflectiveAccess
annotation.- Parameters:
callingType
- The calling type- Returns:
- Will return
true
if is accessible. - Since:
- 3.7.0
-
-