4 import javax.lang.model.element.*;
5 import javax.lang.model.util.*;
8 private final Map<String, TypeElement> types;
10 public TypeMap(Collection<? extends Element> roots, final Elements eu) {
11 final Map<String, TypeElement> types = new HashMap<String, TypeElement>();
12 ElementVisitor<Void, Void> v = new ElementScanner6<Void, Void>() {
13 public Void visitType(TypeElement el, Void p) {
14 if((types.put(eu.getBinaryName(el).toString(), el)) != null)
15 throw(new RuntimeException("type name conflict: " + eu.getBinaryName(el)));
16 return(super.visitType(el, p));
19 for(Element el : roots)
24 public TypeElement get(String name) {
25 return(types.get(name));