Commit 4469d81a authored by Piotr Gawron's avatar Piotr Gawron
Browse files

requires at least one annotation is processed properly

parent ad512e65
......@@ -337,6 +337,15 @@ public class UserAnnotationSchema implements Serializable {
return new ArrayList<MiriamType>();
}
public boolean requiresAtLeastOneAnnotation(Class<?> clazz) {
for (UserClassRequiredAnnotations cva : classRequiredAnnotators) {
if (cva.getClassName().equals(clazz.getCanonicalName())) {
return cva.getRequireAtLeastOneAnnotation();
}
}
return false;
}
/**
* @return the classRequiredAnnotators
* @see #classRequiredAnnotators
......
......@@ -1153,6 +1153,7 @@ public class ProjectService implements IProjectService {
ClassTreeNode top = elementUtils.getAnnotatedElementClassTree();
Class<?> clazz = top.getClazz();
top.setData(annotationSchema.requiresAtLeastOneAnnotation(clazz));
TreeNode root = new DefaultTreeNode(new AnnotatedObjectTreeRow(top, modelAnnotator.getAvailableAnnotators(clazz),
modelAnnotator.getAnnotatorsFromCommonNames(annotationSchema.getAnnotatorsForClass(clazz)),
annotationSchema.getValidAnnotations(clazz), annotationSchema.getRequiredAnnotations(clazz)), null);
......@@ -1171,6 +1172,7 @@ public class ProjectService implements IProjectService {
for (ClassTreeNode node : element.getLeft().getChildren()) {
clazz = node.getClazz();
node.setData(annotationSchema.requiresAtLeastOneAnnotation(clazz));
AnnotatedObjectTreeRow data = new AnnotatedObjectTreeRow(node, modelAnnotator.getAvailableAnnotators(clazz),
modelAnnotator.getAnnotatorsFromCommonNames(annotationSchema.getAnnotatorsForClass(clazz)),
annotationSchema.getValidAnnotations(clazz), annotationSchema.getRequiredAnnotations(clazz));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment