|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jguiraffe.di.impl.ClassDescription
public class ClassDescription
A helper class for defining references to classes.
Handling of classes can become quite complex because of issues with different class loaders. Because of that the dependency injection framework supports multiple ways of defining classes:
Class objects; this can be used
when the class is already known at compile timeBeanContext
Instances of this class encapsulate the different ways of specifying a class.
They can be initialized with different variants of class descriptions. The
getTargetClass() method can be used for obtaining a reference
to the wrapped class. Instances are thread-safe and can be shared between
multiple components. New instances are created using the static factory
methods.
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Tests the passed in object for equality. |
java.lang.String |
getClassLoaderName()
Returns the symbolic name of the class loader for resolving the class. |
static ClassDescription |
getInstance(java.lang.Class<?> cls)
Returns an instance for the specified class. |
static ClassDescription |
getInstance(java.lang.String clsName)
Returns an instance for the specified class name that will be resolved using the default class loader. |
static ClassDescription |
getInstance(java.lang.String clsName,
java.lang.String clsLoaderName)
Returns an instance for the specified class name and class loader name. |
java.lang.Class<?> |
getTargetClass(ClassLoaderProvider depProvider)
Returns the target class of this description. |
java.lang.String |
getTargetClassName()
Returns the name of the target class of this description. |
int |
hashCode()
Returns a hash code for this object. |
java.lang.String |
toString()
Returns a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public java.lang.Class<?> getTargetClass(ClassLoaderProvider depProvider)
DependencyProvider is used for resolving the class if
necessary. This implementation will cache the Class
objects when they have been resolved.
depProvider - the dependency provider
InjectionException - if the class cannot be resolvedpublic java.lang.String getTargetClassName()
public java.lang.String getClassLoaderName()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object to compare to
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic static ClassDescription getInstance(java.lang.Class<?> cls)
cls - the target class
public static ClassDescription getInstance(java.lang.String clsName,
java.lang.String clsLoaderName)
clsName - the name of the classclsLoaderName - the symbolic name of the class loader
public static ClassDescription getInstance(java.lang.String clsName)
clsName - the name of the class
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||