Top Description Fields Constructors Methods
javax.el

public Class ImportHandler

extends Object
Class Inheritance
Imports
java.util.Map, .List, .HashMap, .ArrayList, .HashSet, java.lang.reflect.Modifier

Handles imports of class names and package names. An imported package name implicitly imports all the classes in the package. A class that has been imported can be used without its package name. The name is resolved to its full (package and class) name at evaluation time.

Field Summary

Modifier and TypeField and Description
private Map<String, Class<?>>
private Map<String, String>
private HashSet<String>
private List<String>
private Map<String, String>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
checkModifiers(int modifiers)

private Class<?>
getClassFor(String className)

public void
importClass(String
The full class name of the class to be imported
name
)

Import a class.

public void
importPackage(String
The package name to be imported
packageName
)

Import all the classes in a package.

public void
importStatic(String
The static member name, including the full class name, to be imported
name
)

Import a static field or method.

public Class<?>

Returns:

If the class has been imported previously, with importClass or importPackage, then its Class instance. Otherwise null.
resolveClass
(String
The name of the class (without package name) to be resolved.
name
)

Resolve a class name.

private Class<?>
public Class<?>

Returns:

If the field or method has been imported previously, with importStatic, then the class object representing the class that declares the static field or method. Otherwise null.
resolveStatic
(String
The name of the member(without package and class name) to be resolved.
name
)

Resolve a static field or method name.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

classMapback to summary
private Map<String, Class<?>> classMap
classNameMapback to summary
private Map<String, String> classNameMap
notAClassback to summary
private HashSet<String> notAClass
packagesback to summary
private List<String> packages
staticNameMapback to summary
private Map<String, String> staticNameMap

Constructor Detail

ImportHandlerback to summary
public ImportHandler()

Method Detail

checkModifiersback to summary
private void checkModifiers(int modifiers)
getClassForback to summary
private Class<?> getClassFor(String className)
importClassback to summary
public void importClass(String name) throws ELException

Import a class.

Parameters
name:String

The full class name of the class to be imported

Exceptions
ELException:
if the name does not include a ".".
importPackageback to summary
public void importPackage(String packageName)

Import all the classes in a package.

Parameters
packageName:String

The package name to be imported

importStaticback to summary
public void importStatic(String name) throws ELException

Import a static field or method.

Parameters
name:String

The static member name, including the full class name, to be imported

Exceptions
ELException:
if the name does not include a ".".
resolveClassback to summary
public Class<?> resolveClass(String name)

Resolve a class name.

Parameters
name:String

The name of the class (without package name) to be resolved.

Returns:Class<?>

If the class has been imported previously, with importClass or importPackage, then its Class instance. Otherwise null.

Exceptions
ELException:
if the class is abstract or is an interface, or not public.
resolveClassForback to summary
private Class<?> resolveClassFor(String className)
resolveStaticback to summary
public Class<?> resolveStatic(String name)

Resolve a static field or method name.

Parameters
name:String

The name of the member(without package and class name) to be resolved.

Returns:Class<?>

If the field or method has been imported previously, with importStatic, then the class object representing the class that declares the static field or method. Otherwise null.

Exceptions
ELException:
if the class is not public, or is abstract or is an interface.