Example usage for java.lang IllegalArgumentException getMessage

List of usage examples for java.lang IllegalArgumentException getMessage

Introduction

In this page you can find the example usage for java.lang IllegalArgumentException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message string of this throwable.

Usage

From source file:com.genentech.chemistry.openEye.apps.SDFTorsionScanner.java

private void run(String inFile, String outFile, String coreFile) throws IOException {

    oemolothread outputOEThread = new oemolothread(outFile);
    oemolithread inputOEThread = new oemolithread(inFile);

    OEGraphMol mol = new OEGraphMol();

    Integer nMolIndex = 0;//from   w w  w . ja  va 2s .co m

    try {
        // Read each molecule in input
        while (oechem.OEReadMolecule(inputOEThread, mol)) {
            int nTotalConformers = 0;

            setMolIndex(mol, nMolIndex);

            //
            // Generate conformers
            OEMCMolBase torsionConformers = torsionScanner.run(mol);
            nTotalConformers = torsionConformers.NumConfs();

            //
            // Write out conformers
            oechem.OEWriteMolecule(outputOEThread, torsionConformers);

            // Cleanup
            torsionConformers.delete();

            System.err.println(torsionScanner.getSteps() + " conformers generated at "
                    + torsionScanner.getTorIncr() + " degree increments.");
            if (torsionScanner.getMaxConfsPerStep() > 1 && !torsionScanner.doMinimize()) {
                System.err.println("Expanded to " + Integer.toString(nTotalConformers) + " total conformers.");
            }
            nMolIndex++;
        }

        System.err.println(nMolIndex.toString() + " molecule(s) read from input file.");

        if (coreFile != null)
            torsionScanner.computeCore(coreFile);

        mol.delete();
    } catch (IllegalArgumentException iaEx) {
        System.err.println("Problem computing core file: " + iaEx.getMessage());
    } catch (Exception e) {
        System.err.println(e.getMessage());
    } finally {
        torsionScanner.close();
        inputOEThread.close();
        inputOEThread.delete();
        outputOEThread.close();
        outputOEThread.delete();
    }
}

From source file:jp.primecloud.auto.zabbix.client.HostgroupClientTest.java

@Test
@Ignore//w ww .j  av a  2s.c  o m
public void testDelete() {
    // groupid??????
    try {
        client.hostgroup().delete(null);
    } catch (IllegalArgumentException ignore) {
        log.trace(ignore.getMessage());
    }
}

From source file:jp.primecloud.auto.zabbix.client.HostgroupClientTest.java

@Test
@Ignore/*from   w  ww. j  a  v a 2 s . c  o  m*/
public void testCreate() {
    // name??????
    HostgroupCreateParam param = new HostgroupCreateParam();
    try {
        client.hostgroup().create(param);
        fail();
    } catch (IllegalArgumentException ignore) {
        log.trace(ignore.getMessage());
    }
}

From source file:org.inbio.ait.web.ajax.controller.TaxonomyAutoCompleteController.java

/**
  * Method to get the 10 first kingdoms that match with the autocomplete query
  * @param request/*  w ww .  j a  v  a 2  s. com*/
  * @param response
  * @return
  * @throws java.lang.Exception
  */
public ModelAndView kingdom(HttpServletRequest request, HttpServletResponse response) throws Exception {

    String param = request.getParameter(queryParam);
    String errorMsj = "No se puede obtener la lista para: " + param + ".";
    List<AutocompleteNode> acnList = new ArrayList<AutocompleteNode>();

    try {
        acnList = taxonomyManager.getElementsByTaxonomicalRange(param, TaxonomicalRange.KINGDOM.getId());
        return writeReponse(request, response, acnList);

    } catch (IllegalArgumentException iae) {
        throw new Exception(errorMsj + " " + iae.getMessage());
    }
}

From source file:org.inbio.ait.web.ajax.controller.TaxonomyAutoCompleteController.java

/**
 * Method to get the 10 first phylums that match with the autocomplete query
 * @param request/*  w  w w  .j a  v a  2 s.c o  m*/
 * @param response
 * @return
 * @throws java.lang.Exception
 */
public ModelAndView phylum(HttpServletRequest request, HttpServletResponse response) throws Exception {

    String param = request.getParameter(queryParam);
    String errorMsj = "No se puede obtener la lista para: " + param + ".";
    List<AutocompleteNode> acnList = new ArrayList<AutocompleteNode>();

    try {
        acnList = taxonomyManager.getElementsByTaxonomicalRange(param, TaxonomicalRange.PHYLUM.getId());
        return writeReponse(request, response, acnList);

    } catch (IllegalArgumentException iae) {
        throw new Exception(errorMsj + " " + iae.getMessage());
    }
}

