Created
June 1, 2010 14:51
-
-
Save egonw/421022 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CDK 1.3.5 | |
import java.io.*; | |
import org.openscience.cdk.io.*; | |
import org.openscience.cdk.Molecule; | |
class ErrorHandler implements IChemObjectReaderErrorHandler { | |
public void handleError(String message) { | |
println message; | |
}; | |
public void handleError(String message, Exception exception) { | |
println message + "\n -> " + exception.getMessage(); | |
}; | |
public void handleError(String message, int row, int colStart, int colEnd) { | |
print "location: " + row + ", " + colStart + "-" + colEnd + ": "; | |
println message; | |
}; | |
public void handleError(String message, int row, int colStart, int colEnd, Exception exception) { | |
print "location: " + row + ", " + colStart + "-" + colEnd + ": "; | |
println message + "\n -> " + exception.getMessage(); | |
}; | |
} | |
reader = new MDLV2000Reader(new FileReader(args[0])) | |
reader.setErrorHandler(new ErrorHandler()); | |
mol = reader.read(new Molecule()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment