A .class Java file parser
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
LICENSE.txt
README.md

README.md

js-javadump is a JavaScript library for reading .class Java files.

How to use?

1) Retrieve your .class file from the web, as usual:

function retrieve(url){
  var request = new XMLHttpRequest();
  request.open("GET", url, false);
  request.overrideMimeType("text/plain; charset=x-user-defined");
  request.send();
  if ( (200 !== request.status) && (0 !== request.status) ){
    throw new Error(request.status + " Retrieving " + url); 
  }
  return request;
};

var filename = "<your .class filename url here>";

var file = retrieve(filename).responseText;

2) Create a JD.Stream object from the retrieved file:

var stream = new JD.Stream(file);

3) Create a JD.ClassFile object from the stream:

var classFile = new JD.ClassFile(stream);

What do you get?

One JD.ClassFile object having all the .class file components according current JSR-202 specification.