private static boolean hasSerializingMethods ( JavaClass cls ) { Method [ ] methods = cls . getMethods ( ) ; for ( Method m : methods ) { if ( ! m . isStatic ( ) ) { String methodName = m . getName ( ) ; String methodSig = m . getSignature ( ) ; if ( "writeObject" . equals ( methodName ) && SIG_OBJECT_OUTPUT_STREAM_TO_VOID . equals ( methodSig ) ) { return true ; } if ( "writeExternal" . equals ( methodName ) && SIG_OBJECT_OUTPUT_TO_VOID . equals ( methodSig ) ) { return true ; } } } return false ; }
looks to see if this class implements method described by Serializable or Externalizable