de.undercouch.citeproc.zotero.ZoteroItemDataProvider类的使用及代码示例

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

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

ZoteroItemDataProvider介绍

[英]A item data provider that translates Zotero IDs to human-readable citations IDs
[中]将Zotero ID转换为人类可读的引用ID的项目数据提供程序

代码示例

代码示例来源:origin: de.undercouch/citeproc-java

/**
 * Creates a data provider that copies items from the given provider
 * but replaces item IDs with human-readable IDs
 * @param provider the provider to copy the items from
 */
public ZoteroItemDataProvider(ItemDataProvider provider) {
  super(sanitizeItems(provider));
}

代码示例来源:origin: michel-kraemer/citeproc-java

@Override
protected ItemDataProvider createItemDataProvider(CSLItemData[] itemData) {
  return new ZoteroItemDataProvider(super.createItemDataProvider(itemData));
}

代码示例来源:origin: michel-kraemer/citeproc-java

String newId = makeId(item, dateParser);
newId = uniquify(newId, knownIds);
knownIds.add(newId);

代码示例来源:origin: michel-kraemer/citeproc-java

int year = getYear(item.getIssued(), dateParser);
if (year < 0) {
  year = getYear(item.getContainer(), dateParser);
  if (year < 0) {
    year = getYear(item.getOriginalDate(), dateParser);
    if (year < 0) {
      year = getYear(item.getEventDate(), dateParser);
      if (year < 0) {
        year = getYear(item.getSubmitted(), dateParser);

代码示例来源:origin: de.undercouch/citeproc-java

String newId = makeId(item, dateParser);
newId = uniquify(newId, knownIds);
knownIds.add(newId);

代码示例来源:origin: de.undercouch/citeproc-java

int year = getYear(item.getIssued(), dateParser);
if (year < 0) {
  year = getYear(item.getContainer(), dateParser);
  if (year < 0) {
    year = getYear(item.getOriginalDate(), dateParser);
    if (year < 0) {
      year = getYear(item.getEventDate(), dateParser);
      if (year < 0) {
        year = getYear(item.getSubmitted(), dateParser);

代码示例来源:origin: de.undercouch/citeproc-java

/**
   * Retrieves the year from a {@link CSLDate} object. Parses the raw
   * string if necessary.
   * @param date the date object
   * @param dateParser a date parser
   * @return the year or -1 if the year could not be retrieved
   */
  private static int getYear(CSLDate date, CSLDateParser dateParser) {
    if (date == null) {
      return -1;
    }
    if (date.getDateParts() == null ||
        date.getDateParts().length == 0 ||
        date.getDateParts()[0] == null ||
        date.getDateParts()[0].length == 0) {
      if (date.getRaw() != null && !date.getRaw().isEmpty()) {
        CSLDate d = dateParser.parse(date.getRaw());
        return getYear(d, dateParser);
      }
      return -1;
    }
    return date.getDateParts()[0][0];
  }
}

代码示例来源:origin: michel-kraemer/citeproc-java

/**
 * Creates a data provider that copies items from the given provider
 * but replaces item IDs with human-readable IDs
 * @param provider the provider to copy the items from
 */
public ZoteroItemDataProvider(ItemDataProvider provider) {
  super(sanitizeItems(provider));
}

代码示例来源:origin: michel-kraemer/citeproc-java

/**
   * Retrieves the year from a {@link CSLDate} object. Parses the raw
   * string if necessary.
   * @param date the date object
   * @param dateParser a date parser
   * @return the year or -1 if the year could not be retrieved
   */
  private static int getYear(CSLDate date, CSLDateParser dateParser) {
    if (date == null) {
      return -1;
    }
    if (date.getDateParts() == null ||
        date.getDateParts().length == 0 ||
        date.getDateParts()[0] == null ||
        date.getDateParts()[0].length == 0) {
      if (date.getRaw() != null && !date.getRaw().isEmpty()) {
        CSLDate d = dateParser.parse(date.getRaw());
        return getYear(d, dateParser);
      }
      return -1;
    }
    return date.getDateParts()[0][0];
  }
}

相关文章