Class PythonConstructorElement
java.lang.Object
io.micronaut.inject.ast.annotation.AbstractAnnotationElement
io.micronaut.python.processing.visitor.PythonMethodElement
io.micronaut.python.processing.visitor.PythonConstructorElement
- All Implemented Interfaces:
ElementProvider, AnnotatedElement, AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource, Described, Named, MutableAnnotationMetadataDelegate<Element>, ConstructorElement, Element, MemberElement, MethodElement
public final class PythonConstructorElement
extends PythonMethodElement
implements ConstructorElement
Represents a Python constructor as a Micronaut
ConstructorElement.
This class wraps a PythonMethodElement representing a constructor
(a method with name "__init__") and provides the ConstructorElement interface.
- Since:
- 5.2.0
- Author:
- Micronaut Team
-
Field Summary
Fields 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
ConstructorsConstructorDescriptionPythonConstructorElement(FunctionDef constructorDef, PythonProcessingEnvironment environment, AbstractPythonClassElement declaringType, AbstractPythonClassElement owningType, ElementAnnotationMetadataFactory metadataFactory) Constructs a newPythonConstructorElementfrom the givenFunctionDef. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcopyValues(io.micronaut.python.processing.visitor.AbstractPythonElement element) getName()booleanbooleanisPublic()protected final io.micronaut.python.processing.visitor.AbstractPythonElementmakeCopy()Methods inherited from class PythonMethodElement
copyThis, element, equals, getAnnotationMetadata, getAnnotationMetadataToWrite, getDeclaredTypeVariables, getDeclaringType, getDescription, getDocumentation, getGenericReturnType, getMethodAnnotationMetadata, getNativeType, getOverriddenMethods, getOwningType, getTargetAnnotationMetadata, hashCode, hasStereotype, hasStereotype, isAbstract, isAsync, isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullable, isPrivate, isReflectionRequired, isReflectionRequired, isStatic, withAnnotationMetadata, withNewOwningType, withNewParameters, withParametersMethods inherited from class AbstractAnnotationElement
annotate, annotate, annotate, annotate, annotate, getElementAnnotationMetadata, 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 AnnotationMetadataProvider
getAnnotationMetadataMethods inherited from interface ConstructorElement
hides, hides, overridesMethods inherited from interface Element
annotate, annotate, annotate, annotate, annotate, getDescription, getDocumentation, getDocumentation, getNativeType, getSimpleName, isAbstract, isFinal, isPackagePrivate, isPrivate, isProtected, isStatic, isSynthetic, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotypeMethods inherited from interface MemberElement
getDeclaringType, getModifiers, getOwningType, isAccessible, isAccessible, isAccessible, isReflectionRequired, isReflectionRequiredMethods inherited from interface MethodElement
addAssociatedBean, findParameterIndex, getDeclaredTypeArguments, getDeclaredTypeVariables, getDescription, getGenericReturnType, getMethodAnnotationMetadata, getOverriddenMethods, getParameter, getReceiverType, getSuspendParameters, getThrownTypes, getTypeArguments, hasParameters, isDefault, isSubSignature, isSuspend, isVarArgs, withAnnotationMetadata, withNewOwningType, withNewParameters, withParameters
-
Constructor Details
-
PythonConstructorElement
public PythonConstructorElement(FunctionDef constructorDef, PythonProcessingEnvironment environment, AbstractPythonClassElement declaringType, AbstractPythonClassElement owningType, ElementAnnotationMetadataFactory metadataFactory) Constructs a newPythonConstructorElementfrom the givenFunctionDef.- Parameters:
constructorDef- the constructor function definition; must not benullenvironment- the Python processing environment; must not benulldeclaringType- the class that declares this constructor; must not benullowningType- the class that owns this constructor (may be a subclass); must not benullmetadataFactory- the annotation metadata factory; must not benull- Throws:
NullPointerException- if any parameter isnull
-
-
Method Details
-
isPublic
public boolean isPublic()- Specified by:
isPublicin interfaceElement- Overrides:
isPublicin classPythonMethodElement- Returns:
- True if the element is public.
-
getName
-
getParameters
- Specified by:
getParametersin interfaceMethodElement- Overrides:
getParametersin classPythonMethodElement- Returns:
- The method parameters
-
getReturnType
- Specified by:
getReturnTypein interfaceConstructorElement- Specified by:
getReturnTypein interfaceMethodElement- Overrides:
getReturnTypein classPythonMethodElement- Returns:
- The return type of the method
-
copyValues
protected void copyValues(io.micronaut.python.processing.visitor.AbstractPythonElement element) - Parameters:
element- the values to be copied to
-
makeCopy
protected final io.micronaut.python.processing.visitor.AbstractPythonElement makeCopy() -
isProtected
public boolean isProtected()- Specified by:
isProtectedin interfaceElement- Returns:
- True if the element is protected.
-