本文整理了Java中pl.edu.icm.synat.logic.model.utils.YModelUtils.getType()
方法的一些代码示例,展示了YModelUtils.getType()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YModelUtils.getType()
方法的具体详情如下:
包路径:pl.edu.icm.synat.logic.model.utils.YModelUtils
类名称:YModelUtils
方法名:getType
暂无
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
private boolean hasLevel(YElement element, String requiredLevel) {
String type = YModelUtils.getType(element);
return StringUtils.equalsIgnoreCase(type, requiredLevel);
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
private boolean isLowestLevelResponse(DataResponse response) {
String currentLevel = YModelUtils.getType(response.getyElement());
switch (currentLevel) {
case HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ARTICLE:
case HierarchyWithLevelIds.EXT_LEVEL_BOOK_CHAPTER:
return true;
default:
return false;
}
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
private boolean isPackageElementLevelResponse(DataResponse response) {
String currentLevel = YModelUtils.getType(response.getyElement());
switch (currentLevel) {
case HierarchyWithLevelIds.EXT_LEVEL_BOOK_PART:
return true;
default:
return false;
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
String trimmed = normalized.replaceAll("[^a-zA-Z0-9]", "");
String lowercase = trimmed.toLowerCase();
String level = YModelUtils.getType(element);
StringBuffer id = new StringBuffer();
switch (level) {
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
@Override
public void parseMetadata(YElement element, PublicationMeta pm, YLanguage defaultLanguage, List<YElement> ancestors) {
for (IdParser converter : converters) {
element.getIds().addAll(converter.parseIds(pm));
}
String generatedId = generateId(element);
if (StringUtils.isBlank(generatedId)) {
throw new SkipElementException("Cannot generate id for element type: " + YModelUtils.getType(element));
}
if (StringUtils.startsWith(generatedId, WileyComponentConstants.EXT_WILEY_PREFIX_ELEMENT)) {
element.setId(generatedId);
return;
}
final StringBuffer id = new StringBuffer();
if (ancestors != null && !ancestors.isEmpty()) {
YElement lastAncestor = ancestors.get(ancestors.size() - 1);
id.append(lastAncestor.getId()).append("-");
} else {
id.append((WileyComponentConstants.EXT_WILEY_PREFIX_ELEMENT));
}
id.append(generatedId);
element.setId(id.toString());
}
代码示例来源:origin: pl.edu.icm.synat/synat-importer-direct
@Override
public Iterable<DataResponse> feedFromCurrentElement() {
NativeDocument document = state.getCurrentDocument();
if(document == null){
return Collections.emptyList();
}
String objectClass = document.getTagValue(RepositoryStoreConstants.TAG_NAME_OBJECT_CLASS);
if(!BWMetaImporterConstants.SOURCE_FORMAT.equals(objectClass)){
return Collections.emptyList();
}
String levelToImport = getLevelToImport(document);
Attachment<?> sourceAttachment = document.getAttachments().get(CommonExtractorContstants.SOURCE_ATTRIBUTE);
if (sourceAttachment == null) {
warn("No source attachment.", document.getId());
return Collections.emptyList();
}
InputStream inputStream = getStream(sourceAttachment);
List<YElement> elements = builder.build(new InputStreamResource(inputStream, "Record id: " + document.getId()));
Stream<YElement> elementsStream = elements.stream();
if (StringUtils.isNotBlank(levelToImport)) {
elementsStream = elementsStream.filter(e -> StringUtils.equals(YModelUtils.getType(e), levelToImport));
}
return elementsStream.map(e -> toDataResponse(e, document)).collect(Collectors.toList());
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
result.setType(ResourceDataConstants.MAP_TYPE_TO_CURRENT.inverse().get(YModelUtils.getType(yElement)));
result.setHierarchy(extractHierarchy(yElement));
result.setThumbnailPath(yModelPropertyExtractor.extractThumbnailPath(yElement));
内容来源于网络,如有侵权,请联系作者删除!