File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/main/java/com/google/testing/compile Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 39
39
import javax .lang .model .util .Types ;
40
40
41
41
/**
42
- * A {@link JUnit4} {@link Rule} that executes tests such that an instances of {@link Elements}
43
- * and {@link Types} are available during execution.
42
+ * A {@link JUnit4} {@link Rule} that executes tests such that a instances of {@link Elements} and
43
+ * {@link Types} are available during execution.
44
44
*
45
45
* <p>To use this rule in a test, just add the following field: <pre> {@code
46
46
* @Rule public CompilationRule compilationRule = new CompilationRule();}
@@ -99,11 +99,21 @@ public boolean process(Set<? extends TypeElement> annotations,
99
99
};
100
100
}
101
101
102
+ /**
103
+ * Returns the {@link Elements} instance associated with the current execution of the rule.
104
+ *
105
+ * @throws IllegalStateException if this method is invoked outside the execution of the rule.
106
+ */
102
107
public Elements getElements () {
103
108
checkState (elements != null , "Not running within the rule" );
104
109
return elements ;
105
110
}
106
111
112
+ /**
113
+ * Returns the {@link Types} instance associated with the current execution of the rule.
114
+ *
115
+ * @throws IllegalStateException if this method is invoked outside the execution of the rule.
116
+ */
107
117
public Types getTypes () {
108
118
checkState (elements != null , "Not running within the rule" );
109
119
return types ;
You can’t perform that action at this time.
0 commit comments