org.drools.spi
Interface Importer

All Superinterfaces:
java.io.Serializable
All Known Implementing Classes:
DefaultImporter

public interface Importer
extends java.io.Serializable

Importer holds a Set of ImportEntries and facilitates the tag within a by allowing Classes to be loaded using a specified ClassLoader


Method Summary
 void addImport(ImportEntry importEntry)
           Adds an ImportEntry to a Set
 java.util.Set getImportEntries()
           
 java.util.Set getImports()
           
 java.lang.Class importClass(java.lang.ClassLoader cl, java.lang.String className)
          Imports a Class using the given ClassLoader
 boolean isEmpty()
           
 

Method Detail

addImport

void addImport(ImportEntry importEntry)

Adds an ImportEntry to a Set

Parameters:
importEntry - - the importEntry

importClass

java.lang.Class importClass(java.lang.ClassLoader cl,
                            java.lang.String className)
                            throws java.lang.ClassNotFoundException,
                                   java.lang.Error
Imports a Class using the given ClassLoader

Parameters:
cl - - the ClassLoader to use
className - - the name of the Class to import
Returns:
- the loaded class
Throws:
java.lang.ClassNotFoundException - - Thrown if a Class is not found
java.lang.Error - Thrown is a class is ambiguously imported.

getImportEntries

java.util.Set getImportEntries()
Returns:
- The Set of ImportEntries

getImports

java.util.Set getImports()
Returns:
- the Set of imports, in text form.

isEmpty

boolean isEmpty()
Returns:
- true if no ImportEntries have been added