Search in sources :

Example 1 with PDSUseCaseIdentifier

use of com.mercedesbenz.sechub.pds.usecase.PDSUseCaseIdentifier 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;
}
Also used : PDSUseCaseIdentifier(com.mercedesbenz.sechub.pds.usecase.PDSUseCaseIdentifier) UseCaseIdentifier(com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseIdentifier) PDSUseCaseIdentifier(com.mercedesbenz.sechub.pds.usecase.PDSUseCaseIdentifier) UseCaseDefinition(com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseDefinition) PDSUseCaseDefinition(com.mercedesbenz.sechub.pds.usecase.PDSUseCaseDefinition) PDSUseCaseDefinition(com.mercedesbenz.sechub.pds.usecase.PDSUseCaseDefinition)

Aggregations

PDSUseCaseDefinition (com.mercedesbenz.sechub.pds.usecase.PDSUseCaseDefinition)1 PDSUseCaseIdentifier (com.mercedesbenz.sechub.pds.usecase.PDSUseCaseIdentifier)1 UseCaseDefinition (com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseDefinition)1 UseCaseIdentifier (com.mercedesbenz.sechub.sharedkernel.usecases.UseCaseIdentifier)1