本文整理了Java中pl.edu.icm.model.bwmeta.y.YElement.getAffiliation()
方法的一些代码示例,展示了YElement.getAffiliation()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YElement.getAffiliation()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YElement
类名称:YElement
方法名:getAffiliation
暂无
代码示例来源:origin: pl.edu.icm.synat/synat-sdk-sample-services
StringBuilder affiliationList = new StringBuilder();
for (String affId : contributor.getAffiliationRefs()) {
YAffiliation yAffiliation = element.getAffiliation(affId);
if (yAffiliation != null) {
String affText = yAffiliation.getSimpleText();
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
public static YAffiliation getOrCreateAffiliation(YElement element, String id) {
YAffiliation affiliation = element.getAffiliation(id);
if (affiliation == null) {
affiliation = new YAffiliation().setId(id);
element.addAffiliation(affiliation);
}
return affiliation;
}
代码示例来源:origin: pl.edu.icm.yadda/yaddaweb-lite-core
protected List<ViewAffiliation> resolveAffiliations(final YContributor contributor, final YElement element,
final IFilteringContext filteringContext) {
final List<ViewAffiliation> result = new LinkedList<ViewAffiliation>();
for (final String ref : contributor.getAffiliationRefs()) {
final YAffiliation aff = element.getAffiliation(ref);
if (aff != null) {
String text = aff.getSimpleText();
if (text == null || text.length() == 0) {
text = aff.getOneAttributeSimpleValue(YConstants.AT_AFFILIATION_TEXT);
text = text != null ? text : "";
}
result.add(new ViewAffiliation(detailsFilter.filter(text, InputType.PLAIN_TEXT, filteringContext),
detailsFilter.filter(aff.getIdentity(), InputType.IDENTIFIER, filteringContext)));
}
}
return result;
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
private static void putAuthor(YElement element, String author, List<String> refs) {
author = author.replaceAll(" +\\.", ".");
YName name = new YName().setType(YConstants.NM_CANONICAL).setText(author);
YContributor contributor = new YContributor().setRole(YConstants.CR_AUTHOR).addName(name);
for (String ref : refs) {
if (ref.equals("*") || ref.equals("†")) {
// Currently nothing is done
} else {
String id = Enhancers.affiliationIdFromIndex(ref);
if (element.getAffiliation(id) != null) {
contributor.addAffiliationRef(id);
}
}
}
element.addContributor(contributor);
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-content
private List<DocAuthor> authorsFromYElement(final YElement element) {
final List<DocAuthor> authors = new ArrayList<DocAuthor>();
for (final YContributor contributor : element.getContributors()) {
final YName fullName = contributor.getDefaultName();
if (fullName == null) {
continue;
}
// TODO: check if parsed correctly
DocAuthor author = authorParser.parse(fullName.getText());
if (author == null) {
author = new DocAuthor(null, fullName.getText());
}
final List<DocAffiliation> affs = new ArrayList<DocAffiliation>();
for (final String affiliationRef : contributor.getAffiliationRefs()) {
final YAffiliation affiliation = element.getAffiliation(affiliationRef);
if (affiliation == null) {
continue;
}
final DocAffiliation aff = affiliationParser.parse(affiliation.getSimpleText());
if (aff != null) {
affs.add(aff);
}
}
if (!affs.isEmpty()) {
author.setAffiliations(affs);
}
authors.add(author);
}
return authors;
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
String affiliationRef = getAffiliationRef(affiliation);
contributor.getAffiliationRefs().add(affiliationRef);
if (element.getAffiliation(affiliationRef) == null) {
YAffiliation yAffiliation = new YAffiliation(affiliationRef, affiliation);
element.addAffiliation(yAffiliation);
内容来源于网络,如有侵权,请联系作者删除!