use of org.kie.api.definition.type.TypeSafe in project drools by kiegroup.
the class TypeDeclarationFactory method processAnnotations.
public static void processAnnotations(AbstractClassTypeDeclarationDescr typeDescr, TypeDeclaration type) {
Role role = typeDescr.getTypedAnnotation(Role.class);
if (role != null) {
type.setRole(role.value());
}
TypeSafe typeSafe = typeDescr.getTypedAnnotation(TypeSafe.class);
if (typeSafe != null) {
type.setTypesafe(typeSafe.value());
}
if (typeDescr instanceof EnumDeclarationDescr) {
type.setKind(TypeDeclaration.Kind.ENUM);
} else if (typeDescr instanceof TypeDeclarationDescr && ((TypeDeclarationDescr) typeDescr).isTrait()) {
type.setKind(TypeDeclaration.Kind.TRAIT);
}
type.setDynamic(typeDescr.hasAnnotation(PropertyChangeSupport.class));
}
Aggregations