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
FieldsFields inherited from class io.micronaut.ast.groovy.visitor.AbstractGroovyElement
compilationUnit, sourceUnit, visitorContextFields inherited from class io.micronaut.inject.ast.annotation.AbstractAnnotationElement
elementAnnotationMetadataFactory, presetAnnotationMetadataFields inherited from interface io.micronaut.core.annotation.AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBERFields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTYFields inherited from interface io.micronaut.inject.ast.Element
EMPTY_ELEMENT_ARRAYFields inherited from interface io.micronaut.inject.ast.annotation.MutableAnnotationMetadataDelegate
EMPTY -
Method Summary
Modifier and TypeMethodDescriptionprotected @NonNull AbstractGroovyElementConstructs this element by invoking the constructor.protected voidcopyValues(@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 thethrowsdeclaration of a method.The type arguments for this method element.booleanbooleanIs the method a default method on an interfaces.booleanisFinal()booleanbooleanbooleanbooleanisPublic()booleanisStatic()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, resolveTypeArgumentsToObjectMethods inherited from class io.micronaut.inject.ast.annotation.AbstractAnnotationElement
annotate, annotate, annotate, annotate, annotate, getElementAnnotationMetadata, getElementAnnotationMetadataFactory, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotypeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface io.micronaut.core.annotation.AnnotatedElement
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullableMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresentMethods 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, synthesizeDeclaredAnnotationsByTypeMethods inherited from interface io.micronaut.inject.ast.Element
annotate, annotate, annotate, annotate, annotate, getDescription, getDocumentation, getNativeType, getSimpleName, isSynthetic, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotypeMethods inherited from interface io.micronaut.inject.ast.MemberElement
isAccessible, isAccessible, isAccessible, isReflectionRequired, isReflectionRequiredMethods 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:AbstractAnnotationElementGet annotation metadata to add or remove annotations.- Overrides:
getAnnotationMetadataToWritein classAbstractAnnotationElement- Returns:
- The annotation metadata to write
-
getMethodAnnotationMetadata
Description copied from interface:MethodElementReturns 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:
getMethodAnnotationMetadatain interfaceMethodElement- Returns:
- The method annotation metadata
-
getAnnotationMetadata
Description copied from interface:AnnotationMetadataProviderSupplies the metadata. Defaults toAnnotationMetadata.EMPTY_METADATA.- Specified by:
getAnnotationMetadatain interfaceAnnotationMetadataProvider- Overrides:
getAnnotationMetadatain classAbstractAnnotationElement- Returns:
- The
AnnotationMetadata
-
copyConstructor
Description copied from class:AbstractGroovyElementConstructs this element by invoking the constructor.- Specified by:
copyConstructorin classAbstractGroovyElement- Returns:
- the copy
-
copyValues
Description copied from class:AbstractGroovyElementCopies additional values after the element was constructed byAbstractGroovyElement.copyConstructor().- Overrides:
copyValuesin classAbstractGroovyElement- Parameters:
element- the values to be copied to
-
withAnnotationMetadata
Description copied from interface:ElementCopies this element and overrides its annotations.- Specified by:
withAnnotationMetadatain interfaceElement- Specified by:
withAnnotationMetadatain interfaceMemberElement- Specified by:
withAnnotationMetadatain interfaceMethodElement- Overrides:
withAnnotationMetadatain classAbstractGroovyElement- Parameters:
annotationMetadata- The annotation metadata- Returns:
- A new element
-
withParameters
Description copied from interface:MethodElementTakes this method element and transforms into a new method element with the given parameters.- Specified by:
withParametersin interfaceMethodElement- Parameters:
newParameters- The new parameters- Returns:
- A new method element
-
withNewOwningType
Description copied from interface:MethodElementReturns a new method with a new owning type.- Specified by:
withNewOwningTypein interfaceMethodElement- Parameters:
owningType- The owning type.- Returns:
- A new method element
-
getThrownTypes
Description copied from interface:MethodElementReturns the types declared in thethrowsdeclaration of a method.- Specified by:
getThrownTypesin interfaceMethodElement- Returns:
- The
throwstypes, if any. Nevernull.
-
getModifiers
- Specified by:
getModifiersin interfaceElement- Specified by:
getModifiersin interfaceMemberElement- Returns:
- The
ElementModifiertypes for this class element
-
toString
-
getName
-
isAbstract
public boolean isAbstract()- Specified by:
isAbstractin 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:
isPackagePrivatein interfaceElement- Overrides:
isPackagePrivatein classAbstractGroovyElement- Returns:
- True if the element is package private.
-
isFinal
public boolean isFinal() -
isProtected
public boolean isProtected()- Specified by:
isProtectedin interfaceElement- Returns:
- True if the element is protected.
-
isDefault
public boolean isDefault()Description copied from interface:MethodElementIs the method a default method on an interfaces.- Specified by:
isDefaultin interfaceMethodElement- Returns:
- True if it is.
-
getDeclaredTypeArguments
Description copied from interface:MethodElementThe declared type arguments for this method element.- Specified by:
getDeclaredTypeArgumentsin interfaceMethodElement- Returns:
- The declared type arguments for this method element
-
getTypeArguments
Description copied from interface:MethodElementThe 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:
getTypeArgumentsin interfaceMethodElement- Returns:
- The type arguments for this method element
-
getGenericReturnType
Description copied from interface:MethodElementThe generic return type of the method.- Specified by:
getGenericReturnTypein interfaceMethodElement- Returns:
- The return type of the method
-
getReturnType
- Specified by:
getReturnTypein interfaceMethodElement- Returns:
- The return type of the method
-
getParameters
- Specified by:
getParametersin interfaceMethodElement- Returns:
- The method parameters
-
getDeclaringType
- Specified by:
getDeclaringTypein interfaceMemberElement- Returns:
- The declaring type of the element.
-
getOwningType
Description copied from interface:MemberElementThe 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:
getOwningTypein interfaceMemberElement- Returns:
- The owning type.
-
getDeclaredTypeVariables
- Specified by:
getDeclaredTypeVariablesin interfaceMethodElement- Returns:
- The type arguments declared on this method.
-
getOverriddenMethods
Description copied from interface:MethodElementGet overridden methods by this method.- Specified by:
getOverriddenMethodsin interfaceMethodElement- Returns:
- The overridden method by this method.
-