本文整理了Java中pl.edu.icm.model.bwmeta.y.YName.getText()
方法的一些代码示例,展示了YName.getText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YName.getText()
方法的具体详情如下:
包路径:pl.edu.icm.model.bwmeta.y.YName
类名称:YName
方法名:getText
暂无
代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core
private String getNameTextFrom(YName name, String fallback){
if(name == null){
return fallback;
} else {
String nameText = name.getText();
if(StringUtils.isBlank(nameText)){
return fallback;
} else {
return nameText;
}
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
@SuppressWarnings("deprecation")
private CharSequence preparePlainName(YElement yElement, YLanguage language) {
YName yName = YModelUtils.getDefaultName(yElement, language);
if (yName != null) {
String name = yName.getText();
return new FilteredString(name.replaceAll("[${}^]", "").replaceAll("\\<.*?\\>", ""));
}
return "";
}
代码示例来源:origin: pl.edu.icm.bwmeta/bwmeta-2-foreign-transformers
protected void fillNames(YElement yElement, List<YExportable> referedElements, Map<String, List<StringWithAttributes>> ret) {
// title element
if (!yElement.getNames().isEmpty()) {
ret.put(E_TITLE, new ArrayList<StringWithAttributes>());
}
for (YName yName : yElement.getNames()) {
ret.get(E_TITLE).add(new StringWithAttributes(yName.getText()));
}
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
/**
* accomplished
*/
private void parseTitle() {
if(in_item.getDefaultName()!=null && in_item.getDefaultName().getText()!=null){
paos_doc.add(new PredicateAndObject(RelConstants.RL_TITLE, in_item.getDefaultName().getText()));
}
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
/**
* accomplished
*/
private void parseTitle() {
if(in_item.getDefaultName()!=null && in_item.getDefaultName().getText()!=null){
paos_doc.add(new PredicateAndObject(RelConstants.RL_TITLE, in_item.getDefaultName().getText()));
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
protected void fillTitles(HtmlMetaHeaders metadata, YElement yElement) {
for (YName yName : yElement.getNames()) {
metadata.addMetadataName(DC_NAMESPACE + SEPARATOR + DublinCoreStrings.E_TITLE, yName.getText());
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-process-common
private void appendAncestorName(YStructure structure, Map<String, String> output, String level) {
YAncestor ancestor = structure.getAncestor(level);
if (ancestor != null && ancestor.getOneName()!=null ) {
final String name = ancestor.getOneName().getText();
if (StringUtils.isNotBlank(name)) {
output.put(level, name);
}
}
}
代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core
private String findNameInLanguage(List<YName> names, YLanguage yLanguage){
for(YName name: names){
if(yLanguage.equals(name.getLanguage()))
return name.getText();
}
return null;
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-business-services-impl
private String extractId(YContentFile yFile) {
YName fileNameCandidate = yFile.getOneName(NameTypes.NM_FILE_NAME);
if (fileNameCandidate == null) {
fileNameCandidate = yFile.getOneName();
}
if (fileNameCandidate == null) {
return yFile.getId();
} else {
return fileNameCandidate.getText();
}
}
代码示例来源:origin: pl.edu.icm.yadda/bwmeta-import
public String generateIdSuffix(AbstractNDA<?>... parts) {
String[] names = new String[parts.length];
for (int i = 0; i < parts.length; i++)
names[i] = (parts[i] == null) ? null : (parts[i].getFirstName() == null) ? null : parts[i].getFirstName().getText();
return generateIdSuffix(names);
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-sdk-sample-services
public void readYElement(String resourceId) {
DocumentRepository repository = DefaultDocumentRepositoryBuilder.buildRepository(store);
Document doc = (Document) repository.fetchDocument(resourceId);
YExportable metadata = doc.getMetadata();
YElement element = (YElement) metadata;
System.out.println(element.getOneName().getText());
}
代码示例来源:origin: pl.edu.icm.yadda.repowebeditor/repository-web-editor-core
private LocalizedString extractLocalizedStringFrom(YName yName){
YRichText text = yName.getRichText();
if(StringUtils.isBlank(yName.getText())){
return null;
} else {
String langCode = languageExtractor.extractLanguageCode(yName.getLanguage());
return new LocalizedString(langCode, YRTHelper.toXmlFragmentWithoutNamespaces(text));
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-business-services-api
private YDate getDateFromYear(final YAncestor ancestor) {
JournalYearExtractor journalYearExtractor = new JournalYearExtractorImpl();
for (final YName yName : ancestor.getNames()) {
Integer parsedYear = journalYearExtractor.parseYear(yName.getText());
if (parsedYear != null) {
return new YDate("hierarchy", parsedYear, 1, 1, "hierarchy");
}
}
return null;
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
private void fillBookTitle(HtmlMetaHeaders headers, YElement yElement) {
YStructure booklStructure = yElement.getStructure(HierarchyWithLevelIds.EXT_HIERARCHY_BOOK);
YAncestor bookAncestor = booklStructure.getAncestor(HierarchyWithLevelIds.EXT_LEVEL_BOOK_BOOK);
if (bookAncestor != null) {
headers.addMetadataName(WP_INBOOK_TITLE, bookAncestor.getOneName().getText());
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
protected void fillVolumeAndIssue(HtmlMetaHeaders metadata, YStructure yJournalStructure) {
YAncestor volumeAncestor = yJournalStructure.getAncestor(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_VOLUME);
YAncestor issueAncestor = yJournalStructure.getAncestor(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_ISSUE);
if (volumeAncestor != null && volumeAncestor.getOneName() != null) {
metadata.addMetadataName(WP_ISSUE, volumeAncestor.getOneName().getText());
}
if (issueAncestor != null && issueAncestor.getOneName() != null) {
metadata.addMetadataName(WP_VOLUME, issueAncestor.getOneName().getText());
}
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
protected void fillJournalTitle(HtmlMetaHeaders metadata, YStructure yJournalStructure) {
YAncestor journalAncestor = yJournalStructure.getAncestor(HierarchyWithLevelIds.EXT_LEVEL_JOURNAL_JOURNAL);
if (journalAncestor != null && journalAncestor.getOneName() != null) {
metadata.addMetadataName(WP_JOURNAL_TITLE, journalAncestor.getOneName().getText());
}
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-client-common-api
private String getContributorLastName(final YContributor cont) {
if (cont.getOneName(YConstants.NM_SURNAME) != null) {
return cont.getOneName(YConstants.NM_SURNAME).getText();
}
final YAttribute person = cont.getOneAttribute(YConstants.AT_CONTRIBUTOR_PERSON);
if (person != null) {
return person.getOneAttributeSimpleValue(YConstants.AT_CONTRIBUTOR_PERSON_LASTNAME);
} else {
return cont.getOneAttributeSimpleValue(YConstants.AT_CONTRIBUTOR_PERSON_LASTNAME);
}
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-client-common-api
public String generateContributorMd5(final YContributor cont) {
final String firstname = getContributorFirstName(cont);
final String surname = getContributorLastName(cont);
final String title = cont.getDefaultName() != null ? cont.getDefaultName().getText() : "";
return generateContributorMd5(title, firstname, surname, detectContributorType(cont));
}
代码示例来源:origin: pl.edu.icm.synat/synat-portal-core
private void updateCommonFromAncestor(PublicationDownload download, YAncestor ancestor) {
download.setDoi(getId(ancestor, IdSchemaIds.EXT_SCHEME_DOI));
download.setIssn(getId(ancestor, IdSchemaIds.EXT_SCHEME_ISSN));
download.setEissn(getId(ancestor, IdSchemaIds.EXT_SCHEME_EISSN));
download.setBwmetaId(ancestor.getIdentity());
download.setName(ancestor.getDefaultName().getText());
}
代码示例来源:origin: pl.edu.icm.yadda/yadda-analysis-impl
public static void updateYRelationWithZblNames(YRelation relye, YElement zblye) {
for (YName n : zblye.getNames()) {
YAttribute ya = new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_NAME, "");
ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_LANGUAGE, n.getLanguage().getName()));
ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_TYPE, n.getType()));
ya.addAttribute(new YAttribute(YConstants.AT_ENHANCED_FROM_ZBL_VALUE, n.getText()));
relye.addAttribute(ya);
}
}
内容来源于网络,如有侵权,请联系作者删除!