Java Doc for CommonClassGenerator.java in  » J2EE » ow2-easybeans » org » ow2 » easybeans » enhancer » 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 » J2EE » ow2 easybeans » org.ow2.easybeans.enhancer 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.ow2.easybeans.enhancer.CommonClassGenerator

All known Subclasses:   org.ow2.easybeans.enhancer.interceptors.EasyBeansInvocationContextGenerator,  org.ow2.easybeans.enhancer.interceptors.InterceptorManagerGenerator,
CommonClassGenerator
abstract public class CommonClassGenerator implements Opcodes(Code)
Class with useful routines for writing a class.
author:
   Florent Benoit


Field Summary
final public static  StringARRAY_OBJECTS
     Define an array of objects.
final public static  StringEASYBEANS_FACTORY
     Factory class (used to make the bean factory available).
final public static  intGENERATED_CLASS_VERSION
     Version used for generated class.
final public static  StringJAVA_LANG_EXCEPTION
     Defines java.lang.Exception class.
final public static  StringJAVA_LANG_OBJECT
     Defines java.lang.Object class.
final public static  StringJAVA_LANG_REFLECT_METHOD
     Define java.lang.reflect.Method.
final public static  StringVOID_METHOD_JAVA_LANG_OBJECT
     Defines a void method with JAVA_LANG_OBJECT as parameter.

Constructor Summary
public  CommonClassGenerator(ClassWriter cw)
     Creates a default class with useful routines for writing a class.

Method Summary
protected  voidaddAttribute(int access, String name, String desc)
     Adds an attribute in the current classwriter.
Parameters:
  access - the field's access flags (see Opcodes).
protected  voidaddAttribute(int access, String name, String desc, Object value)
     Adds an attribute in the current classwriter.
Parameters:
  access - the field's access flags (see Opcodes).
public static  voidaddFieldGettersSetters(ClassVisitor cv, String beanClassName, String fieldName, Class clazz)
     Adds a field with its getters/setters.
public static  voidaddFieldGettersSetters(ClassVisitor cv, String beanClassName, String fieldName, String className)
     Adds a field with its getters/setters.
public static  voidaddNullGetter(ClassVisitor cv, String getterName, Class clazz)
     Adds a getter for a given fieldName.
public static  voidaddReturnType(Type type, MethodVisitor mv)
     Adds a return entry depending of the type value.
public static  StringencodeArrayClassDesc(String className)
     Encodes an internal classname into an array descriptor.
public static  StringencodeClassDesc(String className)
     Encodes an internal classname into a descriptor.
public  ClassWritergetCW()
    
public static  intputFieldLoadOpCode(int sortCode)
     Sends the OpCode used in an constructor to set the field.
public static  voidreturnsObject(Type returnType, MethodVisitor mv)
     Returns the object by casting it or return null if method is of void type.
public static  voidtransformObjectIntoPrimitive(Type type, MethodVisitor mv)
     If a type is one of the object type with something which could be linked to a primitive type, cast object into primitive.
public static  voidtransformPrimitiveIntoObject(Type type, MethodVisitor mv)
     If a type is one of the primitive object : boolean, int, long, etc, adds an instruction to transform type into an object.
public static  voidvisitClassType(Type type, MethodVisitor mv)
     Allow to access to a class.
ie, for int.class it will access to Integer.TYPE.
For objects, it only calls the Object.

Field Detail
ARRAY_OBJECTS
final public static String ARRAY_OBJECTS(Code)
Define an array of objects.



EASYBEANS_FACTORY
final public static String EASYBEANS_FACTORY(Code)
Factory class (used to make the bean factory available).



GENERATED_CLASS_VERSION
final public static int GENERATED_CLASS_VERSION(Code)
Version used for generated class.



JAVA_LANG_EXCEPTION
final public static String JAVA_LANG_EXCEPTION(Code)
Defines java.lang.Exception class.



JAVA_LANG_OBJECT
final public static String JAVA_LANG_OBJECT(Code)
Defines java.lang.Object class.



JAVA_LANG_REFLECT_METHOD
final public static String JAVA_LANG_REFLECT_METHOD(Code)
Define java.lang.reflect.Method.



VOID_METHOD_JAVA_LANG_OBJECT
final public static String VOID_METHOD_JAVA_LANG_OBJECT(Code)
Defines a void method with JAVA_LANG_OBJECT as parameter.




Constructor Detail
CommonClassGenerator
public CommonClassGenerator(ClassWriter cw)(Code)
Creates a default class with useful routines for writing a class.
Parameters:
  cw - the class writer which will generate the class




