Provide access to source element annotations for TempDirFactory · junit-team/junit-framework@acb6e65 (original) (raw)

``

1

`+

/*

`

``

2

`+

`

``

3

`+

`

``

4

`+

`

``

5

`+

`

``

6

`+

`

``

7

`+

`

``

8

`+

`

``

9

`+

*/

`

``

10

+

``

11

`+

package org.junit.jupiter.api.extension;

`

``

12

+

``

13

`+

import static org.apiguardian.api.API.Status.EXPERIMENTAL;

`

``

14

+

``

15

`+

import java.lang.annotation.Annotation;

`

``

16

`+

import java.lang.reflect.AnnotatedElement;

`

``

17

`+

import java.util.List;

`

``

18

`+

import java.util.Optional;

`

``

19

+

``

20

`+

import org.apiguardian.api.API;

`

``

21

`+

import org.junit.platform.commons.support.AnnotationSupport;

`

``

22

+

``

23

`+

/**

`

``

24

`+

`

``

25

`+

`

``

26

`+

`

``

27

`+

`

``

28

`+

`

``

29

`+

`

``

30

`+

`

``

31

`+

`

``

32

`+

`

``

33

`+

`

``

34

`+

`

``

35

`+

*/

`

``

36

`+

@API(status = EXPERIMENTAL, since = "5.10")

`

``

37

`+

public interface AnnotatedElementContext {

`

``

38

+

``

39

`+

/**

`

``

40

`+

`

``

41

`+

`

``

42

`+

`

``

43

`+

`

``

44

`+

`

``

45

`+

`

``

46

`+

`

``

47

`+

`

``

48

`+

`

``

49

`+

`

``

50

`+

*/

`

``

51

`+

AnnotatedElement getAnnotatedElement();

`

``

52

+

``

53

`+

/**

`

``

54

`+

`

``

55

`+

`

``

56

`+

`

``

57

`+

`

``

58

`+

`

``

59

`+

`

``

60

`+

`

``

61

`+

`

``

62

`+

`

``

63

`+

`

``

64

`+

`

``

65

`+

`

``

66

`+

`

``

67

`+

*/

`

``

68

`+

default boolean isAnnotated(Class<? extends Annotation> annotationType) {

`

``

69

`+

return AnnotationSupport.isAnnotated(getAnnotatedElement(), annotationType);

`

``

70

`+

}

`

``

71

+

``

72

`+

/**

`

``

73

`+

`

``

74

`+

`

``

75

`+

`

``

76

`+

`

``

77

`+

`

``

78

`+

`

``

79

`+

`

``

80

`+

`

``

81

`+

`

``

82

`+

`

``

83

`+

`

``

84

`+

`

``

85

`+

`

``

86

`+

`

``

87

`+

`

``

88

`+

*/

`

``

89

`+

default Optional findAnnotation(Class annotationType) {

`

``

90

`+

return AnnotationSupport.findAnnotation(getAnnotatedElement(), annotationType);

`

``

91

`+

}

`

``

92

+

``

93

`+

/**

`

``

94

`+

`

``

95

`+

`

``

96

`+

`

``

97

`+

`

``

98

`+

`

``

99

`+

`

``

100

`+

`

``

101

`+

`

``

102

`+

`

``

103

`+

`

``

104

`+

`

``

105

`+

`

``

106

`+

`

``

107

`+

`

``

108

`+

`

``

109

`+

`

``

110

`+

`

``

111

`+

*/

`

``

112

`+

default List findRepeatableAnnotations(Class annotationType) {

`

``

113

`+

return AnnotationSupport.findRepeatableAnnotations(getAnnotatedElement(), annotationType);

`

``

114

`+

}

`

``

115

+

``

116

`+

}

`