Package com.chemspider.www

Examples of com.chemspider.www.ExtendedCompoundInfo


    // Get security token.
    final String token = parameters.getParameter(
        ChemSpiderParameters.SECURITY_TOKEN).getValue();

    // Fetch compound info.
    ExtendedCompoundInfo info = null;
    try {
      info = massSpec.getExtendedCompoundInfo(Integer.valueOf(ID), token);
    } catch (final RemoteException e) {

      // We need to catch exceptions here - usually from deprecated
      // structures in the ChemSpider database or
      // invalid security token.
      LOG.log(Level.WARNING, "Failed to fetch compound info for CSID #"
          + ID, e);
    }

    // Determine name and formula.
    final String name;
    final String formula;
    if (info != null) {

      // Use returned info.
      final String commonName = info.getCommonName();
      name = commonName == null ? UNKNOWN_NAME : commonName;
      formula = FORMULA_PATTERN.matcher(info.getMF()).replaceAll("");

    } else {

      // An error occurred.
      name = ERROR_MESSAGE;
View Full Code Here

TOP

Related Classes of com.chemspider.www.ExtendedCompoundInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.