pl.edu.icm.model.bwmeta.y.YElement.getDate()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(92)

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

YElement.getDate介绍

暂无

代码示例

代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct

@Override
public void parseMetadata(YElement element, PublicationMeta pm, YLanguage defaultLanguage, List<YElement> ancestors) {
  element.getDates().addAll(getDates(pm.getEventGroup()));
  for (YElement ancestor : ancestors) {
    for (YDate date : ancestor.getDates()) {
      if (element.getDate(date.getType()) == null) {
        element.addDate(date);
      }
    }
  }
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

protected void convertDate(YElement yElement, BibEntry bibEntry) {
  YDate date = yElement.getDate(YConstants.DT_PUBLISHED);
  if (date != null) {
    if (bibEntry.getFirstFieldValue(BibEntry.FIELD_YEAR) == null) {
      bibEntry.setField(BibEntry.FIELD_YEAR, String.valueOf(date.getYear()));
    }
    bibEntry.setField(BibEntry.FIELD_MONTH, String.valueOf(date.getMonth()));
    date.getYear();
  }
}

代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct

@Override
protected void postProcessELements(List<YElement> elements) {
  Optional<YElement> chapterElement = getElementByPredicate(elements, this::hasChapterLevel);
  Optional<YElement> bookElement = getElementByPredicate(elements, this::hasBookLevel);
  if (chapterElement.isPresent() && bookElement.isPresent()) {
    for(YDate date:chapterElement.get().getDates()){
      if(bookElement.get().getDate(date.getType()) == null){
        bookElement.get().addDate(date);
      }
    }
  }
}

代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers

public void updateArticleInBookWithBookMeta(Element bmeta, final YElement article) {
  
  YDate date = article.getDate(DateTypes.DT_PUBLISHED);
  if (date == null) {
    updater.updateElementPubdate(bmeta, article);
  }
  
  boolean noPublisher = true;
  List<YContributor> yContributorList  = article.getContributors();
  List<YContributor> yPublisherList = new ArrayList<YContributor>();
   for (YContributor yContributor : yContributorList) {
     if (yContributor.getRole().equals(ContributorRoles.CR_PUBLISHER)) {
       yPublisherList.add(yContributor);
     }
   }
   if (!yPublisherList.isEmpty()) {
     String publisher = yPublisherList.get(0).getOneName(NameTypes.NM_CANONICAL).getText();
     String location = yPublisherList.get(0).getOneAttributeSimpleValue(NlmToYConstants.AT_PUBLISHER_LOCATION);
     if (publisher != null && location != null) {
       noPublisher = false;
     }
   }
   if (noPublisher) {
     updater.updateElementPublisher(bmeta, article);
   }
}

代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core

private void addPublicationDate(CSLItemDataBuilder builder, ElementAncestors<YElement> elemAncest) {
  YDate publishedDate = elemAncest.getElement().getDate(YConstants.DT_PUBLISHED);
  CSLDateBuilder dateBuilder = new CSLDateBuilder();
  if (publishedDate != null && (publishedDate.getYear() != 0)) {
    addDateFromYElem(publishedDate, dateBuilder);
  } else {
    addDateFromJournalYearAncest(elemAncest, dateBuilder);
  }
  builder.issued(dateBuilder.build());
}

代码示例来源:origin: pl.edu.icm.yadda/yadda-content

if (yElement.getDate(YConstants.DT_PUBLISHED) != null) {
  docMetadata.setYear(Integer.toString(yElement.getDate(YConstants.DT_PUBLISHED).getYear()));

代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl

if (yElement.getDate(YConstants.DT_PUBLISHED) != null) {
  docMetadata.setYear(Integer.toString(yElement.getDate(YConstants.DT_PUBLISHED).getYear()));

相关文章