Package io.micronaut.ast.groovy.visitor
Class GroovyMethodElement
java.lang.Object
io.micronaut.inject.ast.annotation.AbstractAnnotationElement
io.micronaut.ast.groovy.visitor.AbstractGroovyElement
io.micronaut.ast.groovy.visitor.GroovyMethodElement
- All Implemented Interfaces:
AnnotatedElement
,AnnotationMetadata
,AnnotationMetadataDelegate
,AnnotationMetadataProvider
,AnnotationSource
,Described
,Named
,MutableAnnotationMetadataDelegate<Element>
,Element
,MemberElement
,MethodElement
- Direct Known Subclasses:
GroovyConstructorElement
A method element returning data from a
MethodNode
.- Since:
- 1.0
- Author:
- James Kleeh
-
Field Summary
Fields inherited from class io.micronaut.ast.groovy.visitor.AbstractGroovyElement
compilationUnit, sourceUnit, visitorContext
Fields inherited from class io.micronaut.inject.ast.annotation.AbstractAnnotationElement
elementAnnotationMetadataFactory, presetAnnotationMetadata
Fields inherited from interface io.micronaut.core.annotation.AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBER
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
Fields inherited from interface io.micronaut.inject.ast.Element
EMPTY_ELEMENT_ARRAY
Fields inherited from interface io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate
EMPTY
-
Method Summary
Modifier and TypeMethodDescriptionprotected @NonNull AbstractGroovyElement
Constructs this element by invoking the constructor.protected void
copyValues
(@NonNull AbstractGroovyElement element) Copies additional values after the element was constructed byAbstractGroovyElement.copyConstructor()
.Supplies the metadata.protected MutableAnnotationMetadataDelegate<?>
Get annotation metadata to add or remove annotations.The declared type arguments for this method element.List<? extends GenericPlaceholderElement>
The generic return type of the method.Returns the method annotations.getName()
Get overridden methods by this method.The owing type is the type that owns this element.Returns the types declared in thethrows
declaration of a method.The type arguments for this method element.boolean
boolean
Is the method a default method on an interfaces.boolean
isFinal()
boolean
boolean
boolean
boolean
isPublic()
boolean
isStatic()
toString()
withAnnotationMetadata
(AnnotationMetadata annotationMetadata) Copies this element and overrides its annotations.withNewOwningType
(@NonNull ClassElement owningType) Returns a new method with a new owning type.withParameters
(ParameterElement... newParameters) Takes this method element and transforms into a new method element with the given parameters.Methods inherited from class io.micronaut.ast.groovy.visitor.AbstractGroovyElement
copy, equals, getDocumentation, getNativeType, hashCode, newClassElement, newClassElement, newClassElement, resolveClassTypeArguments, resolveMethodTypeArguments, resolveModifiers, resolveModifiers, resolveModifiers, resolveTypeArgumentsToObject
Methods inherited from class io.micronaut.inject.ast.annotation.AbstractAnnotationElement
annotate, annotate, annotate, annotate, annotate, getElementAnnotationMetadata, getElementAnnotationMetadataFactory, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotype
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.micronaut.core.annotation.AnnotatedElement
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresent
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataDelegate
booleanValue, booleanValue, booleanValue, booleanValue, classValue, classValue, classValue, classValue, classValues, classValues, classValues, classValues, copyAnnotationMetadata, 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, getAnnotationValuesByName, getAnnotationValuesByStereotype, getAnnotationValuesByType, getDeclaredAnnotation, getDeclaredAnnotation, getDeclaredAnnotationNameByStereotype, getDeclaredAnnotationNames, getDeclaredAnnotationNamesByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationTypeByStereotype, getDeclaredAnnotationValuesByName, getDeclaredAnnotationValuesByType, getDeclaredMetadata, getDeclaredStereotypeAnnotationNames, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValue, getDefaultValues, getStereotypeAnnotationNames, getTargetAnnotationMetadata, 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.inject.ast.Element
annotate, annotate, annotate, annotate, annotate, getDescription, getDocumentation, getNativeType, getSimpleName, isSynthetic, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotype
Methods inherited from interface io.micronaut.inject.ast.MemberElement
isAccessible, isAccessible, isAccessible, isReflectionRequired, isReflectionRequired
Methods inherited from interface io.micronaut.inject.ast.MethodElement
addAssociatedBean, getDescription, getReceiverType, getSuspendParameters, hasParameters, hides, hides, isSubSignature, isSuspend, isVarArgs, overrides, withNewParameters
-
Field Details
-
parameters
-
-
Method Details
-
getAnnotationMetadataToWrite
Description copied from class:AbstractAnnotationElement
Get annotation metadata to add or remove annotations.- Overrides:
getAnnotationMetadataToWrite
in classAbstractAnnotationElement
- Returns:
- The annotation metadata to write
-
getMethodAnnotationMetadata
Description copied from interface:MethodElement
Returns the method annotations. The method will only return annotations defined on a method or inherited from the super methods, whileAnnotationMetadataProvider.getAnnotationMetadata()
for a method combines the class and the method annotations. NOTE: For a constructorAnnotationMetadataProvider.getAnnotationMetadata()
will not combine the class annotations.- Specified by:
getMethodAnnotationMetadata
in interfaceMethodElement
- Returns:
- The method annotation metadata
-
getAnnotationMetadata
Description copied from interface:AnnotationMetadataProvider
Supplies the metadata. Defaults toAnnotationMetadata.EMPTY_METADATA
.- Specified by:
getAnnotationMetadata
in interfaceAnnotationMetadataProvider
- Overrides:
getAnnotationMetadata
in classAbstractAnnotationElement
- Returns:
- The
AnnotationMetadata
-
copyConstructor
Description copied from class:AbstractGroovyElement
Constructs this element by invoking the constructor.- Specified by:
copyConstructor
in classAbstractGroovyElement
- Returns:
- the copy
-
copyValues
Description copied from class:AbstractGroovyElement
Copies additional values after the element was constructed byAbstractGroovyElement.copyConstructor()
.- Overrides:
copyValues
in classAbstractGroovyElement
- Parameters:
element
- the values to be copied to
-
withAnnotationMetadata
Description copied from interface:Element
Copies this element and overrides its annotations.- Specified by:
withAnnotationMetadata
in interfaceElement
- Specified by:
withAnnotationMetadata
in interfaceMemberElement
- Specified by:
withAnnotationMetadata
in interfaceMethodElement
- Overrides:
withAnnotationMetadata
in classAbstractGroovyElement
- Parameters:
annotationMetadata
- The annotation metadata- Returns:
- A new element
-
withParameters
Description copied from interface:MethodElement
Takes this method element and transforms into a new method element with the given parameters.- Specified by:
withParameters
in interfaceMethodElement
- Parameters:
newParameters
- The new parameters- Returns:
- A new method element
-
withNewOwningType
Description copied from interface:MethodElement
Returns a new method with a new owning type.- Specified by:
withNewOwningType
in interfaceMethodElement
- Parameters:
owningType
- The owning type.- Returns:
- A new method element
-
getThrownTypes
Description copied from interface:MethodElement
Returns the types declared in thethrows
declaration of a method.- Specified by:
getThrownTypes
in interfaceMethodElement
- Returns:
- The
throws
types, if any. Nevernull
.
-
getModifiers
- Specified by:
getModifiers
in interfaceElement
- Specified by:
getModifiers
in interfaceMemberElement
- Returns:
- The
ElementModifier
types for this class element
-
toString
-
getName
-
isAbstract
public boolean isAbstract()- Specified by:
isAbstract
in interfaceElement
- Returns:
- True if the element is abstract.
-
isStatic
public boolean isStatic() -
isPublic
public boolean isPublic() -
isPrivate
public boolean isPrivate() -
isPackagePrivate
public boolean isPackagePrivate()- Specified by:
isPackagePrivate
in interfaceElement
- Overrides:
isPackagePrivate
in classAbstractGroovyElement
- Returns:
- True if the element is package private.
-
isFinal
public boolean isFinal() -
isProtected
public boolean isProtected()- Specified by:
isProtected
in interfaceElement
- Returns:
- True if the element is protected.
-
isDefault
public boolean isDefault()Description copied from interface:MethodElement
Is the method a default method on an interfaces.- Specified by:
isDefault
in interfaceMethodElement
- Returns:
- True if it is.
-
getDeclaredTypeArguments
Description copied from interface:MethodElement
The declared type arguments for this method element.- Specified by:
getDeclaredTypeArguments
in interfaceMethodElement
- Returns:
- The declared type arguments for this method element
-
getTypeArguments
Description copied from interface:MethodElement
The type arguments for this method element. The type arguments should include the type arguments added to the method plus the type arguments of the declaring class.- Specified by:
getTypeArguments
in interfaceMethodElement
- Returns:
- The type arguments for this method element
-
getGenericReturnType
Description copied from interface:MethodElement
The generic return type of the method.- Specified by:
getGenericReturnType
in interfaceMethodElement
- Returns:
- The return type of the method
-
getReturnType
- Specified by:
getReturnType
in interfaceMethodElement
- Returns:
- The return type of the method
-
getParameters
- Specified by:
getParameters
in interfaceMethodElement
- Returns:
- The method parameters
-
getDeclaringType
- Specified by:
getDeclaringType
in interfaceMemberElement
- Returns:
- The declaring type of the element.
-
getOwningType
Description copied from interface:MemberElement
The owing type is the type that owns this element. This can differ fromMemberElement.getDeclaringType()
in the case of inheritance since this method will return the subclass that owners the inherited member, whilstMemberElement.getDeclaringType()
will return the super class that declares the type.- Specified by:
getOwningType
in interfaceMemberElement
- Returns:
- The owning type.
-
getDeclaredTypeVariables
- Specified by:
getDeclaredTypeVariables
in interfaceMethodElement
- Returns:
- The type arguments declared on this method.
-
getOverriddenMethods
Description copied from interface:MethodElement
Get overridden methods by this method.- Specified by:
getOverriddenMethods
in interfaceMethodElement
- Returns:
- The overridden method by this method.
-