| java.lang.Object com.tc.asm.ClassAdapter com.tc.aspectwerkz.transform.inlining.weaver.SerialVersionUidVisitor
SerialVersionUidVisitor | public class SerialVersionUidVisitor extends ClassAdapter implements Opcodes(Code) | | See http://java.sun.com/j2se/1.5.0/docs/guide/serialization/spec/class.html#60
The SerialVersionUidVisitor lookups for the serial ver uid and compute it when not found.
See Add and Compute subclasses.
Initial implementation courtesy of Vishal Vishnoi
author: Alexandre Vasseur |
Inner Class :abstract static class Item implements Comparable | |
Inner Class :static class FieldItem extends Item | |
Inner Class :static class MethodItem extends Item | |
Method Summary | |
public static long | calculateSerialVersionUID(Class klass) | protected long | computeSVUID() Returns the value of SVUID if the class doesn't have one already. | protected boolean | mayNeedSerialVersionUid(int access) | public void | visit(int version, int access, String name, String signature, String superName, String[] interfaces) Visit class header and getDefault class name, access , and interfaces information
(step 1,2, and 3) for SVUID computation. | public void | visitEnd() | public FieldVisitor | visitField(int access, String name, String desc, String signature, Object value) Gets class field information for step 4 of the alogrithm. | public MethodVisitor | visitMethod(int access, String name, String desc, String signature, String[] exceptions) Visit the methods and getDefault constructor and method information (step
5 and 7). | protected void | writeItems(Collection itemCollection, DataOutputStream dos, boolean dotted) |
m_SVUID | protected long m_SVUID(Code) | | The SVUID value (valid at the end of the visit only ie the one that was present or the computed one)
|
m_access | protected int m_access(Code) | | Classes access flag
|
m_className | protected String m_className(Code) | | Internal name of the class
|
m_computeSVUID | protected boolean m_computeSVUID(Code) | | flag that indicates if we need to compute SVUID (no need for interfaces)
|
m_hadSVUID | protected boolean m_hadSVUID(Code) | | Set to true if the class already has SVUID
|
m_hasStaticInitializer | protected boolean m_hasStaticInitializer(Code) | | Set to true if the class has static initializer
|
m_interfaces | protected String[] m_interfaces(Code) | | Interfaces implemented by the class
|
m_svuidConstructors | protected Collection m_svuidConstructors(Code) | | Collection of non private constructors.
|
m_svuidFields | protected Collection m_svuidFields(Code) | | Collection of fields. (except private static
and private transient fields)
|
m_svuidMethods | protected Collection m_svuidMethods(Code) | | Collection of non private method
|
calculateSerialVersionUID | public static long calculateSerialVersionUID(Class klass)(Code) | | helper method (test purpose)
Parameters: klass - |
computeSVUID | protected long computeSVUID() throws IOException, NoSuchAlgorithmException(Code) | | Returns the value of SVUID if the class doesn't have one already. Please
note that 0 is returned if the class already has SVUID, thus use
isHasSVUID to determine if the class already had an SVUID.
Returns the serila version UID |
mayNeedSerialVersionUid | protected boolean mayNeedSerialVersionUid(int access)(Code) | | |
visit | public void visit(int version, int access, String name, String signature, String superName, String[] interfaces)(Code) | | Visit class header and getDefault class name, access , and interfaces information
(step 1,2, and 3) for SVUID computation.
|
visitEnd | public void visitEnd()(Code) | | Add the SVUID if class doesn't have one
|
visitField | public FieldVisitor visitField(int access, String name, String desc, String signature, Object value)(Code) | | Gets class field information for step 4 of the alogrithm. Also determines
if the class already has a SVUID.
|
visitMethod | public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)(Code) | | Visit the methods and getDefault constructor and method information (step
5 and 7). Also determince if there is a class initializer (step 6).
|
writeItems | protected void writeItems(Collection itemCollection, DataOutputStream dos, boolean dotted) throws IOException(Code) | | Sorts the items in the collection and writes it to the data output stream
Parameters: itemCollection - collection of items Parameters: dos - a DataOutputStream value Parameters: dotted - a boolean value throws: IOException - if an error occurs |
Methods inherited from com.tc.asm.ClassAdapter | public void visit(int version, int access, String name, String signature, String superName, String[] interfaces)(Code)(Java Doc) public AnnotationVisitor visitAnnotation(String desc, boolean visible)(Code)(Java Doc) public void visitAttribute(Attribute attr)(Code)(Java Doc) public void visitEnd()(Code)(Java Doc) public FieldVisitor visitField(int access, String name, String desc, String signature, Object value)(Code)(Java Doc) public void visitInnerClass(String name, String outerName, String innerName, int access)(Code)(Java Doc) public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions)(Code)(Java Doc) public void visitOuterClass(String owner, String name, String desc)(Code)(Java Doc) public void visitSource(String source, String debug)(Code)(Java Doc)
|
|
|