net.esper.eql.core
Class AutoImportServiceImpl

java.lang.Object
  extended by net.esper.eql.core.AutoImportServiceImpl
All Implemented Interfaces:
AutoImportService

public class AutoImportServiceImpl
extends java.lang.Object
implements AutoImportService

A service that allows users to refer to classes by partial names. Users import either package names (e.g. "java.lang.*) or class names (e.g. "java.lang.String") and afterwards the service uses those imports to resolve partial names (e.g. "String").


Constructor Summary
AutoImportServiceImpl(java.lang.String[] imports)
          Ctor.
 
Method Summary
protected  void addImport(java.lang.String importName)
          Add a package to the auto-import list, for testing.
protected  java.lang.String[] getImports()
          For testing, returns imports.
 java.lang.Class resolveClass(java.lang.String className)
          Gets the Class object for the class name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AutoImportServiceImpl

public AutoImportServiceImpl(java.lang.String[] imports)
Ctor.

Parameters:
imports - - the package and class names that will be used to resolve partial class names
Method Detail

resolveClass

public java.lang.Class resolveClass(java.lang.String className)
                             throws java.lang.ClassNotFoundException
Description copied from interface: AutoImportService
Gets the Class object for the class name. If the class name is incomplete, uses the imported class and package names to attempt to resolve the name.

Specified by:
resolveClass in interface AutoImportService
Parameters:
className - - the name of the class to resolve
Returns:
- the Class object for this class name
Throws:
java.lang.ClassNotFoundException

getImports

protected java.lang.String[] getImports()
For testing, returns imports.

Returns:
returns auto-import list as array

addImport

protected void addImport(java.lang.String importName)
Add a package to the auto-import list, for testing.

Parameters:
importName - to add