use of org.drools.drl.ast.descr.QualifiedName in project drools by kiegroup.
the class TypeDeclarationNameResolver method ensureQualifiedSuperType.
private void ensureQualifiedSuperType(AbstractClassTypeDeclarationDescr typeDescr, PackageDescr packageDescr, TypeResolver typeResolver, List<TypeDefinition> unresolvedTypes) {
for (QualifiedName qname : typeDescr.getSuperTypes()) {
String declaredSuperType = qname.getFullName();
String resolved = resolveName(declaredSuperType, typeDescr, packageDescr, typeResolver, unresolvedTypes, true);
if (resolved != null) {
qname.setName(resolved);
} else {
kbuilder.addBuilderResult(new TypeDeclarationError(typeDescr, "Cannot resolve supertype '" + declaredSuperType + " for declared type " + typeDescr.getTypeName()));
}
}
}
use of org.drools.drl.ast.descr.QualifiedName in project drools by kiegroup.
the class DescrTypeDefinition method processSuperTypes.
private void processSuperTypes() {
for (QualifiedName superType : typeDeclarationDescr.getSuperTypes()) {
Optional<Class<?>> optResolvedSuper = typeResolver.resolveType(superType.getName());
optResolvedSuper.ifPresent(resolvedSuper -> {
if (resolvedSuper.isInterface()) {
interfaceNames.add(superType.getName());
} else {
superTypeName = of(superType.getName());
abstractClass = of(resolvedSuper);
}
});
// We're extending a class using the Declared Type mechanism, so the super class doesn't exist in the classloader
if (!optResolvedSuper.isPresent()) {
superTypeName = of(superType.getName());
declaredAbstractClass = of(superType.getName());
}
}
}
Aggregations