Method Detail
addAttribute
protected void addAttribute(int access, String name, String desc)(Code)
Adds an attribute in the current classwriter.
Parameters:
  access - the field's access flags (see Opcodes). Thisparameter also indicates if the field is synthetic and/ordeprecated.
Parameters:
  name - the field's name.
Parameters:
  desc - the field's descriptor (see Type Type).



addAttribute
protected void addAttribute(int access, String name, String desc, Object value)(Code)
Adds an attribute in the current classwriter.
Parameters:
  access - the field's access flags (see Opcodes). Thisparameter also indicates if the field is synthetic and/ordeprecated.
Parameters:
  name - the field's name.
Parameters:
  desc - the field's descriptor (see Type Type).
Parameters:
  value - the field's initial value. This parameter, which may benull if the field does not have an initial value, mustbe an Integer, a Float, a Long, aDouble or a String (for int,float, long or String fieldsrespectively). This parameter is only used for static fields.Its value is ignored for non static fields, which must beinitialized through bytecode instructions in constructors ormethods.



addFieldGettersSetters
public static void addFieldGettersSetters(ClassVisitor cv, String beanClassName, String fieldName, Class clazz)(Code)
Adds a field with its getters/setters.
Parameters:
  cv - the classvisitor to add field/methods
Parameters:
  beanClassName - the name of the bean's class
Parameters:
  fieldName - the name of the attribute
Parameters:
  clazz - the class of the attribute.



addFieldGettersSetters
public static void addFieldGettersSetters(ClassVisitor cv, String beanClassName, String fieldName, String className)(Code)
Adds a field with its getters/setters.
Parameters:
  cv - the classvisitor to add field/methods
Parameters:
  beanClassName - the name of the bean's class
Parameters:
  fieldName - the name of the attribute
Parameters:
  className - the className of the attribute.



addNullGetter
public static void addNullGetter(ClassVisitor cv, String getterName, Class clazz)(Code)
Adds a getter for a given fieldName. If the fieldName is null, it's return null.
Parameters:
  cv - the classvisitor to add the method
Parameters:
  getterName - the name of the method
Parameters:
  clazz - the class of the returned object.



addReturnType
public static void addReturnType(Type type, MethodVisitor mv)(Code)
Adds a return entry depending of the type value. ie, for int : mv.visitInsn(IRETURN); for void : mv.visitInsn(RETURN);
Parameters:
  type - the object that need to be processed
Parameters:
  mv - the method visitor on which there is a need to adds an instruction



encodeArrayClassDesc
public static String encodeArrayClassDesc(String className)(Code)
Encodes an internal classname into an array descriptor.
Parameters:
  className - internal class name desc for the given className (array mode)



encodeClassDesc
public static String encodeClassDesc(String className)(Code)
Encodes an internal classname into a descriptor.
Parameters:
  className - internal class name desc for the given className



getCW
public ClassWriter getCW()(Code)
the class writer used by this generator



putFieldLoadOpCode
public static int putFieldLoadOpCode(int sortCode)(Code)
Sends the OpCode used in an constructor to set the field.
Parameters:
  sortCode - type of attribute to set op code



returnsObject
public static void returnsObject(Type returnType, MethodVisitor mv)(Code)
Returns the object by casting it or return null if method is of void type.
Parameters:
  returnType - the kind of return for this method.
Parameters:
  mv - object on which we add the instruction.



transformObjectIntoPrimitive
public static void transformObjectIntoPrimitive(Type type, MethodVisitor mv)(Code)
If a type is one of the object type with something which could be linked to a primitive type, cast object into primitive. ie : from Integer to int by calling ((Integer) object).intValue();
Parameters:
  type - the object that need to be processed
Parameters:
  mv - the method visitor on which there is a need to adds an instruction



transformPrimitiveIntoObject
public static void transformPrimitiveIntoObject(Type type, MethodVisitor mv)(Code)
If a type is one of the primitive object : boolean, int, long, etc, adds an instruction to transform type into an object. ie : from int to Integer by calling Integer.valueOf(i);
Parameters:
  type - the object that need to be processed
Parameters:
  mv - the method visitor on which there is a need to adds an instruction



visitClassType
public static void visitClassType(Type type, MethodVisitor mv)(Code)
Allow to access to a class.
ie, for int.class it will access to Integer.TYPE.
For objects, it only calls the Object.
Parameters:
  type - the type of the object from which we want the class
Parameters:
  mv - object on which we add the instruction



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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