org.intermine.metadata.Model.addProblem()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(129)

本文整理了Java中org.intermine.metadata.Model.addProblem()方法的一些代码示例,展示了Model.addProblem()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Model.addProblem()方法的具体详情如下:
包路径:org.intermine.metadata.Model
类名称:Model
方法名:addProblem

Model.addProblem介绍

[英]Add a problem to the model that doesn't prevent it from being created for backwards compatibility but should be checked when creating a new model.
[中]向模型添加一个问题,该问题不会阻止为向后兼容而创建模型,但在创建新模型时应进行检查。

代码示例

代码示例来源:origin: org.intermine/intermine-model

private void configureReferenceDescriptors() throws MetaDataException {
  // ReferenceDescriptors need to find a ClassDescriptor for their referenced class
  for (ReferenceDescriptor rfd : refDescriptors) {
    try {
      rfd.findReferencedDescriptor();
    } catch (NonFatalMetaDataException e) {
      model.addProblem(e.getMessage());
    }
  }
  // CollectionDescriptors need to find a ClassDescriptor for their referenced class
  for (CollectionDescriptor cod : colDescriptors) {
    try {
      cod.findReferencedDescriptor();
    } catch (NonFatalMetaDataException e) {
      model.addProblem(e.getMessage());
    }
  }
}

代码示例来源:origin: intermine/intermine

private void configureReferenceDescriptors() throws MetaDataException {
  // ReferenceDescriptors need to find a ClassDescriptor for their referenced class
  for (ReferenceDescriptor rfd : refDescriptors) {
    try {
      rfd.findReferencedDescriptor();
    } catch (NonFatalMetaDataException e) {
      model.addProblem(e.getMessage());
    }
  }
  // CollectionDescriptors need to find a ClassDescriptor for their referenced class
  for (CollectionDescriptor cod : colDescriptors) {
    try {
      cod.findReferencedDescriptor();
    } catch (NonFatalMetaDataException e) {
      model.addProblem(e.getMessage());
    }
  }
}

相关文章