|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.tapestry5.ioc.internal.services.ClassFactoryImpl
public class ClassFactoryImpl
Implementation of ClassFactory
.
Constructor Summary | |
---|---|
ClassFactoryImpl()
|
|
ClassFactoryImpl(ClassLoader classLoader)
|
|
ClassFactoryImpl(ClassLoader classLoader,
ClassFactoryClassPool pool,
CtClassSource classSource,
org.slf4j.Logger logger)
|
|
ClassFactoryImpl(ClassLoader classLoader,
ClassFactoryClassPool pool,
org.slf4j.Logger logger)
Special constructor used when the class pool is provided externally. |
|
ClassFactoryImpl(ClassLoader classLoader,
org.slf4j.Logger log)
Main constructor where a specific class loader and log is provided. |
Method Summary | ||
---|---|---|
|
createProxy(Class<T> proxyInterface,
Class<? extends T> delegateClass,
ObjectCreator delegateCreator,
String description)
Creates a proxy for an interface. |
|
|
createProxy(Class<T> proxyInterface,
ObjectCreator delegateCreator,
String description)
Creates a proxy for an interface. |
|
ClassLoader |
getClassLoader()
Returns the class loader used when creating new classes; this is generally the same as the current thread's context class loader (except perhaps during testing). |
|
Location |
getConstructorLocation(Constructor constructor)
Return a string representation for the constructor (including class and parameters) and (if available) file name and line number. |
|
int |
getCreatedClassCount()
Returns the number of classes (and interfaces) actually created. |
|
Location |
getMethodLocation(Method method)
Converts a method to a Location , which includes information about the source file name and line number. |
|
Class |
importClass(Class clazz)
Imports the class to make it referenceable within the factory. |
|
ClassFab |
newClass(Class serviceInterface)
Simplified version of ClassFactory.newClass(String, Class) that generates a name based on the service interface name,
extends from java.lang.Object, and automatically adds the serviceInterface to the returned ClassFab. |
|
ClassFab |
newClass(String name,
Class superClass)
Creates a ClassFab object for the given name; the new class is a subclass of the indicated class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ClassFactoryImpl(ClassLoader classLoader)
public ClassFactoryImpl()
public ClassFactoryImpl(ClassLoader classLoader, org.slf4j.Logger log)
public ClassFactoryImpl(ClassLoader classLoader, ClassFactoryClassPool pool, org.slf4j.Logger logger)
public ClassFactoryImpl(ClassLoader classLoader, ClassFactoryClassPool pool, CtClassSource classSource, org.slf4j.Logger logger)
Method Detail |
---|
public ClassFab newClass(Class serviceInterface)
ClassFactory
ClassFactory.newClass(String, Class)
that generates a name based on the service interface name,
extends from java.lang.Object, and automatically adds the serviceInterface to the returned ClassFab. This is the
most common use when creating the kinds of proxies used throughout Tapestry IoC.
newClass
in interface ClassFactory
public ClassFab newClass(String name, Class superClass)
ClassFactory
ClassFab
object for the given name; the new class is a subclass of the indicated class. The new
class is always public and concrete.
newClass
in interface ClassFactory
name
- the full qualified name of the class to create (note that it is common to place created classes
in the default package)superClass
- the parent class, which is often java.lang.Objectpublic Class importClass(Class clazz)
ClassFactory
importClass
in interface ClassFactory
public int getCreatedClassCount()
ClassFactory
getCreatedClassCount
in interface ClassFactory
public ClassLoader getClassLoader()
ClassFactory
getClassLoader
in interface ClassFactory
public Location getMethodLocation(Method method)
ClassFactory
Location
, which includes information about the source file name and line number.
getMethodLocation
in interface ClassFactory
method
- to look up
public Location getConstructorLocation(Constructor constructor)
ClassFactory
getConstructorLocation
in interface ClassFactory
public <T> T createProxy(Class<T> proxyInterface, ObjectCreator delegateCreator, String description)
ClassFactory
ObjectCreator
(which is accessed on each method invocation, so it
is responsible for caching of the true delegate). The description will be used for the toString() method
(unless toString() is part of the proxy interface).
createProxy
in interface ClassFactory
T
- type of proxyproxyInterface
- proxy interface classdelegateCreator
- creates the delegatedescription
- used for the toString() methodpublic <T> T createProxy(Class<T> proxyInterface, Class<? extends T> delegateClass, ObjectCreator delegateCreator, String description)
ClassFactory
ObjectCreator
(which is accessed on each method invocation, so it
is responsible for caching of the true delegate). The description will be used for the toString() method
(unless toString() is part of the proxy interface).
createProxy
in interface ClassFactory
T
- type of proxyproxyInterface
- proxy interface classdelegateClass
- delegate classdelegateCreator
- creates the delegatedescription
- used for the toString() method
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |