use of org.antlr.v4.runtime.RuleDependencies in project antlr4 by tunnelvisionlabs.
the class RuleDependencyChecker method getElementDependencies.
private static void getElementDependencies(AnnotatedElement annotatedElement, List<Tuple2<RuleDependency, AnnotatedElement>> result) {
RuleDependency dependency = annotatedElement.getAnnotation(RuleDependency.class);
if (dependency != null) {
result.add(Tuple.create(dependency, annotatedElement));
}
RuleDependencies dependencies = annotatedElement.getAnnotation(RuleDependencies.class);
if (dependencies != null) {
for (RuleDependency d : dependencies.value()) {
if (d != null) {
result.add(Tuple.create(d, annotatedElement));
}
}
}
}
use of org.antlr.v4.runtime.RuleDependencies in project antlr4 by tunnelvisionlabs.
the class RuleDependencyProcessor method getDependencies.
public static List<Tuple2<RuleDependency, Element>> getDependencies(RoundEnvironment roundEnv) {
List<Tuple2<RuleDependency, Element>> result = new ArrayList<Tuple2<RuleDependency, Element>>();
Set<? extends Element> elements = roundEnv.getElementsAnnotatedWith(RuleDependency.class);
for (Element element : elements) {
RuleDependency dependency = element.getAnnotation(RuleDependency.class);
if (dependency == null) {
continue;
}
result.add(Tuple.create(dependency, element));
}
elements = roundEnv.getElementsAnnotatedWith(RuleDependencies.class);
for (Element element : elements) {
RuleDependencies dependencies = element.getAnnotation(RuleDependencies.class);
if (dependencies == null || dependencies.value() == null) {
continue;
}
for (RuleDependency dependency : dependencies.value()) {
result.add(Tuple.create(dependency, element));
}
}
return result;
}
Aggregations