private ResourceClass getResourceClass(TypeElement typeElem, RestxResource r, ResourceGroup group, Set<Element> modulesListOriginatingElements) {
String fqcn = typeElem.getQualifiedName().toString();
ResourceClass resourceClass = group.resourceClasses.get(fqcn);
if (resourceClass == null) {
modulesListOriginatingElements.add(typeElem);
When when = typeElem.getAnnotation(When.class);
group.resourceClasses.put(fqcn, resourceClass = new ResourceClass(group, fqcn, r.priority(),
when == null ? ""
: ("@restx.factory.When(name=\"" + when.name() + "\", value=\"" + when.value() + "\")")));
resourceClass.originatingElements.add(typeElem);
}
return resourceClass;
}