use of com.mercedesbenz.sechub.pds.usecase.PDSUseCaseDefinition in project sechub by mercedes-benz.
the class UseCaseModel method getAnnotatedDef.
private UseCaseDef getAnnotatedDef(Class<?> clazzToFetch) {
UseCaseDef d = new UseCaseDef();
UseCaseDefinition def = clazzToFetch.getAnnotation(UseCaseDefinition.class);
if (def != null) {
d.title = def.title();
d.description = def.description();
d.group = convert(def.group());
} else {
PDSUseCaseDefinition pdsDef = clazzToFetch.getAnnotation(PDSUseCaseDefinition.class);
d.title = pdsDef.title();
d.description = pdsDef.description();
d.group = convert(pdsDef.group());
}
return d;
}
use of com.mercedesbenz.sechub.pds.usecase.PDSUseCaseDefinition in project sechub by mercedes-benz.
the class UseCaseModel method fetchId.
private UseCaseId fetchId(Class<? extends Annotation> clazz) {
UseCaseId r = new UseCaseId();
Class<? extends Annotation> clazzToFetch = DocReflectionUtil.resolveUnproxiedClass(clazz);
UseCaseDefinition definition = clazzToFetch.getAnnotation(UseCaseDefinition.class);
if (definition != null) {
UseCaseIdentifier ide = definition.id();
r.name = ide.name();
r.uniqueId = ide.uniqueId();
return r;
}
PDSUseCaseDefinition definition2 = clazzToFetch.getAnnotation(PDSUseCaseDefinition.class);
if (definition2 == null) {
throw new IllegalStateException("cannot fetch id from " + clazz);
}
PDSUseCaseIdentifier ide = definition2.id();
r.name = ide.name();
r.uniqueId = ide.uniqueId();
return r;
}
Aggregations