Class TypeDeclarationUtils


  • public class TypeDeclarationUtils
    extends Object
    • Constructor Detail

      • TypeDeclarationUtils

        public TypeDeclarationUtils()
    • Method Detail

      • lookupSimpleNameByImports

        public static String lookupSimpleNameByImports​(String name,
                                                       org.drools.drl.ast.descr.AbstractClassTypeDeclarationDescr typeDescr,
                                                       org.drools.drl.ast.descr.PackageDescr packageDescr,
                                                       ClassLoader loader)
      • getExistingDeclarationClass

        public static Class<?> getExistingDeclarationClass​(org.drools.drl.ast.descr.AbstractClassTypeDeclarationDescr typeDescr,
                                                           PackageRegistry reg)
      • resolveType

        public static String resolveType​(String klass,
                                         org.drools.drl.ast.descr.PackageDescr packageDescr,
                                         PackageRegistry pkgRegistry)
        Tries to determine the namespace (package) of a simple type chosen to be the superclass of a declared bean. Looks among imports, local declarations and previous declarations. Means that a class can't extend another class declared in package that has not been loaded yet.
        Parameters:
        klass - the simple name of the class
        packageDescr - the descriptor of the package the base class is declared in
        pkgRegistry - the current package registry
        Returns:
        the fully qualified name of the superclass
      • isCompatible

        public static boolean isCompatible​(Class<?> typeClass,
                                           org.drools.drl.ast.descr.AbstractClassTypeDeclarationDescr typeDescr)
      • isQualified

        public static boolean isQualified​(String name)
      • isNovelClass

        public static boolean isNovelClass​(org.drools.drl.ast.descr.AbstractClassTypeDeclarationDescr typeDescr,
                                           PackageRegistry reg)
      • rewriteInitExprWithImports

        public static String rewriteInitExprWithImports​(String expr,
                                                        org.drools.core.addon.TypeResolver typeResolver)
      • processModifiedProps

        public static void processModifiedProps​(Class<?> cls,
                                                org.drools.core.factmodel.ClassDefinition clsDef)