private static boolean isSerializable ( JavaClass cls ) throws ClassNotFoundException { JavaClass [ ] infs = cls . getAllInterfaces ( ) ; for ( JavaClass inf : infs ) { String clsName = inf . getClassName ( ) ; if ( "java.io.Serializable" . equals ( clsName ) || "java.io.Externalizable" . equals ( clsName ) ) { return true ; } } return false ; }
returns if the class implements Serializable or Externalizable