it.imolinfo.jbi4ejb.webservice.generator.bcm
Class SerializableDecorationAdapter

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

public class SerializableDecorationAdapter
extends SerializableInspectorAdapter

This adapter makes a class Serializable and add a serial version UID.


Field Summary
 
Fields inherited from class it.imolinfo.jbi4ejb.webservice.generator.bcm.SerializableInspectorAdapter
FIELDNAME_SERIAL_VERSION_UID, INTERNAL_NAME_OF_SERIALIZABLE
 
Fields inherited from class org.objectweb.asm.ClassAdapter
cv
 
Constructor Summary
SerializableDecorationAdapter(org.objectweb.asm.ClassVisitor cv, java.lang.Long aNewSerialVersionUid)
          SerializableDecorationAdapter Constructor.
 
Method Summary
 void visit(int version, int access, java.lang.String name, java.lang.String signature, java.lang.String superName, java.lang.String[] interfaces)
          Class visitro, adds the java.io.Serializable interface if not already present.
 void visitEnd()
          Adds the 'private final static' access modifier to the serialVersionUID field.
 org.objectweb.asm.FieldVisitor visitField(int access, java.lang.String name, java.lang.String desc, java.lang.String signature, java.lang.Object value)
          Field Visitor.
 
Methods inherited from class it.imolinfo.jbi4ejb.webservice.generator.bcm.SerializableInspectorAdapter
getClassMetaInfo, hasSerialVersionUIDField, implementsSerializable, setClassMetaInfo
 
Methods inherited from class org.objectweb.asm.ClassAdapter
visitAnnotation, visitAttribute, visitInnerClass, visitMethod, visitOuterClass, visitSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SerializableDecorationAdapter

public SerializableDecorationAdapter(org.objectweb.asm.ClassVisitor cv,
                                     java.lang.Long aNewSerialVersionUid)
SerializableDecorationAdapter Constructor.

Parameters:
cv - The class visitor instance.
aNewSerialVersionUid - The serialVersionUID value to add.
Method Detail

visit

public void visit(int version,
                  int access,
                  java.lang.String name,
                  java.lang.String signature,
                  java.lang.String superName,
                  java.lang.String[] interfaces)
Class visitro, adds the java.io.Serializable interface if not already present.

Specified by:
visit in interface org.objectweb.asm.ClassVisitor
Overrides:
visit in class SerializableInspectorAdapter
Parameters:
version - The class version
access - The access modifier
name - The class name
signature - The signature
superName - The superclass name
interfaces - The interfaces implemented

visitField

public org.objectweb.asm.FieldVisitor visitField(int access,
                                                 java.lang.String name,
                                                 java.lang.String desc,
                                                 java.lang.String signature,
                                                 java.lang.Object value)
Field Visitor. Test if the field is a serialVersionUID field and adds the newSerialVersionUid.

Specified by:
visitField in interface org.objectweb.asm.ClassVisitor
Overrides:
visitField in class SerializableInspectorAdapter
Parameters:
access - The access modifier
name - The field name
desc - The field desc
signature - The signature
value - The field value
Returns:
The FieldVisitor

visitEnd

public void visitEnd()
Adds the 'private final static' access modifier to the serialVersionUID field.

Specified by:
visitEnd in interface org.objectweb.asm.ClassVisitor
Overrides:
visitEnd in class org.objectweb.asm.ClassAdapter
See Also:
ClassAdapter.visitEnd()


Copyright © 2007-2008 Imola Informatica. All Rights Reserved.