Interface TypedElement
- All Superinterfaces:
AnnotatedElement, AnnotationMetadata, AnnotationMetadataDelegate, AnnotationMetadataProvider, AnnotationSource, Described, Element, MutableAnnotationMetadataDelegate<Element>, Named
- All Known Subinterfaces:
AnnotationElement, ArrayableClassElement, BeanFieldElement, BeanParameterElement, ClassElement, EnumConstantElement, EnumElement, FieldElement, GenericElement, GenericPlaceholderElement, KotlinParameterElement, ParameterElement, PropertyElement, WildcardElement
- All Known Implementing Classes:
GroovyClassElement, GroovyEnumConstantElement, GroovyFieldElement, GroovyParameterElement, JavaClassElement, PrimitiveElement
An element that has an underlying type.
- Since:
- 1.0
- Author:
- graemerocher
- See Also:
-
Field Summary
Fields 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 -
Method Summary
Modifier and TypeMethodDescriptiondefault intIf the type is an array, the number of dimensions.default ClassElementReturns the generic type of the element.getType()default booleanisArray()Is the type an array.default booleanWhether the type is primitive.default booleanisVoid()Whether the type is void.Methods inherited from interface AnnotatedElement
isDeclaredNonNull, isDeclaredNullable, isNonNull, isNullableMethods inherited from interface AnnotationMetadata
enumValuesSet, enumValuesSet, getValues, hasDeclaredStereotype, hasEvaluatedExpressions, 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, 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 Element
annotate, annotate, annotate, annotate, annotate, getDescription, getDescription, getDocumentation, getDocumentation, getModifiers, getName, getNativeType, getSimpleName, isAbstract, isFinal, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic, isSynthetic, removeAnnotation, removeAnnotation, removeAnnotationIf, removeStereotype, removeStereotype, withAnnotationMetadata
-
Method Details
-
getType
ClassElement getType()- Returns:
- The type of the element
-
getGenericType
Returns the generic type of the element. This differs fromgetType()as it returns the actual type without erasure. WhilstgetType()is often needed to produce the correct byte code when generating code via ASM, thegetGenericType()method is more useful for documentation and other types of code generation.- Returns:
- The generic type
- Since:
- 1.1.1
-
isPrimitive
default boolean isPrimitive()Whether the type is primitive.- Returns:
- True if it is
-
isVoid
default boolean isVoid()Whether the type is void.- Returns:
- True if it is
- Since:
- 4.0.0
-
isArray
default boolean isArray()Is the type an array.- Returns:
- True if it is.
-
getArrayDimensions
default int getArrayDimensions()If the type is an array, the number of dimensions. String[] should return 1, String[][] should return 2- Returns:
- The number of dimensions
-