Class PythonPropertySetterMethodElement
- All Implemented Interfaces:
ElementProvider, AnnotatedElement, AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource, Described, Named, MutableAnnotationMetadataDelegate<Element>, Element, MemberElement, MethodElement
- Since:
- 5.2.0
- Author:
- Micronaut Team
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ClassElementprotected final PythonProcessingEnvironmentprotected final Stringprotected final ClassElementprotected final PythonPropertyElementFields inherited from class AbstractAnnotationElement
elementAnnotationMetadataFactory, presetAnnotationMetadataFields inherited from interface AnnotationMetadata
CLASS_NAME_SUFFIX, EMPTY_METADATA, VALUE_MEMBERFields inherited from interface AnnotationSource
EMPTYFields inherited from interface Element
EMPTY_ELEMENT_ARRAYFields inherited from interface MutableAnnotationMetadataDelegate
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionPythonPropertySetterMethodElement(PythonPropertyElement propertyElement, PythonProcessingEnvironment environment, ClassElement declaringType, ClassElement owningType, ElementAnnotationMetadataFactory metadataFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected PythonPropertySetterMethodElementcopyThis()protected voidcopyValues(io.micronaut.python.processing.element.AbstractPythonElement element) element()final booleanAccessors are the same when they accessorise the same property of the same owning type.Supplies the metadata.protected MutableAnnotationMetadataDelegate<?> Get annotation metadata to add or remove annotations.getDocumentation(boolean parseContent) protected ElementAnnotationMetadataThe generic return type of the method.Returns the method annotations.Python has no access modifiers, so the modifiers are derived from the visibility, static, abstract and final predicates of the element: an element is public unless its name marks it private, which keeps the modifier set consistent withElement.isPublic(),Element.isStatic(),Element.isAbstract()andElement.isFinal()for the callers that filter on modifiers, such asElementQuery.modifiers(...)andBeanElementBuilder.produceBeans(...).getName()Returns the native underlying type.The owning type is the type that owns this element.final inthashCode()booleanbooleanbooleanisPublic()booleanReturns whether this member element will require reflection to invoke or retrieve at runtime.booleanisReflectionRequired(ClassElement callingType) Returns whether this member element will require reflection to invoke or retrieve at runtime.booleanChecks if the current element is synthetic - not user defined but created by the compiler.protected final io.micronaut.python.processing.element.AbstractPythonElementmakeCopy()withAnnotationMetadata(AnnotationMetadata annotationMetadata) Copies this element and overrides its annotations.withParameters(ParameterElement... newParameters) Takes this method element and transforms into a new method element with the given parameters.Methods inherited from class AbstractAnnotationElement
annotate, annotate, annotate, annotate, annotate, getElementAnnotationMetadataFactory, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotypeMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface AnnotatedElement
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullableMethods inherited from interface AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasStereotypeNonRepeating, isAnnotationPresent, isDeclaredAnnotationPresentMethods inherited from interface 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, hasEvaluatedExpressions, 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 Element
annotate, annotate, annotate, annotate, annotate, getDescription, getDocumentation, getSimpleName, isAbstract, isFinal, isPackagePrivate, isStatic, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotypeMethods inherited from interface MemberElement
getModifiers, isAccessible, isAccessible, isAccessibleMethods inherited from interface MethodElement
addAssociatedBean, findParameterIndex, getDeclaredMethodAnnotationMetadata, getDeclaredTypeArguments, getDeclaredTypeVariables, getDescription, getOverriddenMethods, getParameter, getReceiverType, getSuspendParameters, getThrownTypes, getTypeArguments, hasParameters, hides, hides, isDefault, isSubSignature, isSuspend, isVarArgs, overrides, withNewOwningType, withNewParameters
-
Field Details
-
environment
-
declaringType
-
owningType
-
methodName
-
propertyElement
-
-
Constructor Details
-
PythonPropertySetterMethodElement
public PythonPropertySetterMethodElement(PythonPropertyElement propertyElement, PythonProcessingEnvironment environment, ClassElement declaringType, ClassElement owningType, ElementAnnotationMetadataFactory metadataFactory)
-
-
Method Details
-
getName
-
getElementAnnotationMetadata
- Overrides:
getElementAnnotationMetadatain classAbstractAnnotationElement- Returns:
- The element's annotation metadata
-
getReturnType
- Returns:
- The return type of the method
-
getGenericReturnType
Description copied from interface:MethodElementThe generic return type of the method.- Returns:
- The return type of the method
-
getParameters
- Returns:
- The method parameters
-
withParameters
Description copied from interface:MethodElementTakes this method element and transforms into a new method element with the given parameters.- Parameters:
newParameters- The new parameters- Returns:
- A new method element
-
copyThis
- Returns:
- copy of this element
-
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. SeeMethodElement.getDeclaredMethodAnnotationMetadata()for the annotations of this declaration only.Implementations that support adding or removing annotations at compilation time are expected to override this method and return a delegate backed by the method's own mutable annotation metadata, typically built with
MethodElementAnnotationsHelper. Overriding it is a separate obligation from implementingElement.annotate(String, java.util.function.Consumer): an element that supports the latter and not this one still cannot be annotated through this surface. The default returned here cannot separate the method annotations from the class annotations, so it approximates the read side withAnnotationMetadataProvider.getAnnotationMetadata()and rejects the write side with an exception that names this element.- 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
-
getAnnotationMetadataToWrite
Description copied from class:AbstractAnnotationElementGet annotation metadata to add or remove annotations.- Overrides:
getAnnotationMetadataToWritein classAbstractAnnotationElement- Returns:
- The annotation metadata to write
-
isReflectionRequired
public boolean isReflectionRequired()Description copied from interface:MemberElementReturns whether this member element will require reflection to invoke or retrieve at runtime.This method uses
MemberElement.getOwningType()as the calling type for this method.- Specified by:
isReflectionRequiredin interfaceMemberElement- Returns:
- Will return
trueif reflection is required.
-
isReflectionRequired
Description copied from interface:MemberElementReturns whether this member element will require reflection to invoke or retrieve at runtime.- Specified by:
isReflectionRequiredin interfaceMemberElement- Parameters:
callingType- The calling type- Returns:
- Will return
trueif reflection is required.
-
getNativeType
Description copied from interface:ElementReturns the native underlying type. This API is extended by all inject language implementations. The object returned by this method will be the language native type the information is being retrieved from.- Specified by:
getNativeTypein interfaceElement- Returns:
- The native type
-
isPublic
-
isPrivate
-
isProtected
public boolean isProtected()- Specified by:
isProtectedin interfaceElement- Returns:
- True if the element is protected.
-
isSynthetic
public boolean isSynthetic()Description copied from interface:ElementChecks if the current element is synthetic - not user defined but created by the compiler.- Specified by:
isSyntheticin interfaceElement- Returns:
- True if the element is synthetic.
-
getDeclaringType
- Specified by:
getDeclaringTypein interfaceMemberElement- Returns:
- The declaring type of the element.
-
getOwningType
Description copied from interface:MemberElementThe owning 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.
-
getDocumentation
- Specified by:
getDocumentationin interfaceElement- Parameters:
parseContent- True if the content should be parsed to extract documentation- Returns:
- The documentation, if any.
-
equals
Accessors are the same when they accessorise the same property of the same owning type. -
hashCode
public final int hashCode() -
withAnnotationMetadata
Description copied from interface:ElementCopies this element and overrides its annotations.- Specified by:
withAnnotationMetadatain interfaceElement- Specified by:
withAnnotationMetadatain interfaceMemberElement- Specified by:
withAnnotationMetadatain interfaceMethodElement- Parameters:
annotationMetadata- The annotation metadata- Returns:
- A new element
-
element
- Specified by:
elementin interfaceElementProvider- Returns:
- The native element.
-
copyValues
protected void copyValues(io.micronaut.python.processing.element.AbstractPythonElement element) - Parameters:
element- the values to be copied to
-
makeCopy
protected final io.micronaut.python.processing.element.AbstractPythonElement makeCopy() -
getModifiers
Python has no access modifiers, so the modifiers are derived from the visibility, static, abstract and final predicates of the element: an element is public unless its name marks it private, which keeps the modifier set consistent withElement.isPublic(),Element.isStatic(),Element.isAbstract()andElement.isFinal()for the callers that filter on modifiers, such asElementQuery.modifiers(...)andBeanElementBuilder.produceBeans(...).- Specified by:
getModifiersin interfaceElement- Returns:
- The modifiers
-