From source file:org.inbio.ait.web.ajax.controller.TaxonomyAutoCompleteController.java

/**
 * Method to get the 10 first classes that match with the autocomplete query
 * @param request//from ww  w . ja  v a2 s  . c o  m
 * @param response
 * @return
 * @throws java.lang.Exception
 */
public ModelAndView class1(HttpServletRequest request, HttpServletResponse response) throws Exception {

    String param = request.getParameter(queryParam);
    String errorMsj = "No se puede obtener la lista para: " + param + ".";
    List<AutocompleteNode> acnList = new ArrayList<AutocompleteNode>();

    try {
        acnList = taxonomyManager.getElementsByTaxonomicalRange(param, TaxonomicalRange.CLASS.getId());
        return writeReponse(request, response, acnList);

    } catch (IllegalArgumentException iae) {
        throw new Exception(errorMsj + " " + iae.getMessage());
    }
}

From source file:org.inbio.ait.web.ajax.controller.TaxonomyAutoCompleteController.java

/**
 * Method to get the 10 first orders that match with the autocomplete query
 * @param request//w  w  w .ja  v a  2s  .co  m
 * @param response
 * @return
 * @throws java.lang.Exception
 */
public ModelAndView order(HttpServletRequest request, HttpServletResponse response) throws Exception {

    String param = request.getParameter(queryParam);
    String errorMsj = "No se puede obtener la lista para: " + param + ".";
    List<AutocompleteNode> acnList = new ArrayList<AutocompleteNode>();

    try {
        acnList = taxonomyManager.getElementsByTaxonomicalRange(param, TaxonomicalRange.ORDER.getId());
        return writeReponse(request, response, acnList);

    } catch (IllegalArgumentException iae) {
        throw new Exception(errorMsj + " " + iae.getMessage());
    }
}

From source file:org.inbio.ait.web.ajax.controller.TaxonomyAutoCompleteController.java

/**
 * Method to get the 10 first families that match with the autocomplete query
 * @param request//from ww  w . ja v a  2  s  . co  m
 * @param response
 * @return
 * @throws java.lang.Exception
 */
public ModelAndView family(HttpServletRequest request, HttpServletResponse response) throws Exception {

    String param = request.getParameter(queryParam);
    String errorMsj = "No se puede obtener la lista para: " + param + ".";
    List<AutocompleteNode> acnList = new ArrayList<AutocompleteNode>();

    try {
        acnList = taxonomyManager.getElementsByTaxonomicalRange(param, TaxonomicalRange.FAMILY.getId());
        return writeReponse(request, response, acnList);

    } catch (IllegalArgumentException iae) {
        throw new Exception(errorMsj + " " + iae.getMessage());
    }
}

From source file:org.inbio.ait.web.ajax.controller.TaxonomyAutoCompleteController.java

/**
 * Method to get the 10 first genus that match with the autocomplete query
 * @param request//from w  ww .  j  a  v a 2 s  . c o m
 * @param response
 * @return
 * @throws java.lang.Exception
 */
public ModelAndView genus(HttpServletRequest request, HttpServletResponse response) throws Exception {

    String param = request.getParameter(queryParam);
    String errorMsj = "No se puede obtener la lista para: " + param + ".";
    List<AutocompleteNode> acnList = new ArrayList<AutocompleteNode>();

    try {
        acnList = taxonomyManager.getElementsByTaxonomicalRange(param, TaxonomicalRange.GENUS.getId());
        return writeReponse(request, response, acnList);

    } catch (IllegalArgumentException iae) {
        throw new Exception(errorMsj + " " + iae.getMessage());
    }
}

From source file:org.inbio.ait.web.ajax.controller.TaxonomyAutoCompleteController.java

/**
 * Method to get the 10 first scientificnames that match with the autocomplete query
 * @param request//from ww w .  ja va 2s. co m
 * @param response
 * @return
 * @throws java.lang.Exception
 */
public ModelAndView scientificname(HttpServletRequest request, HttpServletResponse response) throws Exception {

    String param = request.getParameter(queryParam);
    String errorMsj = "No se puede obtener la lista para: " + param + ".";
    List<AutocompleteNode> acnList = new ArrayList<AutocompleteNode>();

    try {
        acnList = taxonomyManager.getElementsByTaxonomicalRange(param, TaxonomicalRange.SCIENTIFICNAME.getId());
        return writeReponse(request, response, acnList);

    } catch (IllegalArgumentException iae) {
        throw new Exception(errorMsj + " " + iae.getMessage());
    }
}