|
||||||||||
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.AbstractFab org.apache.tapestry5.ioc.internal.services.ClassFabImpl
public class ClassFabImpl
Implementation of ClassFab
. Hides, as much as possible, the underlying
library (Javassist).
Field Summary |
---|
Fields inherited from class org.apache.tapestry5.ioc.internal.services.AbstractFab |
---|
lock |
Constructor Summary | |
---|---|
ClassFabImpl(CtClassSource source,
javassist.CtClass ctClass,
org.slf4j.Logger logger)
|
Method Summary | |
---|---|
void |
addConstructor(Class[] parameterTypes,
Class[] exceptions,
String body)
Adds a constructor to the class. |
void |
addField(String name,
Class type)
Adds a new field with the given name and type. |
void |
addField(String name,
int modifiers,
Class type)
Adds a new field with the provided modifiers. |
void |
addMethod(int modifiers,
MethodSignature ms,
String body)
Adds a method. |
void |
addNoOpMethod(MethodSignature signature)
Adds a public no-op method. |
void |
addToString(String toString)
Adds an implementation of toString, as a method that returns a fixed string. |
void |
copyClassAnnotationsFromDelegate(Class delegateClass)
Copies annotations from delegate class to the fabricated class. |
void |
copyMethodAnnotationsFromDelegate(Class serviceInterface,
Class delegateClass)
Copies method annotations from delegate class to the methods of the fabricated class. |
void |
proxyMethodsToDelegate(Class serviceInterface,
String delegateExpression,
String toString)
Makes the fabricated class implement the provided service interface. |
String |
toString()
Returns a representation of the fabricated class, including inheritance, fields, constructors, methods and method bodies. |
Methods inherited from class org.apache.tapestry5.ioc.internal.services.AbstractFab |
---|
addInterface, createClass, getCtClass, getLogger, getSource, toCtClass, toCtClasses |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.tapestry5.ioc.services.ClassFab |
---|
addInterface, createClass |
Constructor Detail |
---|
public ClassFabImpl(CtClassSource source, javassist.CtClass ctClass, org.slf4j.Logger logger)
Method Detail |
---|
public String toString()
toString
in class Object
public void addField(String name, Class type)
ClassFab
addField
in interface ClassFab
public void addField(String name, int modifiers, Class type)
ClassFab
addField
in interface ClassFab
public void proxyMethodsToDelegate(Class serviceInterface, String delegateExpression, String toString)
ClassFab
proxyMethodsToDelegate
in interface ClassFab
serviceInterface
- the interface to implementdelegateExpression
- the expression used to find the delegate on which methods should be invoked. Typically
a field name, such as "_delegate", or a method to invoke, such as "_service()".toString
- fixed value to be returned as the description of the resultant objectpublic void addToString(String toString)
ClassFab
addToString
in interface ClassFab
public void addMethod(int modifiers, MethodSignature ms, String body)
ClassFab
addMethod
in interface ClassFab
modifiers
- Modifiers for the method (see Modifier
).ms
- defines the name, return type, parameters and exceptions thrownbody
- The body of the method.public void addNoOpMethod(MethodSignature signature)
ClassFab
addNoOpMethod
in interface ClassFab
public void addConstructor(Class[] parameterTypes, Class[] exceptions, String body)
ClassFab
addConstructor
in interface ClassFab
parameterTypes
- the type of each parameter, or null if the constructor takes no parameters.exceptions
- the type of each exception, or null if the constructor throws no exceptions.body
- The body of the constructor.public void copyClassAnnotationsFromDelegate(Class delegateClass)
ClassFab
copyClassAnnotationsFromDelegate
in interface ClassFab
delegateClass
- class of the delegatepublic void copyMethodAnnotationsFromDelegate(Class serviceInterface, Class delegateClass)
ClassFab
copyMethodAnnotationsFromDelegate
in interface ClassFab
serviceInterface
- service interfacedelegateClass
- class of the delegate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |