Drools :: Compiler 6.2.0.Final

org.drools.compiler.builder.impl
Class TypeDeclarationUtils

java.lang.Object
  extended by org.drools.compiler.builder.impl.TypeDeclarationUtils

public class TypeDeclarationUtils
extends Object


Constructor Summary
TypeDeclarationUtils()
           
 
Method Summary
static Class<?> getClassForType(String type, ClassLoader loader)
           
static Class<?> getExistingDeclarationClass(AbstractClassTypeDeclarationDescr typeDescr, PackageRegistry reg)
           
static boolean isCompatible(Class<?> typeClass, AbstractClassTypeDeclarationDescr typeDescr)
           
static boolean isNovelClass(AbstractClassTypeDeclarationDescr typeDescr, PackageRegistry reg)
           
static boolean isQualified(String name)
           
static String lookupSimpleNameByImports(String name, AbstractClassTypeDeclarationDescr typeDescr, PackageDescr packageDescr, ClassLoader loader)
           
static String resolveType(String klass, PackageDescr packageDescr, PackageRegistry pkgRegistry)
          Tries to determine the namespace (package) of a simple type chosen to be the superclass of a declared bean.
static String rewriteInitExprWithImports(String expr, org.drools.core.base.TypeResolver typeResolver)
           
static String toBuildableType(String className, ClassLoader loader)
           
static String typeName2ClassName(String type, ClassLoader loader)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeDeclarationUtils

public TypeDeclarationUtils()
Method Detail

lookupSimpleNameByImports

public static String lookupSimpleNameByImports(String name,
                                               AbstractClassTypeDeclarationDescr typeDescr,
                                               PackageDescr packageDescr,
                                               ClassLoader loader)

getExistingDeclarationClass

public static Class<?> getExistingDeclarationClass(AbstractClassTypeDeclarationDescr typeDescr,
                                                   PackageRegistry reg)

resolveType

public static String resolveType(String klass,
                                 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

typeName2ClassName

public static String typeName2ClassName(String type,
                                        ClassLoader loader)

getClassForType

public static Class<?> getClassForType(String type,
                                       ClassLoader loader)

isCompatible

public static boolean isCompatible(Class<?> typeClass,
                                   AbstractClassTypeDeclarationDescr typeDescr)

isQualified

public static boolean isQualified(String name)

isNovelClass

public static boolean isNovelClass(AbstractClassTypeDeclarationDescr typeDescr,
                                   PackageRegistry reg)

rewriteInitExprWithImports

public static String rewriteInitExprWithImports(String expr,
                                                org.drools.core.base.TypeResolver typeResolver)

toBuildableType

public static String toBuildableType(String className,
                                     ClassLoader loader)

Drools :: Compiler 6.2.0.Final

Copyright © 2001-2015 JBoss by Red Hat. All Rights Reserved.