Class PythonEnumElement
java.lang.Object
io.micronaut.inject.ast.annotation.AbstractAnnotationElement
io.micronaut.python.processing.visitor.AbstractPythonClassElement
io.micronaut.python.processing.visitor.PythonEnumElement
- All Implemented Interfaces:
ElementProvider, AnnotatedElement, AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource, Described, Named, MutableAnnotationMetadataDelegate<Element>, ArrayableClassElement, ClassElement, Element, EnumElement, TypedElement
Represents a Python enum class element in the Micronaut injection context.
This class extends AbstractPythonClassElement and implements EnumElement
to provide enum-specific functionality for Python enums parsed from AST.
- Since:
- 5.2.0
- Author:
- Micronaut Team
-
Field Summary
Fields inherited from class AbstractPythonClassElement
arrayDimensions, environment, PYTHON_DEFAULT_PACKAGE, typeAnnotationsKeyFields 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 ClassElement
ZERO_CLASS_ELEMENTSFields inherited from interface Element
EMPTY_ELEMENT_ARRAYFields inherited from interface MutableAnnotationMetadataDelegate
EMPTY -
Constructor Summary
ConstructorsConstructorDescriptionPythonEnumElement(ClassDef classDef, PythonProcessingEnvironment environment) Creates a new PythonEnumElement for the given class definition.PythonEnumElement(ClassDef classDef, PythonProcessingEnvironment environment, int arrayDimensions) Creates a new PythonEnumElement for the given class definition with array dimensions. -
Method Summary
Modifier and TypeMethodDescriptionprotected io.micronaut.python.processing.visitor.AbstractPythonElementcopyThis()protected ClassElementcreateWithArrayDimensions(int arrayDimensions) elements()The enum constant elements that make up this enum.booleanReturns the bean properties (getters and setters) for this class element.getBeanProperties(PropertyElementQuery propertyElementQuery) Returns the bean properties (getters and setters) for this class element based on custom configuration.getName()inthashCode()booleanisAssignable(String type) Tests whether one type is assignable to another.booleanisEnum()Whether this element is an enum.booleanbooleanisPublic()protected final io.micronaut.python.processing.visitor.AbstractPythonElementmakeCopy()toString()values()The values that make up this enum.Methods inherited from class AbstractPythonClassElement
copyValues, element, excludeIntrospectedProperties, findPythonClass, getAnnotationMetadata, getAnnotationMetadataToWrite, getArrayDimensions, getDocumentation, getEnclosedElements, getFields, getInterfaces, getNativeType, getPackageName, getSyntheticBeanProperties, getTypeAnnotationMetadata, getTypeAnnotationsKey, isAbstract, isArray, withAnnotationMetadata, withArrayDimensionsMethods inherited from class AbstractAnnotationElement
annotate, annotate, annotate, annotate, annotate, getElementAnnotationMetadata, getElementAnnotationMetadataFactory, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotypeMethods 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 ArrayableClassElement
fromArray, toArrayMethods inherited from interface ClassElement
addAssociatedBean, findDefaultStaticCreator, findField, findMethod, findStaticCreator, foldBoundGenericTypes, getAccessibleConstructors, getAccessibleStaticCreators, getAllTypeArguments, getBoundGenericTypes, getCanonicalName, getDeclaredGenericPlaceholders, getDefaultConstructor, getEnclosedElement, getEnclosedElements, getEnclosingType, getFields, getFirstTypeArgument, getInterfaces, getMethods, getOptionalValueType, getPackage, getPackageName, getPermittedSubclasses, getPrimaryConstructor, getRawClassElement, getSimpleName, getSuperType, getSyntheticBeanProperties, getType, getTypeAnnotationMetadata, getTypeArguments, getTypeArguments, getTypeArguments, hasUnresolvedTypes, isAssignable, isAssignable, isContainerType, isGenericPlaceholder, isInner, isInterface, isIterable, isOptional, isProxy, isRawType, isRecord, isSealed, isTypeVariable, isWildcard, withAnnotationMetadata, withBoundGenericTypes, withTypeArguments, withTypeArgumentsMethods inherited from interface Element
annotate, annotate, annotate, annotate, annotate, getDescription, getDescription, getDocumentation, getDocumentation, getModifiers, getName, getNativeType, isAbstract, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isSynthetic, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotypeMethods inherited from interface TypedElement
getArrayDimensions, getGenericType, isArray, isPrimitive, isVoid
-
Constructor Details
-
PythonEnumElement
Creates a new PythonEnumElement for the given class definition.- Parameters:
classDef- The class definition from Python ASTenvironment- The Python processing environment
-
PythonEnumElement
public PythonEnumElement(ClassDef classDef, PythonProcessingEnvironment environment, int arrayDimensions) Creates a new PythonEnumElement for the given class definition with array dimensions.- Parameters:
classDef- The class definition from Python ASTenvironment- The Python processing environmentarrayDimensions- The number of array dimensions
-
-
Method Details
-
isEnum
public boolean isEnum()Description copied from interface:ClassElementWhether this element is an enum.- Specified by:
isEnumin interfaceClassElement- Returns:
- True if it is an enum
-
createWithArrayDimensions
- Specified by:
createWithArrayDimensionsin classAbstractPythonClassElement
-
toString
-
values
Description copied from interface:EnumElementThe values that make up this enum.- Specified by:
valuesin interfaceEnumElement- Returns:
- The values
-
elements
Description copied from interface:EnumElementThe enum constant elements that make up this enum.- Specified by:
elementsin interfaceEnumElement- Returns:
- The enum constant elements
-
getBeanProperties
Description copied from interface:ClassElementReturns the bean properties (getters and setters) for this class element.- Specified by:
getBeanPropertiesin interfaceClassElement- Overrides:
getBeanPropertiesin classAbstractPythonClassElement- Returns:
- The bean properties for this class element
-
getBeanProperties
Description copied from interface:ClassElementReturns the bean properties (getters and setters) for this class element based on custom configuration.- Specified by:
getBeanPropertiesin interfaceClassElement- Overrides:
getBeanPropertiesin classAbstractPythonClassElement- Parameters:
propertyElementQuery- The configuration- Returns:
- The bean properties for this class element
-
copyThis
protected io.micronaut.python.processing.visitor.AbstractPythonElement copyThis()- Specified by:
copyThisin classAbstractPythonClassElement- Returns:
- copy of this element
-
isAssignable
Description copied from interface:ClassElementTests whether one type is assignable to another.- Specified by:
isAssignablein interfaceClassElement- Parameters:
type- The type to check- Returns:
trueif and only if this type is assignable to the second
-
makeCopy
protected final io.micronaut.python.processing.visitor.AbstractPythonElement makeCopy() -
getName
-
isProtected
public boolean isProtected()- Specified by:
isProtectedin interfaceElement- Returns:
- True if the element is protected.
-
isPublic
-
equals
-
hashCode
-