}
protected void processTypeAnnotations( AbstractClassTypeDeclarationDescr typeDescr, TypeDeclaration type, TypeDeclaration parent ) {
// is it a regular fact or an event?
AnnotationDescr annotationDescr = getSingleAnnotation(typeDescr, TypeDeclaration.Role.ID);
String role = (annotationDescr != null) ? annotationDescr.getSingleValue() : null;
if (role != null) {
type.setRole(TypeDeclaration.Role.parseRole(role));
}
/*
else if (parent != null) {
// FIXME : Should this be here, since Drools 6 does not namely support annotation inheritance?
type.setRole(parent.getRole());
}
*/
annotationDescr = getSingleAnnotation(typeDescr, TypeDeclaration.ATTR_TYPESAFE);
String typesafe = (annotationDescr != null) ? annotationDescr.getSingleValue() : null;
if (typesafe != null) {
type.setTypesafe(Boolean.parseBoolean(typesafe));
}
/*
else if (parent != null && isSet(parent.getSetMask(), TypeDeclaration.TYPESAFE_BIT)) {
// FIXME : Should this be here, since Drools 6 does not namely support annotation inheritance?
type.setTypesafe(parent.isTypesafe());
}
*/
// is it a pojo or a template?
annotationDescr = getSingleAnnotation(typeDescr, TypeDeclaration.Format.ID);
String format = (annotationDescr != null) ? annotationDescr.getSingleValue() : null;
if (format != null) {
type.setFormat(TypeDeclaration.Format.parseFormat(format));
}
// is it a class, a trait or an enum?
annotationDescr = getSingleAnnotation(typeDescr, TypeDeclaration.Kind.ID);
String kind = (annotationDescr != null) ? annotationDescr.getSingleValue() : null;
if (kind != null) {
type.setKind(TypeDeclaration.Kind.parseKind(kind));
}
if (typeDescr instanceof EnumDeclarationDescr ) {
type.setKind(TypeDeclaration.Kind.ENUM);
}
annotationDescr = getSingleAnnotation( typeDescr, TypeDeclaration.ATTR_CLASS );
String className = (annotationDescr != null) ? annotationDescr.getSingleValue() : null;
if (isEmpty(className)) {
className = type.getTypeName();
}