Add convert method that takes the Java code as a string