# javax.lang.model.element

***

**1. Get the enclosing element of an element**

```java
Element enclosingElement = element.getEnclosingElement();
```

**2. Get the annotations of an element**

```java
List<? extends AnnotationMirror> annotations = element.getAnnotationMirrors();
```

**3. Get the modifiers of an element**

```java
Set<Modifier> modifiers = element.getModifiers();
```

**4. Get the simple name of an element**

```java
String simpleName = element.getSimpleName().toString();
```

**5. Get the qualified name of an element**

```java
String qualifiedName = element.getQualifiedName().toString();
```

**6. Get the kind of an element**

```java
ElementKind kind = element.getKind();
```

**7. Get the type of an element**

```java
TypeMirror type = element.asType();
```

**8. Get the value of an annotation**

```java
Object value = element.getAnnotation(AnnotationName.class).getValue();
```

**9. Get the default value of an annotation**

```java
Object defaultValue = element.getAnnotationDefault().getValue();
```

**10. Get the documentation for an element**

```java
String documentation = element.getDocComment();
```

**11. Get the position of an element**

```java
Position position = element.getPosition();
```

**12. Get the enclosing class of an element**

```java
Class<? extends TypeElement> enclosingClass = element.getEnclosingElement().getClass();
```

**13. Get the enclosing method of an element**

```java
Method<? extends ExecutableElement> enclosingMethod = element.getEnclosingElement().getClass();
```

**14. Get the enclosing constructor of an element**

```java
Constructor<? extends ExecutableElement> enclosingConstructor = element.getEnclosingElement().getClass();
```

**15. Get the enclosing package of an element**

```java
Package<? extends PackageElement> enclosingPackage = element.getEnclosingElement().getClass();
```

**16. Get the enclosing module of an element**

```java
Module<? extends ModuleElement> enclosingModule = element.getEnclosingElement().getClass();
```

**17. Get the enclosing type of an element**

```java
Type<? extends TypeElement> enclosingType = element.getEnclosingElement().getClass();
```

**18. Get the enclosing annotation of an element**

```java
Annotation<? extends AnnotationElement> enclosingAnnotation = element.getEnclosingElement().getClass();
```

**19. Get the enclosing enum of an element**

```java
Enum<? extends EnumElement> enclosingEnum = element.getEnclosingElement().getClass();
```

**20. Get the enclosing record of an element**

```java
Record<? extends RecordElement> enclosingRecord = element.getEnclosingElement().getClass();
```

**21. Get the enclosing record component of an element**

```java
RecordComponent<? extends RecordElement> enclosingRecordComponent = element.getEnclosingElement().getClass();
```

**22. Get the enclosing variable of an element**

```java
Variable<? extends VariableElement> enclosingVariable = element.getEnclosingElement().getClass();
```

**23. Get the enclosing parameter of an element**

```java
Parameter<? extends VariableElement> enclosingParameter = element.getEnclosingElement().getClass();
```

**24. Get the enclosing type parameter of an element**

```java
TypeParameter<? extends TypeElement> enclosingTypeParameter = element.getEnclosingElement().getClass();
```

**25. Get the enclosing method parameter of an element**

```java
MethodParameter<? extends VariableElement> enclosingMethodParameter = element.getEnclosingElement().getClass();
```

**26. Get the enclosing constructor parameter of an element**

```java
ConstructorParameter<? extends VariableElement> enclosingConstructorParameter = element.getEnclosingElement().getClass();
```

**27. Get the enclosing type use of an element**

```java
TypeUse<? extends TypeElement> enclosingTypeUse = element.getEnclosingElement().getClass();
```

**28. Get the enclosing method use of an element**

```java
MethodUse<? extends ExecutableElement> enclosingMethodUse = element.getEnclosingElement().getClass();
```

**29. Get the enclosing constructor use of an element**

```java
ConstructorUse<? extends ExecutableElement> enclosingConstructorUse = element.getEnclosingElement().getClass();
```

**30. Get the enclosing field use of an element**

```java
FieldUse<? extends VariableElement> enclosingFieldUse = element.getEnclosingElement().getClass();
```

**31. Get the enclosing local variable use of an element**

```java
LocalVariableUse<? extends VariableElement> enclosingLocalVariableUse = element.getEnclosingElement().getClass();
```

**32. Get the enclosing annotation value of an element**

```java
AnnotationValue<? extends AnnotationElement> enclosingAnnotationValue = element.getEnclosingElement().getClass();
```

**33. Get the enclosing enum value of an element**

```java
EnumValue<? extends EnumElement> enclosingEnumValue = element.getEnclosingElement().getClass();
```

**34. Get the enclosing record component value of an element**

```java
RecordComponentValue<? extends RecordElement> enclosingRecordComponentValue = element.getEnclosingElement().getClass();
```

**35. Get the enclosing package of an element**

```java
Package<? extends PackageElement> enclosingPackage = element.getEnclosingElement().getClass();
```

**36. Get the enclosing module of an element**

```java
Module<? extends ModuleElement> enclosingModule = element.getEnclosingElement().getClass();
```

**37. Get the enclosing type of an element**

```java
Type<? extends TypeElement> enclosingType = element.getEnclosingElement().getClass();
```

**38. Get the enclosing annotation of an element**

```java
Annotation<? extends AnnotationElement> enclosingAnnotation = element.getEnclosingElement().getClass();
```

**39. Get the enclosing enum of an element**

```java
Enum<? extends EnumElement> enclosingEnum = element.getEnclosingElement().getClass();
```

**40. Get the enclosing record of an element**

```java
Record<? extends RecordElement> enclosingRecord = element.getEnclosingElement().getClass();
```

**41. Get the enclosing record component of an element**

```java
RecordComponent<? extends RecordElement> enclosingRecordComponent = element.getEnclosingElement().getClass();
```

**42. Get the enclosing variable of an element**

```java
Variable<? extends VariableElement> enclosingVariable = element.getEnclosingElement().getClass();
```

**43. Get the enclosing parameter of an element**

```java
Parameter<? extends VariableElement> enclosingParameter = element.getEnclosingElement().getClass();
```

**44. Get the enclosing type parameter of an element**

```java
TypeParameter<? extends TypeElement> enclosingTypeParameter = element.getEnclosingElement().getClass();
```

**45. Get the enclosing method parameter of an element**

```java
MethodParameter<? extends VariableElement> enclosingMethodParameter = element.getEnclosingElement().getClass();
```

**46. Get the enclosing constructor parameter of an element**

```java
ConstructorParameter<? extends VariableElement> enclosingConstructorParameter = element.getEnclosingElement().getClass();
```

**47. Get the enclosing type use of an element**

```java
TypeUse<? extends TypeElement> enclosingTypeUse = element.getEnclosingElement().getClass();
```

**48. Get the enclosing method use of an element**

```java
MethodUse<? extends ExecutableElement> enclosingMethodUse = element.getEnclosingElement().getClass();
```

**49. Get the enclosing constructor use of an element**

```java
ConstructorUse<? extends ExecutableElement> enclosingConstructorUse = element.getEnclosingElement().getClass();
```

**50. Get the enclosing field use of an element**

```java
FieldUse<? extends VariableElement> enclosingFieldUse = element.getEnclosingElement().getClass();
```
