Java Doc for ClassFab.java in  » Web-Framework » Tapestry » org » apache » tapestry » ioc » services » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » Tapestry » org.apache.tapestry.ioc.services 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.tapestry.ioc.services.ClassFab

All known Subclasses:   org.apache.tapestry.ioc.internal.services.ClassFabImpl,
ClassFab
public interface ClassFab (Code)
Used when fabricating a new class. Represents a wrapper around the Javassist library.

The core concept of Javassist is how method bodies (as well as constructor bodies, etc.) are specified ... as a very Java-like scripting language. Details are available at the Javassist home page.

Method bodies look largely like Java. References to java classes must be fully qualified. Several special variables are used:

  • $0 first parameter, equivalent to this in Java code (and can't be used when creating a static method)
  • $1, $2, ... actual parameters to the method
  • $args all the parameters as an Object[]
  • $r the return type of the method, typically used as return ($r) .... $r is valid with method that return void. This also handles conversions between wrapper types and primitive types.
  • $w conversion from primitive type to wrapper type, used as ($w) foo() where foo() returns a primitive type and a wrapper type is needed

ClassFab instances are not thread safe.

ClassFab instances are created by a org.apache.tapestry.ioc.services.ClassFactory .





Method Summary
 voidaddConstructor(Class[] parameterTypes, Class[] exceptions, String body)
     Adds a constructor to the class.
 voidaddField(String name, Class type)
     Adds a new field with the given name and type.
 voidaddField(String name, int modifiers, Class Type)
     Adds a new field with the provided modifiers.
 voidaddInterface(Class interfaceClass)
     Adds the specified interface as an interface implemented by this class.
 voidaddMethod(int modifiers, MethodSignature signature, String body)
     Adds a method.
 voidaddNoOpMethod(MethodSignature signature)
     Adds a public no-op method.
 voidaddToString(String toString)
     Adds an implementation of toString, as a method that returns a fixed string.
 ClasscreateClass()
     Invoked last to create the class.
 voidproxyMethodsToDelegate(Class serviceInterface, String delegateExpression, String toString)
     Makes the fabricated class implement the provided service interface.



Method Detail
addConstructor
void addConstructor(Class[] parameterTypes, Class[] exceptions, String body)(Code)
Adds a constructor to the class. The constructor will be public.
Parameters:
  parameterTypes - the type of each parameter, or null if the constructor takes no parameters.
Parameters:
  exceptions - the type of each exception, or null if the constructor throws no exceptions.
Parameters:
  body - The body of the constructor.



addField
void addField(String name, Class type)(Code)
Adds a new field with the given name and type. The field is added as a private field.



addField
void addField(String name, int modifiers, Class Type)(Code)
Adds a new field with the provided modifiers.



addInterface
void addInterface(Class interfaceClass)(Code)
Adds the specified interface as an interface implemented by this class. It is not an error to invoke this method multiple times with the same interface class (and the interface is only added once).



addMethod
void addMethod(int modifiers, MethodSignature signature, String body)(Code)
Adds a method. The method is a public instance method. a method fabricator, used to add catch handlers.
Parameters:
  modifiers - Modifiers for the method (see java.lang.reflect.Modifier).
Parameters:
  signature - defines the name, return type, parameters and exceptions thrown
Parameters:
  body - The body of the method.
throws:
  RuntimeException - if a method with that signature has already been added, or if there is aJavassist compilation error



addNoOpMethod
void addNoOpMethod(MethodSignature signature)(Code)
Adds a public no-op method. The method will return null, false, or zero as per the return type (if not void).



addToString
void addToString(String toString)(Code)
Adds an implementation of toString, as a method that returns a fixed string.



createClass
Class createClass()(Code)
Invoked last to create the class. This will enforce that all abstract methods have been implemented in the (concrete) class.



proxyMethodsToDelegate
void proxyMethodsToDelegate(Class serviceInterface, String delegateExpression, String toString)(Code)
Makes the fabricated class implement the provided service interface. The interface will be added, and all methods in the interface will be delegate wrappers. If toString() is not part of the delegate interface, then an implementation will be supplied that returns the provided string. This method is used when creating objects that proxy their behavior to some other object.
Parameters:
  serviceInterface - the interface to implement
Parameters:
  delegateExpression - 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()".
Parameters:
  toString - fixed value to be returned as the description of the resultant object



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.