当前位置: 首页>>代码示例>>Java>>正文


Java FitsIdentity类代码示例

本文整理汇总了Java中edu.harvard.hul.ois.fits.identity.FitsIdentity的典型用法代码示例。如果您正苦于以下问题:Java FitsIdentity类的具体用法?Java FitsIdentity怎么用?Java FitsIdentity使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FitsIdentity类属于edu.harvard.hul.ois.fits.identity包,在下文中一共展示了FitsIdentity类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: build

import edu.harvard.hul.ois.fits.identity.FitsIdentity; //导入依赖的package包/类
/**
 * Creates an object <code>FileFormat</code> based upon output returned by FITS.
 * 
 * @return file format
 */
public FileFormat build() {
    List<FitsIdentity> identities = fitsOutput.getIdentities();
    if (identities == null || identities.size() == 0) {
        return null;
    }
    FileFormat fileFormat = new FileFormat();
    fileFormat.setFileType(new FileTypeBuilder(fitsOutput).build());
    fileFormat.setMimeType(identities.get(0).getMimetype());
    List<FormatVersion> formatVersions = identities.get(0).getFormatVersions();
    if (formatVersions != null && formatVersions.size() > 0) {
        Collections.sort(formatVersions, new FitsFormatVersionComparator());
        fileFormat.setFormatVersion(formatVersions.get(0).getValue());
    }
    fileFormat.setPuid(getPuidFromIdentity(identities.get(0)));
    String firstPuid = fileFormat.getPuid();
    Set<String> formatNames = new HashSet<String>();
    for (FitsIdentity identity : identities) {
        if (fileFormat.getPuid() == null && identity.getMimetype() != null
                && identity.getMimetype().equals(fileFormat.getMimeType())) {
            fileFormat.setPuid(getPuidFromIdentity(identity));
        }
        if (identity.getMimetype() != null && identity.getMimetype().equals(fileFormat.getMimeType())) {
            formatNames.add(identity.getFormat());
        }
        if (firstPuid == null) {
            firstPuid = getPuidFromIdentity(identity);
        }
    }
    fileFormat.setNames(formatNames);
    if (fileFormat.getPuid() == null) {
        fileFormat.setPuid(firstPuid);
    }
    return fileFormat;
}
 
开发者ID:psnc-dl,项目名称:darceo,代码行数:40,代码来源:FileFormatBuilder.java

示例2: getPuidFromIdentity

import edu.harvard.hul.ois.fits.identity.FitsIdentity; //导入依赖的package包/类
/**
 * Gets PUID from FITS identity section.
 * 
 * @param identity
 *            FITS identity section
 * @return PUID or null
 */
private String getPuidFromIdentity(FitsIdentity identity) {
    List<ExternalIdentifier> externalIdentifiers = identity.getExternalIdentifiers();
    if (externalIdentifiers != null && externalIdentifiers.size() > 0) {
        Collections.sort(externalIdentifiers, new FitsExternalIdentifierComparator());
        ExternalIdentifier externalIdentifier = externalIdentifiers.get(0);
        if (externalIdentifier.getName().equals("puid")) {
            return externalIdentifier.getValue();
        }
    }
    return null;
}
 
开发者ID:psnc-dl,项目名称:darceo,代码行数:19,代码来源:FileFormatBuilder.java

示例3: indexFitsIdentities

import edu.harvard.hul.ois.fits.identity.FitsIdentity; //导入依赖的package包/类
private void indexFitsIdentities(FitsOutput fitsOutput, SolrInputDocument solrDoc) {
    for (FitsIdentity fitsIdentity : fitsOutput.getIdentities()) {
        solrDoc.addField("format", fitsIdentity.getFormat());
    }
}
 
开发者ID:little9,项目名称:SolrFits,代码行数:6,代码来源:FitsExaminer.java


注:本文中的edu.harvard.hul.ois.fits.identity.FitsIdentity类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。