コード例 #1
0
  /**
   * @param toolkitId the id of the toolkit
   * @return the {@link ToolkitDescriptor} of the toolkit with the given id.
   */
  public static ToolkitDescriptor getToolkitDescriptor(String toolkitId)
      throws ToolkitPluginException {

    if (toolkitId == null) {
      final String msg = Messages.ToolkitNameIsNull + StringConstants.EXCLAMATION_MARK;
      log.error(msg);
      throwToolkitPluginException(msg, null);
    }
    for (ToolkitDescriptor descr : toolkitProvider.keySet()) {
      if (toolkitId.equals(descr.getToolkitID())) {
        return descr;
      }
    }
    final String msg =
        Messages.NoToolkitPluginDescriptorFound
            + StringConstants.COLON
            + StringConstants.SPACE
            + String.valueOf(toolkitId);
    log.error(msg);
    throwToolkitPluginException(msg, null);
    return null;
  }