本文整理汇总了Java中com.sun.syndication.feed.synd.SyndPerson类的典型用法代码示例。如果您正苦于以下问题:Java SyndPerson类的具体用法?Java SyndPerson怎么用?Java SyndPerson使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SyndPerson类属于com.sun.syndication.feed.synd包,在下文中一共展示了SyndPerson类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAuthors
import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public List getAuthors() {
List<SyndPerson> authors = super.getAuthors();
List<SyndPerson> result = new ArrayList<SyndPerson>(authors.size());
for (SyndPerson p : authors) {
SyndPerson pp = new SyndPersonImpl();
if (p != null) {
pp.setEmail(removeInvalidChars(p.getEmail()));
pp.setName(removeInvalidChars(p.getName()));
pp.setModules(p.getModules());
pp.setUri(removeInvalidChars(p.getUri()));
}
result.add(pp);
}
return result;
}
示例2: getContributors
import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public List getContributors() {
List<SyndPerson> contributors = super.getContributors();
ArrayList<SyndPerson> result = new ArrayList<SyndPerson>();
for (SyndPerson p : contributors) {
SyndPersonImpl pp = new SyndPersonImpl();
if (p != null) {
pp.setEmail(removeInvalidChars(p.getEmail()));
pp.setUri(removeInvalidChars(p.getUri()));
pp.setName(removeInvalidChars(p.getName()));
pp.setModules(p.getModules());
}
result.add(pp);
}
return result;
}
示例3: createRealFeed
import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
@Override
protected WireFeed createRealFeed(String type, SyndFeed syndFeed) {
Channel channel = (Channel) super.createRealFeed(type, syndFeed);
channel.setLanguage(syndFeed.getLanguage()); //c
channel.setCopyright(syndFeed.getCopyright()); //c
channel.setPubDate(syndFeed.getPublishedDate()); //c
if ((syndFeed.getAuthors() != null) && (syndFeed.getAuthors()
.size() > 0)) {
SyndPerson author = (SyndPerson) syndFeed.getAuthors()
.get(0);
channel.setManagingEditor(author.getName());
}
return channel;
}
示例4: getAuthors
import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
/**
* Returns a list of authors for feed or entry.
*
* @param authors
* @return
*/
private static ArrayList<BasicDBObject> getAuthors(
ArrayList<SyndPerson> authors) {
ArrayList<BasicDBObject> authorsDB = new ArrayList<BasicDBObject>();
for (SyndPerson author : authors) {
BasicDBObject authorDB = new BasicDBObject();
if (author.getName() != null)
authorDB.append("name", author.getName());
if (author.getUri() != null)
authorDB.append("uri", author.getUri());
if (author.getName() != null || author.getUri() != null)
authorsDB.add(authorDB);
}
return authorsDB;
}
示例5: buildStringList
import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
private List<String> buildStringList(List<?> lstConvert) {
List<String> lstRC = new ArrayList<String>();
if (lstConvert.isEmpty()) {
return lstRC;
}
for (Object objX : lstConvert) {
if (objX instanceof SyndPerson) {
lstRC.add(((SyndPerson) objX).getName());
} else if (objX instanceof SyndContentImpl) {
lstRC.add(((SyndContentImpl) objX).getValue());
} else if (objX instanceof SyndCategoryImpl) {
lstRC.add(((SyndCategoryImpl) objX).getName());
} else {
lstRC.add(objX.toString());
}
}
return lstRC;
}
示例6: setAuthors
import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
@Override
public void setAuthors(List<String> authors) {
if ((authors == null) || (authors.size() == 0)) {
syndEntry.setAuthor(null);
} else if ((authors.size() > 1) && "atom_1.0".equals(getRssFormat())) {
// Only Atom 1.0 in Rome supports multiple item authors
List<SyndPerson> syndPersons = new ArrayList<SyndPerson>();
for (Iterator<String> iterator = authors.iterator(); iterator.hasNext(); ) {
String author = iterator.next();
SyndPerson syndPerson = new SyndPersonImpl();
syndPerson.setName(author);
syndPersons.add(syndPerson);
}
syndEntry.setAuthors(syndPersons);
} else {
if (authors.size() > 1) {
log.warn("Rome does not support multiple item authors. Using the first author.");
}
syndEntry.setAuthor(authors.get(0));
}
}
示例7: setAuthors
import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
@Override
public void setAuthors(List<String> authors) {
if ((authors == null) || (authors.size() == 0)) {
syndFeed.setAuthor(null);
} else if ((authors.size() > 1) && "atom_1.0".equals(getRssFormat())) {
// Only Atom 1.0 in Rome supports multiple channel authors
List<SyndPerson> syndPersons = new ArrayList<SyndPerson>();
for (Iterator<String> iterator = authors.iterator(); iterator.hasNext(); ) {
String author = iterator.next();
SyndPerson syndPerson = new SyndPersonImpl();
syndPerson.setName(author);
syndPersons.add(syndPerson);
}
syndFeed.setAuthors(syndPersons);
} else {
if (authors.size() > 1) {
log.warn("Rome does not support multiple channel authors. Using the first author.");
}
syndFeed.setAuthor(authors.get(0));
}
}
示例8: createRealFeed
import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
Channel channel = (Channel) super.createRealFeed(type,syndFeed);
channel.setLanguage(syndFeed.getLanguage()); //c
channel.setCopyright(syndFeed.getCopyright()); //c
channel.setPubDate(syndFeed.getPublishedDate()); //c
if (syndFeed.getAuthors()!=null && syndFeed.getAuthors().size() > 0) {
SyndPerson author = (SyndPerson)syndFeed.getAuthors().get(0);
channel.setManagingEditor(author.getName());
}
return channel;
}
示例9: createAtomPersons
import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
protected static List createAtomPersons(List sPersons) {
List persons = new ArrayList();
for (Iterator iter = sPersons.iterator(); iter.hasNext(); ) {
SyndPerson sPerson = (SyndPerson)iter.next();
Person person = new Person();
person.setName(sPerson.getName());
person.setUri(sPerson.getUri());
person.setEmail(sPerson.getEmail());
persons.add(person);
}
return persons;
}
示例10: createSyndPersons
import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
protected static List createSyndPersons(List aPersons) {
List persons = new ArrayList();
for (Iterator iter = aPersons.iterator(); iter.hasNext(); ) {
Person aPerson = (Person)iter.next();
SyndPerson person = new SyndPersonImpl();
person.setName(aPerson.getName());
person.setUri(aPerson.getUri());
person.setEmail(aPerson.getEmail());
persons.add(person);
}
return persons;
}
示例11: makeEntryFromRSSCorrespon
import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
/**
* コレポンからRSSのエントリー(それぞれのItem)を作成.
*/
private SyndEntry makeEntryFromRSSCorrespon(
RSSCorrespon c, String baseURL) {
if (log.isDebugEnabled()) {
log.debug("id[{}]", c.getId());
}
SyndEntry entry = new ExtendedSyndEntryImpl();
// title設定
entry.setTitle(c.getSubject());
// description設定
entry.setDescription(makeDescriptionFromRSSCorrespon(c, baseURL));
// link(とguid)設定
entry.setLink(baseURL + "correspon/correspon.jsf?id=" + c.getId()
+ "&projectId=" + c.getProjectId());
// author設定
SyndPerson author = new SyndPersonImpl();
author.setEmail(c.getProjectId() + " : " + c.getProjectNameE());
List<SyndPerson> authors = new ArrayList<SyndPerson>();
authors.add(author);
entry.setAuthors(authors);
// category設定
SyndCategory category = new SyndCategoryImpl();
category.setName(c.getCategory().getLabel());
List<SyndCategory> categories = new ArrayList<SyndCategory>();
categories.add(category);
entry.setCategories(categories);
// pubDate(とdc:date)設定
entry.setPublishedDate(c.getUpdatedAt());
return entry;
}
示例12: createAtomPersons
import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
protected static List createAtomPersons(List sPersons) {
List persons = new ArrayList();
for (Iterator iter = sPersons.iterator(); iter.hasNext(); ) {
SyndPerson sPerson = (SyndPerson)iter.next();
Person person = new Person();
person.setName(sPerson.getName());
person.setUri(sPerson.getUri());
person.setEmail(sPerson.getEmail());
person.setModules(sPerson.getModules());
persons.add(person);
}
return persons;
}
示例13: createSyndPersons
import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
protected static List createSyndPersons(List aPersons) {
List persons = new ArrayList();
for (Iterator iter = aPersons.iterator(); iter.hasNext(); ) {
Person aPerson = (Person)iter.next();
SyndPerson person = new SyndPersonImpl();
person.setName(aPerson.getName());
person.setUri(aPerson.getUri());
person.setEmail(aPerson.getEmail());
person.setModules(aPerson.getModules());
persons.add(person);
}
return persons;
}
示例14: feedUpdate
import com.sun.syndication.feed.synd.SyndPerson; //导入依赖的package包/类
/**
* Updates feed information such as accessed time and other attributes
* pertaining feed/channel.
*
* @param feedDB
* @param feed
*/
@SuppressWarnings("unchecked")
private void feedUpdate(DBObject feedDB, SyndFeed feed) {
// this field is for RSS Delegate worker to check for stalled threads or
// threads that crashed and were not able to update used filed back to 0
feedDB.put("accessedAt", new Date());
/******** REQUIRED channel elements as defined in RSS 2.0 Specification ********/
// http://cyber.law.harvard.edu/rss/rss.html#
// even though this elements are required by specification we
// cannot trust the source
if (feed.getTitle() != null)
feedDB.put("title", feed.getTitle());
if (feed.getLink() != null)
feedDB.put("link", feed.getLink());
if (feed.getDescription() != null)
feedDB.put("description", feed.getDescription());
/******** OPTIONAL channel elements as defined in RSS 2.0 Specification ********/
if (feed.getLanguage() != null)
feedDB.put("language", feed.getLanguage());
if (feed.getCopyright() != null)
feedDB.put("copyright", feed.getCopyright());
// no specific get method for managing editor and web master in rome
// library. Using authors instead
if (feed.getAuthors() != null && feed.getAuthors().size() > 0) {
ArrayList<BasicDBObject> authors = getAuthors((ArrayList<SyndPerson>) feed
.getAuthors());
feedDB.put("authors", authors);
}
if (feed.getPublishedDate() != null)
feedDB.put("pubDate", feed.getPublishedDate());
// last build date does not exist in rome library
if (feed.getCategories() != null && feed.getCategories().size() > 0) {
ArrayList<BasicDBObject> categories = getCategories((ArrayList<SyndCategory>) feed
.getCategories());
feedDB.put("category", categories);
}
// generator does not exist in rome library
// docs does not exist in rome library
// cloud does not exist in rome library
// ttl does not exist in rome library
SyndImage feedImage = feed.getImage();
if (feedImage != null) {
BasicDBObject imageDB = new BasicDBObject();
if (feedImage.getUrl() != null)
imageDB.append("url", feedImage.getUrl());
if (feedImage.getTitle() != null)
imageDB.append("title", feedImage.getTitle());
if (feedImage.getLink() != null)
imageDB.append("link", feedImage.getLink());
if (feedImage.getDescription() != null)
imageDB.append("description", feedImage.getDescription());
if (feedImage.getUrl() != null || feedImage.getTitle() != null
|| feedImage.getLink() != null
|| feedImage.getDescription() != null)
feedDB.put("image", imageDB);
// width does not exist in rome library
// height does not exist in rome library
}
// rating does not exist in rome library
// text input does not exist in rome library
// skip hours does not exist in rome library
// skip days does not exist in rome library
rssColl.update(new BasicDBObject("feedUrl", feedDB.get("feedUrl")),
feedDB);
}