}
private String getCategory(final TypeElement e)
{
Elements elementUtils = processingEnv.getElementUtils();
TypeElement annotationElement = elementUtils.getTypeElement(MANAGED_OBJECT_CANONICAL_NAME);
String category = null;
List<? extends AnnotationMirror> annotationMirrors = e.getAnnotationMirrors();
if(annotationMirrors != null)
{
for (AnnotationMirror a : annotationMirrors)
{
if (a.getAnnotationType().asElement().equals(annotationElement))
{
category = e.getSimpleName().toString().toLowerCase();
for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : a.getElementValues()
.entrySet())
{
if (entry.getKey().getSimpleName().toString().equals("category"))
{
if (!Boolean.TRUE.equals(entry.getValue().getValue()))
{
category = null;
}
break;
}
}
break;
}
}
}
if (category == null)
{
for (TypeMirror interfaceMirror : e.getInterfaces())
{
category = getCategory((TypeElement) processingEnv.getTypeUtils().asElement(interfaceMirror));
if (category != null)
{
break;
}
}
}
if (category == null && e.getSuperclass() != null)
{
TypeElement parent = (TypeElement) processingEnv.getTypeUtils().asElement(e.getSuperclass());
if(parent != null)
{
category = getCategory(parent);
}
}