use of org.drools.modelcompiler.builder.errors.UnsupportedFeatureError in project drools by kiegroup.
the class ModelBuilderImpl method processTypeDeclarationDescr.
private void processTypeDeclarationDescr(InternalKnowledgePackage pkg, AbstractClassTypeDeclarationDescr typeDescr) {
normalizeAnnotations(typeDescr, pkg.getTypeResolver(), false);
try {
Class<?> typeClass = pkg.getTypeResolver().resolveType(typeDescr.getTypeName());
String typePkg = typeClass.getPackage().getName();
String typeName = typeClass.getName().substring(typePkg.length() + 1);
TypeDeclaration type = new TypeDeclaration(typeName);
type.setTypeClass(typeClass);
type.setResource(typeDescr.getResource());
if (hasMvel()) {
type.setTypeClassDef(createClassDefinition(typeClass, typeDescr.getResource()));
}
TypeDeclarationFactory.processAnnotations(typeDescr, type);
if (!type.isTypesafe()) {
addBuilderResult(new UnsupportedFeatureError("@typesafe(false) is not supported in executable model : " + type));
}
getOrCreatePackageRegistry(new PackageDescr(typePkg)).getPackage().addTypeDeclaration(type);
} catch (ClassNotFoundException e) {
TypeDeclaration type = new TypeDeclaration(typeDescr.getTypeName());
type.setResource(typeDescr.getResource());
TypeDeclarationFactory.processAnnotations(typeDescr, type);
pkg.addTypeDeclaration(type);
}
}
Aggregations