it.imolinfo.jbi4corba.webservice.generator.bcm
Class IdlToWsdlAdapter

java.lang.Object
  extended by org.objectweb.asm.ClassAdapter
      extended by it.imolinfo.jbi4corba.webservice.generator.bcm.IdlToWsdlAdapter
All Implemented Interfaces:
org.objectweb.asm.ClassVisitor

public class IdlToWsdlAdapter
extends org.objectweb.asm.ClassAdapter

bytecode manipulation. For each Object visited we modify the bytecode as following: 1) for each public or protected member we add the getter and setter method. 2) if the class is 'abstract' we remove this keyword. 3) we add/modify a default constructor where we istantiate the array (if the class contains one or more array) to avoid NullPointerException. 4) We add the jaxb Annotations


Field Summary
protected  String className
           
protected  org.objectweb.asm.ClassWriter classWriter
           
static String FIELD_ACCESS_TYPE
           
static String JAXB_XML_ACCESS_TYPE
           
static String JAXB_XML_ACCESSOR_TYPE
           
static String JAXB_XML_ELEMENT
           
protected  Map<String,String> mapOfFields
           
static String NONE_ACCESS_TYPE
           
static String PROPERTY_ACCESS_TYPE
           
 
Fields inherited from class org.objectweb.asm.ClassAdapter
cv
 
Constructor Summary
IdlToWsdlAdapter(org.objectweb.asm.ClassVisitor cv, org.objectweb.asm.ClassWriter cw, String cn, Map<String,UnionType> allUnTypes, Map<String,String> fUnTypes, Map<String,InterfaceType> allInTypes, Map<String,String> fIntTypes, boolean isEx, boolean excludeType)
          The adapater used to manipulate the code.
 
Method Summary
 void visit(int version, int access, String name, String signature, String superName, String[] interfaces)
          Override.
 void visitEnd()
          XXX javadoc.
 org.objectweb.asm.FieldVisitor visitField(int access, String name, String desc, String signature, Object value)
           
 org.objectweb.asm.MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)
          Override.
 
Methods inherited from class org.objectweb.asm.ClassAdapter
visitAnnotation, visitAttribute, visitInnerClass, visitOuterClass, visitSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAXB_XML_ACCESSOR_TYPE

public static final String JAXB_XML_ACCESSOR_TYPE
See Also:
Constant Field Values

JAXB_XML_ACCESS_TYPE

public static final String JAXB_XML_ACCESS_TYPE
See Also:
Constant Field Values

JAXB_XML_ELEMENT

public static final String JAXB_XML_ELEMENT
See Also:
Constant Field Values

PROPERTY_ACCESS_TYPE

public static final String PROPERTY_ACCESS_TYPE
See Also:
Constant Field Values

NONE_ACCESS_TYPE

public static final String NONE_ACCESS_TYPE
See Also:
Constant Field Values

FIELD_ACCESS_TYPE

public static final String FIELD_ACCESS_TYPE
See Also:
Constant Field Values

className

protected String className

classWriter

protected org.objectweb.asm.ClassWriter classWriter

mapOfFields

protected Map<String,String> mapOfFields
Constructor Detail

IdlToWsdlAdapter

public IdlToWsdlAdapter(org.objectweb.asm.ClassVisitor cv,
                        org.objectweb.asm.ClassWriter cw,
                        String cn,
                        Map<String,UnionType> allUnTypes,
                        Map<String,String> fUnTypes,
                        Map<String,InterfaceType> allInTypes,
                        Map<String,String> fIntTypes,
                        boolean isEx,
                        boolean excludeType)
The adapater used to manipulate the code.

Parameters:
cv - The ClassVisitor used in this object.
cw - The ClassWriter used in this object.
cn - The class name to manipulate.
Method Detail

visit

public void visit(int version,
                  int access,
                  String name,
                  String signature,
                  String superName,
                  String[] interfaces)
Override.

Specified by:
visit in interface org.objectweb.asm.ClassVisitor
Overrides:
visit in class org.objectweb.asm.ClassAdapter
Parameters:
version - The method visitor
access - The access
name - The name
signature - The signature
superName - The super name
interfaces - The interfaces

visitMethod

public org.objectweb.asm.MethodVisitor visitMethod(int access,
                                                   String name,
                                                   String desc,
                                                   String signature,
                                                   String[] exceptions)
Override.

Specified by:
visitMethod in interface org.objectweb.asm.ClassVisitor
Overrides:
visitMethod in class org.objectweb.asm.ClassAdapter
Parameters:
access - The access
name - The name
desc - The description
signature - The signature
exceptions - The exceptions
Returns:
The return

visitField

public org.objectweb.asm.FieldVisitor visitField(int access,
                                                 String name,
                                                 String desc,
                                                 String signature,
                                                 Object value)
Specified by:
visitField in interface org.objectweb.asm.ClassVisitor
Overrides:
visitField in class org.objectweb.asm.ClassAdapter
Parameters:
access - the field's access flags (see Opcodes). This parameter also indicates if the field is synthetic and/or deprecated.
name - the field's name.
desc - the field's descriptor (see Type).
signature - the field's signature. May be null if the field's type does not use generic types.
value - the field's initial value. This parameter, whitweakIdlToWsdlClassesch may be null if the field does not have an initial value, must be an Integer, a Float, a Long, a Double or a String (for int, float, long or String fields respectively). This parameter is only used for static fields. Its value is IGNORED for non static fields, which must be initialized through bytecode instructions in constructors or methods.
Returns:
a visitor to visit field annotations and attributes, or null if this class visitor is not interested in visiting these annotations and attributes.

visitEnd

public void visitEnd()
XXX javadoc.

Specified by:
visitEnd in interface org.objectweb.asm.ClassVisitor
Overrides:
visitEnd in class org.objectweb.asm.ClassAdapter


Copyright © 2005-2010 Imola Informatica. All Rights Reserved.