Merge pull request #172 from rometools/generics
Updated the major part of ROME to use generics
This commit is contained in:
commit
443b36e466
84 changed files with 608 additions and 599 deletions
2
pom.xml
2
pom.xml
|
@ -85,7 +85,7 @@
|
|||
<dependency>
|
||||
<groupId>org.jdom</groupId>
|
||||
<artifactId>jdom</artifactId>
|
||||
<version>1.1.3</version>
|
||||
<version>2.0.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
|
|
|
@ -26,6 +26,8 @@ import java.util.List;
|
|||
import java.util.ArrayList;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
* Parent class of the RSS (Channel) and Atom (Feed) feed beans.
|
||||
* <p>
|
||||
|
@ -44,7 +46,7 @@ public abstract class WireFeed implements Cloneable, Serializable, Extendable {
|
|||
private String _feedType;
|
||||
private String _encoding;
|
||||
private List<Module> _modules;
|
||||
private List _foreignMarkup;
|
||||
private List<Element> _foreignMarkup;
|
||||
|
||||
/**
|
||||
* Default constructor, for bean cloning purposes only.
|
||||
|
@ -94,7 +96,7 @@ public abstract class WireFeed implements Cloneable, Serializable, Extendable {
|
|||
return false;
|
||||
}
|
||||
// can't use foreign markup in equals, due to JDOM equals impl
|
||||
Object fm = getForeignMarkup();
|
||||
List<Element> fm = getForeignMarkup();
|
||||
setForeignMarkup(((WireFeed)other).getForeignMarkup());
|
||||
boolean ret = _objBean.equals(other);
|
||||
// restore foreign markup
|
||||
|
@ -214,8 +216,8 @@ public abstract class WireFeed implements Cloneable, Serializable, Extendable {
|
|||
* @return Opaque object to discourage use
|
||||
*
|
||||
*/
|
||||
public Object getForeignMarkup() {
|
||||
return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList()) : _foreignMarkup;
|
||||
public List<Element> getForeignMarkup() {
|
||||
return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList<Element>()) : _foreignMarkup;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -224,7 +226,7 @@ public abstract class WireFeed implements Cloneable, Serializable, Extendable {
|
|||
* @param foreignMarkup Opaque object to discourage use
|
||||
*
|
||||
*/
|
||||
public void setForeignMarkup(Object foreignMarkup) {
|
||||
_foreignMarkup = (List)foreignMarkup;
|
||||
public void setForeignMarkup(List<Element> foreignMarkup) {
|
||||
_foreignMarkup = (List<Element>)foreignMarkup;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,18 +16,19 @@
|
|||
*/
|
||||
package com.sun.syndication.feed.atom;
|
||||
|
||||
import com.sun.syndication.feed.impl.ObjectBean;
|
||||
import com.sun.syndication.feed.module.Extendable;
|
||||
import com.sun.syndication.feed.module.Module;
|
||||
import com.sun.syndication.feed.module.impl.ModuleUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.jdom2.Element;
|
||||
|
||||
import com.sun.syndication.feed.impl.ObjectBean;
|
||||
import com.sun.syndication.feed.module.Extendable;
|
||||
import com.sun.syndication.feed.module.Module;
|
||||
import com.sun.syndication.feed.module.impl.ModuleUtils;
|
||||
|
||||
|
||||
/**
|
||||
* Bean for entry elements of Atom feeds.
|
||||
|
@ -47,7 +48,7 @@ public class Entry implements Cloneable, Serializable, Extendable {
|
|||
private List<Category> _categories;
|
||||
private List<Content> _contents;
|
||||
private List<Person> _contributors;
|
||||
private List<Link> _foreignMarkup;
|
||||
private List<Element> _foreignMarkup;
|
||||
private List<Module> _modules;
|
||||
private List<Link> _otherLinks;
|
||||
private ObjectBean _objBean;
|
||||
|
@ -80,7 +81,7 @@ public class Entry implements Cloneable, Serializable, Extendable {
|
|||
* @return a list of Link elements with the entry alternate links, an empty list if none.
|
||||
*/
|
||||
public List<Link> getAlternateLinks() {
|
||||
return (_alternateLinks == null) ? (_alternateLinks = new ArrayList()) : _alternateLinks;
|
||||
return (_alternateLinks == null) ? (_alternateLinks = new ArrayList<Link>()) : _alternateLinks;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -109,7 +110,7 @@ public class Entry implements Cloneable, Serializable, Extendable {
|
|||
* @param categories The categories to set.
|
||||
* @since Atom 1.0
|
||||
*/
|
||||
public void setCategories(List categories) {
|
||||
public void setCategories(List<Category> categories) {
|
||||
_categories = categories;
|
||||
}
|
||||
|
||||
|
@ -119,8 +120,8 @@ public class Entry implements Cloneable, Serializable, Extendable {
|
|||
* @return Returns the categories.
|
||||
* @since Atom 1.0
|
||||
*/
|
||||
public List getCategories() {
|
||||
return (_categories == null) ? (_categories = new ArrayList()) : _categories;
|
||||
public List<Category> getCategories() {
|
||||
return (_categories == null) ? (_categories = new ArrayList<Category>()) : _categories;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -129,7 +130,7 @@ public class Entry implements Cloneable, Serializable, Extendable {
|
|||
* @param contents the list of Content elements with the entry contents to set,
|
||||
* an empty list or <b>null</b> if none.
|
||||
*/
|
||||
public void setContents(List contents) {
|
||||
public void setContents(List<Content> contents) {
|
||||
_contents = contents;
|
||||
}
|
||||
|
||||
|
@ -162,7 +163,7 @@ public class Entry implements Cloneable, Serializable, Extendable {
|
|||
*
|
||||
*/
|
||||
public List<Person> getContributors() {
|
||||
return (_contributors == null) ? (_contributors = new ArrayList()) : _contributors;
|
||||
return (_contributors == null) ? (_contributors = new ArrayList<Person>()) : _contributors;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -189,8 +190,8 @@ public class Entry implements Cloneable, Serializable, Extendable {
|
|||
* @param foreignMarkup Opaque object to discourage use
|
||||
*
|
||||
*/
|
||||
public void setForeignMarkup(Object foreignMarkup) {
|
||||
_foreignMarkup = (List) foreignMarkup;
|
||||
public void setForeignMarkup(List<Element> foreignMarkup) {
|
||||
_foreignMarkup = (List<Element>) foreignMarkup;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -199,8 +200,8 @@ public class Entry implements Cloneable, Serializable, Extendable {
|
|||
* @return list of Opaque object to discourage use
|
||||
*
|
||||
*/
|
||||
public Object getForeignMarkup() {
|
||||
return (_foreignMarkup == null) ? (_foreignMarkup = new ArrayList()) : _foreignMarkup;
|
||||
public List<Element> getForeignMarkup() {
|
||||
return (_foreignMarkup == null) ? (_foreignMarkup = new ArrayList<Element>()) : _foreignMarkup;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -248,7 +249,7 @@ public class Entry implements Cloneable, Serializable, Extendable {
|
|||
*/
|
||||
public boolean isMediaEntry() {
|
||||
boolean mediaEntry = false;
|
||||
List links = getOtherLinks();
|
||||
List<Link> links = getOtherLinks();
|
||||
|
||||
for (Iterator<Link> it = links.iterator(); it.hasNext();) {
|
||||
Link link = it.next();
|
||||
|
@ -298,7 +299,7 @@ public class Entry implements Cloneable, Serializable, Extendable {
|
|||
* an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setModules(List modules) {
|
||||
public void setModules(List<Module> modules) {
|
||||
_modules = modules;
|
||||
}
|
||||
|
||||
|
@ -309,8 +310,8 @@ public class Entry implements Cloneable, Serializable, Extendable {
|
|||
* an emtpy list if none.
|
||||
*
|
||||
*/
|
||||
public List getModules() {
|
||||
return (_modules == null) ? (_modules = new ArrayList()) : _modules;
|
||||
public List<Module> getModules() {
|
||||
return (_modules == null) ? (_modules = new ArrayList<Module>()) : _modules;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -527,7 +528,7 @@ public class Entry implements Cloneable, Serializable, Extendable {
|
|||
return false;
|
||||
}
|
||||
// can't use foreign markup in equals, due to JDOM equals impl
|
||||
Object fm = getForeignMarkup();
|
||||
List<Element> fm = getForeignMarkup();
|
||||
setForeignMarkup(((Entry) other).getForeignMarkup());
|
||||
|
||||
boolean ret = _objBean.equals(other);
|
||||
|
|
|
@ -161,7 +161,7 @@ public class Feed extends WireFeed {
|
|||
* an empty list if none.
|
||||
*/
|
||||
public List<Link> getOtherLinks() {
|
||||
return (_otherLinks==null) ? (_otherLinks=new ArrayList()) : _otherLinks;
|
||||
return (_otherLinks==null) ? (_otherLinks=new ArrayList<Link>()) : _otherLinks;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -346,7 +346,7 @@ public class Feed extends WireFeed {
|
|||
* an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setEntries(List entries) {
|
||||
public void setEntries(List<Entry> entries) {
|
||||
_entries = entries;
|
||||
}
|
||||
|
||||
|
@ -390,8 +390,8 @@ public class Feed extends WireFeed {
|
|||
* @return Returns the categories.
|
||||
* @since Atom 1.0
|
||||
*/
|
||||
public List getCategories() {
|
||||
return (_categories==null) ? (_categories=new ArrayList()) : _categories;
|
||||
public List<Category> getCategories() {
|
||||
return (_categories==null) ? (_categories=new ArrayList<Category>()) : _categories;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -40,7 +40,7 @@ public class Person implements Cloneable,Serializable, Extendable
|
|||
private String _uri; // since Atom 1.0 (was called url)
|
||||
private String _uriResolved;
|
||||
private String _email;
|
||||
private List _modules;
|
||||
private List<Module> _modules;
|
||||
|
||||
/**
|
||||
* Default constructor. All properties are set to <b>null</b>.
|
||||
|
@ -192,8 +192,8 @@ public class Person implements Cloneable,Serializable, Extendable
|
|||
* an emtpy list if none.
|
||||
*
|
||||
*/
|
||||
public List getModules() {
|
||||
return (_modules==null) ? (_modules=new ArrayList()) : _modules;
|
||||
public List<Module> getModules() {
|
||||
return (_modules==null) ? (_modules=new ArrayList<Module>()) : _modules;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -203,7 +203,7 @@ public class Person implements Cloneable,Serializable, Extendable
|
|||
* an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setModules(List modules) {
|
||||
public void setModules(List<Module> modules) {
|
||||
_modules = modules;
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
/**
|
||||
* Properties to be ignored when cloning.
|
||||
*/
|
||||
private static final Set IGNORE_PROPERTIES = new HashSet();
|
||||
private static final Set<String> IGNORE_PROPERTIES = new HashSet<String>();
|
||||
|
||||
/**
|
||||
* Unmodifiable Set containing the convenience properties of this class.
|
||||
|
@ -60,7 +60,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* properties can be ignored as the will be copied as part of the module
|
||||
* cloning.
|
||||
*/
|
||||
public static final Set CONVENIENCE_PROPERTIES = Collections.unmodifiableSet(IGNORE_PROPERTIES);
|
||||
public static final Set<String> CONVENIENCE_PROPERTIES = Collections.unmodifiableSet(IGNORE_PROPERTIES);
|
||||
|
||||
static {
|
||||
IGNORE_PROPERTIES.add("title");
|
||||
|
@ -97,8 +97,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getTitles() {
|
||||
return (_title == null) ? (_title = new ArrayList()) : _title;
|
||||
public List<String> getTitles() {
|
||||
return (_title == null) ? (_title = new ArrayList<String>()) : _title;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -108,7 +108,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* titles to set, an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setTitles(List titles) {
|
||||
public void setTitles(List<String> titles) {
|
||||
_title = titles;
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setTitle(String title) {
|
||||
_title = new ArrayList();
|
||||
_title = new ArrayList<String>();
|
||||
_title.add(title);
|
||||
}
|
||||
|
||||
|
@ -141,8 +141,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getCreators() {
|
||||
return (_creator == null) ? (_creator = new ArrayList()) : _creator;
|
||||
public List<String> getCreators() {
|
||||
return (_creator == null) ? (_creator = new ArrayList<String>()) : _creator;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -152,7 +152,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* creators to set, an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setCreators(List creators) {
|
||||
public void setCreators(List<String> creators) {
|
||||
_creator = creators;
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setCreator(String creator) {
|
||||
_creator = new ArrayList();
|
||||
_creator = new ArrayList<String>();
|
||||
_creator.add(creator);
|
||||
}
|
||||
|
||||
|
@ -185,8 +185,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getSubjects() {
|
||||
return (_subject == null) ? (_subject = new ArrayList()) : _subject;
|
||||
public List<DCSubject> getSubjects() {
|
||||
return (_subject == null) ? (_subject = new ArrayList<DCSubject>()) : _subject;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -196,7 +196,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* module subjects to set, an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setSubjects(List subjects) {
|
||||
public void setSubjects(List<DCSubject> subjects) {
|
||||
_subject = subjects;
|
||||
}
|
||||
|
||||
|
@ -219,7 +219,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setSubject(DCSubject subject) {
|
||||
_subject = new ArrayList();
|
||||
_subject = new ArrayList<DCSubject>();
|
||||
_subject.add(subject);
|
||||
}
|
||||
|
||||
|
@ -230,8 +230,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* description, an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getDescriptions() {
|
||||
return (_description == null) ? (_description = new ArrayList()) : _description;
|
||||
public List<String> getDescriptions() {
|
||||
return (_description == null) ? (_description = new ArrayList<String>()) : _description;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -241,7 +241,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* module descriptions to set, an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setDescriptions(List descriptions) {
|
||||
public void setDescriptions(List<String> descriptions) {
|
||||
_description = descriptions;
|
||||
}
|
||||
|
||||
|
@ -264,7 +264,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
_description = new ArrayList();
|
||||
_description = new ArrayList<String>();
|
||||
_description.add(description);
|
||||
}
|
||||
|
||||
|
@ -275,8 +275,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getPublishers() {
|
||||
return (_publisher == null) ? (_publisher = new ArrayList()) : _publisher;
|
||||
public List<String> getPublishers() {
|
||||
return (_publisher == null) ? (_publisher = new ArrayList<String>()) : _publisher;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -286,7 +286,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* publishers to set, an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setPublishers(List publishers) {
|
||||
public void setPublishers(List<String> publishers) {
|
||||
_publisher = publishers;
|
||||
}
|
||||
|
||||
|
@ -309,7 +309,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setPublisher(String publisher) {
|
||||
_publisher = new ArrayList();
|
||||
_publisher = new ArrayList<String>();
|
||||
_publisher.add(publisher);
|
||||
}
|
||||
|
||||
|
@ -320,8 +320,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getContributors() {
|
||||
return (_contributors == null) ? (_contributors = new ArrayList()) : _contributors;
|
||||
public List<String> getContributors() {
|
||||
return (_contributors == null) ? (_contributors = new ArrayList<String>()) : _contributors;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -331,7 +331,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* module contributors to set, an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setContributors(List contributors) {
|
||||
public void setContributors(List<String> contributors) {
|
||||
_contributors = contributors;
|
||||
}
|
||||
|
||||
|
@ -354,7 +354,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setContributor(String contributor) {
|
||||
_contributors = new ArrayList();
|
||||
_contributors = new ArrayList<String>();
|
||||
_contributors.add(contributor);
|
||||
}
|
||||
|
||||
|
@ -366,7 +366,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public List<Date> getDates() {
|
||||
return (_date == null) ? (_date = new ArrayList()) : _date;
|
||||
return (_date == null) ? (_date = new ArrayList<Date>()) : _date;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -398,7 +398,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setDate(Date date) {
|
||||
_date = new ArrayList();
|
||||
_date = new ArrayList<Date>();
|
||||
_date.add(date);
|
||||
}
|
||||
|
||||
|
@ -409,8 +409,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getTypes() {
|
||||
return (_type == null) ? (_type = new ArrayList()) : _type;
|
||||
public List<String> getTypes() {
|
||||
return (_type == null) ? (_type = new ArrayList<String>()) : _type;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -420,7 +420,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* to set, an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setTypes(List types) {
|
||||
public void setTypes(List<String> types) {
|
||||
_type = types;
|
||||
}
|
||||
|
||||
|
@ -443,7 +443,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setType(String type) {
|
||||
_type = new ArrayList();
|
||||
_type = new ArrayList<String>();
|
||||
_type.add(type);
|
||||
}
|
||||
|
||||
|
@ -454,8 +454,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getFormats() {
|
||||
return (_format == null) ? (_format = new ArrayList()) : _format;
|
||||
public List<String> getFormats() {
|
||||
return (_format == null) ? (_format = new ArrayList<String>()) : _format;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -465,7 +465,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* formats to set, an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setFormats(List formats) {
|
||||
public void setFormats(List<String> formats) {
|
||||
_format = formats;
|
||||
}
|
||||
|
||||
|
@ -488,7 +488,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setFormat(String format) {
|
||||
_format = new ArrayList();
|
||||
_format = new ArrayList<String>();
|
||||
_format.add(format);
|
||||
}
|
||||
|
||||
|
@ -499,8 +499,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getIdentifiers() {
|
||||
return (_identifier == null) ? (_identifier = new ArrayList()) : _identifier;
|
||||
public List<String> getIdentifiers() {
|
||||
return (_identifier == null) ? (_identifier = new ArrayList<String>()) : _identifier;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -510,7 +510,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* identifiers to set, an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setIdentifiers(List identifiers) {
|
||||
public void setIdentifiers(List<String> identifiers) {
|
||||
_identifier = identifiers;
|
||||
}
|
||||
|
||||
|
@ -533,7 +533,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setIdentifier(String identifier) {
|
||||
_identifier = new ArrayList();
|
||||
_identifier = new ArrayList<String>();
|
||||
_identifier.add(identifier);
|
||||
}
|
||||
|
||||
|
@ -544,8 +544,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getSources() {
|
||||
return (_source == null) ? (_source = new ArrayList()) : _source;
|
||||
public List<String> getSources() {
|
||||
return (_source == null) ? (_source = new ArrayList<String>()) : _source;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -555,7 +555,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* sources to set, an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setSources(List sources) {
|
||||
public void setSources(List<String> sources) {
|
||||
_source = sources;
|
||||
}
|
||||
|
||||
|
@ -578,7 +578,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setSource(String source) {
|
||||
_source = new ArrayList();
|
||||
_source = new ArrayList<String>();
|
||||
_source.add(source);
|
||||
}
|
||||
|
||||
|
@ -589,8 +589,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getLanguages() {
|
||||
return (_language == null) ? (_language = new ArrayList()) : _language;
|
||||
public List<String> getLanguages() {
|
||||
return (_language == null) ? (_language = new ArrayList<String>()) : _language;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -600,7 +600,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* languages to set, an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setLanguages(List languages) {
|
||||
public void setLanguages(List<String> languages) {
|
||||
_language = languages;
|
||||
}
|
||||
|
||||
|
@ -622,7 +622,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setLanguage(String language) {
|
||||
_language = new ArrayList();
|
||||
_language = new ArrayList<String>();
|
||||
_language.add(language);
|
||||
}
|
||||
|
||||
|
@ -633,8 +633,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getRelations() {
|
||||
return (_relation == null) ? (_relation = new ArrayList()) : _relation;
|
||||
public List<String> getRelations() {
|
||||
return (_relation == null) ? (_relation = new ArrayList<String>()) : _relation;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -644,7 +644,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* relations to set, an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setRelations(List relations) {
|
||||
public void setRelations(List<String> relations) {
|
||||
_relation = relations;
|
||||
}
|
||||
|
||||
|
@ -667,7 +667,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setRelation(String relation) {
|
||||
_relation = new ArrayList();
|
||||
_relation = new ArrayList<String>();
|
||||
_relation.add(relation);
|
||||
}
|
||||
|
||||
|
@ -678,8 +678,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getCoverages() {
|
||||
return (_coverage == null) ? (_coverage = new ArrayList()) : _coverage;
|
||||
public List<String> getCoverages() {
|
||||
return (_coverage == null) ? (_coverage = new ArrayList<String>()) : _coverage;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -689,7 +689,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* coverages to set, an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setCoverages(List coverages) {
|
||||
public void setCoverages(List<String> coverages) {
|
||||
_coverage = coverages;
|
||||
}
|
||||
|
||||
|
@ -712,7 +712,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setCoverage(String coverage) {
|
||||
_coverage = new ArrayList();
|
||||
_coverage = new ArrayList<String>();
|
||||
_coverage.add(coverage);
|
||||
}
|
||||
|
||||
|
@ -723,8 +723,8 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getRightsList() {
|
||||
return (_rights == null) ? (_rights = new ArrayList()) : _rights;
|
||||
public List<String> getRightsList() {
|
||||
return (_rights == null) ? (_rights = new ArrayList<String>()) : _rights;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -734,7 +734,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
* rights to set, an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setRightsList(List rights) {
|
||||
public void setRightsList(List<String> rights) {
|
||||
_rights = rights;
|
||||
}
|
||||
|
||||
|
@ -757,7 +757,7 @@ public class DCModuleImpl extends ModuleImpl implements DCModule {
|
|||
*
|
||||
*/
|
||||
public void setRights(String rights) {
|
||||
_rights = new ArrayList();
|
||||
_rights = new ArrayList<String>();
|
||||
_rights.add(rights);
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ public class Channel extends WireFeed {
|
|||
private String _link;
|
||||
private String _uri;
|
||||
private Image _image;
|
||||
private List _items;
|
||||
private List<Item> _items;
|
||||
private TextInput _textInput;
|
||||
private String _language;
|
||||
private String _rating;
|
||||
|
@ -403,7 +403,7 @@ public class Channel extends WireFeed {
|
|||
*
|
||||
*/
|
||||
public List<Integer> getSkipHours() {
|
||||
return (_skipHours!=null) ? _skipHours : new ArrayList();
|
||||
return (_skipHours!=null) ? _skipHours : new ArrayList<Integer>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,6 +27,8 @@ import java.util.Date;
|
|||
import java.util.List;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
* Bean for items of RSS feeds.
|
||||
* <p>
|
||||
|
@ -54,7 +56,7 @@ public class Item implements Cloneable, Serializable, Extendable {
|
|||
private Date _pubDate;
|
||||
private Date _expirationDate;
|
||||
private List<Module> _modules;
|
||||
private List _foreignMarkup;
|
||||
private List<Element> _foreignMarkup;
|
||||
|
||||
/**
|
||||
* Default constructor. All properties are set to <b>null</b>.
|
||||
|
@ -90,7 +92,7 @@ public class Item implements Cloneable, Serializable, Extendable {
|
|||
return false;
|
||||
}
|
||||
// can't use foreign markup in equals, due to JDOM equals impl
|
||||
Object fm = getForeignMarkup();
|
||||
List<Element> fm = getForeignMarkup();
|
||||
setForeignMarkup(((Item)other).getForeignMarkup());
|
||||
boolean ret = _objBean.equals(other);
|
||||
// restore foreign markup
|
||||
|
@ -269,7 +271,7 @@ public class Item implements Cloneable, Serializable, Extendable {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getCategories() {
|
||||
public List<Category> getCategories() {
|
||||
return (_categories==null) ? (_categories=new ArrayList<Category>()) : _categories;
|
||||
}
|
||||
|
||||
|
@ -423,8 +425,8 @@ public class Item implements Cloneable, Serializable, Extendable {
|
|||
* @return Opaque object to discourage use
|
||||
*
|
||||
*/
|
||||
public Object getForeignMarkup() {
|
||||
return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList()) : _foreignMarkup;
|
||||
public List<Element> getForeignMarkup() {
|
||||
return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList<Element>()) : _foreignMarkup;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -433,8 +435,8 @@ public class Item implements Cloneable, Serializable, Extendable {
|
|||
* @param foreignMarkup Opaque object to discourage use
|
||||
*
|
||||
*/
|
||||
public void setForeignMarkup(Object foreignMarkup) {
|
||||
_foreignMarkup = (List)foreignMarkup;
|
||||
public void setForeignMarkup(List<Element> foreignMarkup) {
|
||||
_foreignMarkup = (List<Element>)foreignMarkup;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -271,7 +271,7 @@ class SyndCategoryListFacade extends AbstractList<SyndCategory> {
|
|||
public static List<DCSubject> convertElementsSyndCategoryToSubject(List<SyndCategory> cList) {
|
||||
List<DCSubject> sList = null;
|
||||
if (cList!=null) {
|
||||
sList = new ArrayList();
|
||||
sList = new ArrayList<DCSubject>();
|
||||
for (int i=0;i<cList.size();i++) {
|
||||
SyndCategoryImpl sCat = (SyndCategoryImpl) cList.get(i);
|
||||
DCSubject subject = null;
|
||||
|
|
|
@ -19,6 +19,8 @@ package com.sun.syndication.feed.synd;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.jdom2.Element;
|
||||
|
||||
import com.sun.syndication.feed.CopyFrom;
|
||||
import com.sun.syndication.feed.module.Extendable;
|
||||
import com.sun.syndication.feed.module.Module;
|
||||
|
@ -362,7 +364,7 @@ public interface SyndEntry extends Cloneable, CopyFrom, Extendable {
|
|||
* @return Opaque object to discourage use
|
||||
*
|
||||
*/
|
||||
public Object getForeignMarkup();
|
||||
public List<Element> getForeignMarkup();
|
||||
|
||||
/**
|
||||
* Sets foreign markup found at channel level.
|
||||
|
@ -370,7 +372,7 @@ public interface SyndEntry extends Cloneable, CopyFrom, Extendable {
|
|||
* @param foreignMarkup Opaque object to discourage use
|
||||
*
|
||||
*/
|
||||
public void setForeignMarkup(Object foreignMarkup);
|
||||
public void setForeignMarkup(List<Element> foreignMarkup);
|
||||
|
||||
/**
|
||||
* Creates a deep clone of the object.
|
||||
|
|
|
@ -26,6 +26,8 @@ import com.sun.syndication.feed.impl.CopyFromHelper;
|
|||
import java.util.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
* Bean for entries of SyndFeedImpl feeds.
|
||||
* <p>
|
||||
|
@ -46,13 +48,13 @@ public class SyndEntryImpl implements Serializable,SyndEntry {
|
|||
private List<SyndPerson> _authors;
|
||||
private List<SyndPerson> _contributors;
|
||||
private SyndFeed _source;
|
||||
private List _foreignMarkup;
|
||||
private List<Element> _foreignMarkup;
|
||||
private Object wireEntry; // com.sun.syndication.feed.atom.Entry or com.sun.syndication.feed.rss.Item
|
||||
|
||||
// ISSUE: some converters assume this is never null
|
||||
private List _categories = new ArrayList();
|
||||
private List<SyndCategory> _categories = new ArrayList<SyndCategory>();
|
||||
|
||||
private static final Set IGNORE_PROPERTIES = new HashSet();
|
||||
private static final Set<String> IGNORE_PROPERTIES = new HashSet<String>();
|
||||
|
||||
/**
|
||||
* Unmodifiable Set containing the convenience properties of this class.
|
||||
|
@ -60,7 +62,7 @@ public class SyndEntryImpl implements Serializable,SyndEntry {
|
|||
* Convenience properties are mapped to Modules, for cloning the convenience properties
|
||||
* can be ignored as the will be copied as part of the module cloning.
|
||||
*/
|
||||
public static final Set CONVENIENCE_PROPERTIES = Collections.unmodifiableSet(IGNORE_PROPERTIES);
|
||||
public static final Set<String> CONVENIENCE_PROPERTIES = Collections.unmodifiableSet(IGNORE_PROPERTIES);
|
||||
|
||||
static {
|
||||
IGNORE_PROPERTIES.add("publishedDate");
|
||||
|
@ -119,7 +121,7 @@ public class SyndEntryImpl implements Serializable,SyndEntry {
|
|||
return false;
|
||||
}
|
||||
// can't use foreign markup in equals, due to JDOM equals impl
|
||||
Object fm = getForeignMarkup();
|
||||
List<Element> fm = getForeignMarkup();
|
||||
setForeignMarkup(((SyndEntryImpl)other).getForeignMarkup());
|
||||
boolean ret = _objBean.equals(other);
|
||||
// restore foreign markup
|
||||
|
@ -448,7 +450,7 @@ public class SyndEntryImpl implements Serializable,SyndEntry {
|
|||
* <p>
|
||||
* @param links The links to set.
|
||||
*/
|
||||
public void setLinks(List links) {
|
||||
public void setLinks(List<SyndLink> links) {
|
||||
_links = links;
|
||||
}
|
||||
|
||||
|
@ -470,14 +472,14 @@ public class SyndEntryImpl implements Serializable,SyndEntry {
|
|||
_updatedDate = new Date(updatedDate.getTime());
|
||||
}
|
||||
|
||||
public List getAuthors() {
|
||||
return (_authors==null) ? (_authors=new ArrayList()) : _authors;
|
||||
public List<SyndPerson> getAuthors() {
|
||||
return (_authors==null) ? (_authors=new ArrayList<SyndPerson>()) : _authors;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.sun.syndication.feed.synd.SyndEntry#setAuthors(java.util.List)
|
||||
*/
|
||||
public void setAuthors(List authors) {
|
||||
public void setAuthors(List<SyndPerson> authors) {
|
||||
_authors = authors;
|
||||
}
|
||||
|
||||
|
@ -525,14 +527,14 @@ public class SyndEntryImpl implements Serializable,SyndEntry {
|
|||
}
|
||||
}
|
||||
|
||||
public List getContributors() {
|
||||
return (_contributors==null) ? (_contributors=new ArrayList()) : _contributors;
|
||||
public List<SyndPerson> getContributors() {
|
||||
return (_contributors==null) ? (_contributors=new ArrayList<SyndPerson>()) : _contributors;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see com.sun.syndication.feed.synd.SyndEntry#setContributors(java.util.List)
|
||||
*/
|
||||
public void setContributors(List contributors) {
|
||||
public void setContributors(List<SyndPerson> contributors) {
|
||||
_contributors = contributors;
|
||||
}
|
||||
|
||||
|
@ -551,8 +553,8 @@ public class SyndEntryImpl implements Serializable,SyndEntry {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public Object getForeignMarkup() {
|
||||
return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList()) : _foreignMarkup;
|
||||
public List<Element> getForeignMarkup() {
|
||||
return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList<Element>()) : _foreignMarkup;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -562,8 +564,8 @@ public class SyndEntryImpl implements Serializable,SyndEntry {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public void setForeignMarkup(Object foreignMarkup) {
|
||||
_foreignMarkup = (List)foreignMarkup;
|
||||
public void setForeignMarkup(List<Element> foreignMarkup) {
|
||||
_foreignMarkup = (List<Element>)foreignMarkup;
|
||||
}
|
||||
|
||||
public Object getWireEntry() {
|
||||
|
|
|
@ -24,6 +24,8 @@ import com.sun.syndication.feed.module.Module;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
* Bean interface for all types of feeds.
|
||||
* <p>
|
||||
|
@ -486,7 +488,7 @@ public interface SyndFeed extends Cloneable, CopyFrom, Extendable {
|
|||
* an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
void setModules(List modules);
|
||||
void setModules(List<Module> modules);
|
||||
|
||||
/**
|
||||
* Returns foreign markup found at channel level.
|
||||
|
@ -494,7 +496,7 @@ public interface SyndFeed extends Cloneable, CopyFrom, Extendable {
|
|||
* @return Opaque object to discourage use
|
||||
*
|
||||
*/
|
||||
public Object getForeignMarkup();
|
||||
public List<Element> getForeignMarkup();
|
||||
|
||||
/**
|
||||
* Sets foreign markup found at channel level.
|
||||
|
@ -502,7 +504,7 @@ public interface SyndFeed extends Cloneable, CopyFrom, Extendable {
|
|||
* @param foreignMarkup Opaque object to discourage use
|
||||
*
|
||||
*/
|
||||
public void setForeignMarkup(Object foreignMarkup);
|
||||
public void setForeignMarkup(List<Element> foreignMarkup);
|
||||
|
||||
/**
|
||||
* Creates a deep clone of the object.
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
package com.sun.syndication.feed.synd;
|
||||
|
||||
import com.sun.syndication.feed.CopyFrom;
|
||||
import com.sun.syndication.feed.atom.Person;
|
||||
import com.sun.syndication.feed.impl.ObjectBean;
|
||||
import com.sun.syndication.feed.impl.CopyFromHelper;
|
||||
import com.sun.syndication.feed.WireFeed;
|
||||
|
@ -28,6 +29,8 @@ import com.sun.syndication.feed.synd.impl.URINormalizer;
|
|||
import java.util.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
* Bean for all types of feeds.
|
||||
* <p>
|
||||
|
@ -46,20 +49,20 @@ public class SyndFeedImpl implements Serializable, SyndFeed {
|
|||
private SyndContent _description;
|
||||
private String _feedType;
|
||||
private String _link;
|
||||
private List _links;
|
||||
private List<SyndLink> _links;
|
||||
private SyndImage _image;
|
||||
private List _entries;
|
||||
private List _modules;
|
||||
private List _authors;
|
||||
private List _contributors;
|
||||
private List _foreignMarkup;
|
||||
private List<SyndEntry> _entries;
|
||||
private List<Module> _modules;
|
||||
private List<SyndPerson> _authors;
|
||||
private List<SyndPerson> _contributors;
|
||||
private List<Element> _foreignMarkup;
|
||||
|
||||
private WireFeed wireFeed = null;
|
||||
private boolean preserveWireFeed = false;
|
||||
|
||||
private static final Converters CONVERTERS = new Converters();
|
||||
|
||||
private static final Set IGNORE_PROPERTIES = new HashSet();
|
||||
private static final Set<String> IGNORE_PROPERTIES = new HashSet<String>();
|
||||
|
||||
/**
|
||||
* Unmodifiable Set containing the convenience properties of this class.
|
||||
|
@ -68,7 +71,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed {
|
|||
* can be ignored as the will be copied as part of the module cloning.
|
||||
*/
|
||||
|
||||
public static final Set CONVENIENCE_PROPERTIES = Collections.unmodifiableSet(IGNORE_PROPERTIES);
|
||||
public static final Set<String> CONVENIENCE_PROPERTIES = Collections.unmodifiableSet(IGNORE_PROPERTIES);
|
||||
|
||||
static {
|
||||
IGNORE_PROPERTIES.add("publishedDate");
|
||||
|
@ -170,7 +173,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed {
|
|||
return false;
|
||||
}
|
||||
// can't use foreign markup in equals, due to JDOM equals impl
|
||||
Object fm = getForeignMarkup();
|
||||
List<Element> fm = getForeignMarkup();
|
||||
setForeignMarkup(((SyndFeedImpl)other).getForeignMarkup());
|
||||
boolean ret = _objBean.equals(other);
|
||||
// restore foreign markup
|
||||
|
@ -543,7 +546,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getCategories() {
|
||||
public List<SyndCategory> getCategories() {
|
||||
return new SyndCategoryListFacade(getDCModule().getSubjects());
|
||||
}
|
||||
|
||||
|
@ -556,7 +559,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed {
|
|||
* an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setCategories(List categories) {
|
||||
public void setCategories(List<SyndCategory> categories) {
|
||||
getDCModule().setSubjects(SyndCategoryListFacade.convertElementsSyndCategoryToSubject(categories));
|
||||
}
|
||||
|
||||
|
@ -567,8 +570,8 @@ public class SyndFeedImpl implements Serializable, SyndFeed {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getEntries() {
|
||||
return (_entries==null) ? (_entries=new ArrayList()) : _entries;
|
||||
public List<SyndEntry> getEntries() {
|
||||
return (_entries==null) ? (_entries=new ArrayList<SyndEntry>()) : _entries;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -578,7 +581,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed {
|
|||
* an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setEntries(List entries) {
|
||||
public void setEntries(List<SyndEntry> entries) {
|
||||
_entries = entries;
|
||||
}
|
||||
|
||||
|
@ -613,9 +616,9 @@ public class SyndFeedImpl implements Serializable, SyndFeed {
|
|||
* an empty list if none.
|
||||
*
|
||||
*/
|
||||
public List getModules() {
|
||||
public List<Module> getModules() {
|
||||
if (_modules==null) {
|
||||
_modules=new ArrayList();
|
||||
_modules=new ArrayList<Module>();
|
||||
}
|
||||
if (ModuleUtils.getModule(_modules,DCModule.URI)==null) {
|
||||
_modules.add(new DCModuleImpl());
|
||||
|
@ -631,7 +634,7 @@ public class SyndFeedImpl implements Serializable, SyndFeed {
|
|||
* an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setModules(List modules) {
|
||||
public void setModules(List<Module> modules) {
|
||||
_modules = modules;
|
||||
}
|
||||
|
||||
|
@ -693,8 +696,8 @@ public class SyndFeedImpl implements Serializable, SyndFeed {
|
|||
* <p>
|
||||
* @return Returns the links.
|
||||
*/
|
||||
public List getLinks() {
|
||||
return (_links==null) ? (_links=new ArrayList()) : _links;
|
||||
public List<SyndLink> getLinks() {
|
||||
return (_links==null) ? (_links=new ArrayList<SyndLink>()) : _links;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -702,15 +705,15 @@ public class SyndFeedImpl implements Serializable, SyndFeed {
|
|||
* <p>
|
||||
* @param links The links to set.
|
||||
*/
|
||||
public void setLinks(List links) {
|
||||
public void setLinks(List<SyndLink> links) {
|
||||
_links = links;
|
||||
}
|
||||
|
||||
public List getAuthors() {
|
||||
return (_authors==null) ? (_authors=new ArrayList()) : _authors;
|
||||
public List<SyndPerson> getAuthors() {
|
||||
return (_authors==null) ? (_authors=new ArrayList<SyndPerson>()) : _authors;
|
||||
}
|
||||
|
||||
public void setAuthors(List authors) {
|
||||
public void setAuthors(List<SyndPerson> authors) {
|
||||
this._authors = authors;
|
||||
}
|
||||
|
||||
|
@ -738,11 +741,11 @@ public class SyndFeedImpl implements Serializable, SyndFeed {
|
|||
getDCModule().setCreator(author);
|
||||
}
|
||||
|
||||
public List getContributors() {
|
||||
return (_contributors==null) ? (_contributors=new ArrayList()) : _contributors;
|
||||
public List<SyndPerson> getContributors() {
|
||||
return (_contributors==null) ? (_contributors=new ArrayList<SyndPerson>()) : _contributors;
|
||||
}
|
||||
|
||||
public void setContributors(List contributors) {
|
||||
public void setContributors(List<SyndPerson> contributors) {
|
||||
this._contributors = contributors;
|
||||
}
|
||||
|
||||
|
@ -752,8 +755,8 @@ public class SyndFeedImpl implements Serializable, SyndFeed {
|
|||
* @return Opaque object to discourage use
|
||||
*
|
||||
*/
|
||||
public Object getForeignMarkup() {
|
||||
return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList()) : _foreignMarkup;
|
||||
public List<Element> getForeignMarkup() {
|
||||
return (_foreignMarkup==null) ? (_foreignMarkup=new ArrayList<Element>()) : _foreignMarkup;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -762,8 +765,8 @@ public class SyndFeedImpl implements Serializable, SyndFeed {
|
|||
* @param foreignMarkup Opaque object to discourage use
|
||||
*
|
||||
*/
|
||||
public void setForeignMarkup(Object foreignMarkup) {
|
||||
_foreignMarkup = (List)foreignMarkup;
|
||||
public void setForeignMarkup(List<Element> foreignMarkup) {
|
||||
_foreignMarkup = (List<Element>)foreignMarkup;
|
||||
}
|
||||
|
||||
public boolean isPreservingWireFeed() {
|
||||
|
|
|
@ -36,7 +36,7 @@ public class SyndPersonImpl implements Serializable, SyndPerson {
|
|||
private String _name;
|
||||
private String _uri;
|
||||
private String _email;
|
||||
private List _modules;
|
||||
private List<Module> _modules;
|
||||
|
||||
/**
|
||||
* For implementations extending SyndContentImpl to be able to use the ObjectBean functionality
|
||||
|
@ -163,10 +163,10 @@ public class SyndPersonImpl implements Serializable, SyndPerson {
|
|||
* @return a list of ModuleImpl elements with the person modules,
|
||||
* an empty list if none.
|
||||
*/
|
||||
public List getModules()
|
||||
public List<Module> getModules()
|
||||
{
|
||||
if (_modules==null) {
|
||||
_modules=new ArrayList();
|
||||
_modules=new ArrayList<Module>();
|
||||
}
|
||||
return _modules;
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ public class SyndPersonImpl implements Serializable, SyndPerson {
|
|||
* an empty list or <b>null</b> if none.
|
||||
*
|
||||
*/
|
||||
public void setModules(List modules) {
|
||||
public void setModules(List<Module> modules) {
|
||||
_modules = modules;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,6 +42,8 @@ import java.util.List;
|
|||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ConverterForAtom03 implements Converter {
|
||||
|
@ -64,7 +66,7 @@ public class ConverterForAtom03 implements Converter {
|
|||
|
||||
syndFeed.setModules(ModuleUtils.cloneModules(aFeed.getModules()));
|
||||
|
||||
if (((List)feed.getForeignMarkup()).size() > 0) {
|
||||
if (((List<Element>)feed.getForeignMarkup()).size() > 0) {
|
||||
syndFeed.setForeignMarkup(feed.getForeignMarkup());
|
||||
}
|
||||
|
||||
|
@ -81,7 +83,7 @@ public class ConverterForAtom03 implements Converter {
|
|||
syndFeed.setLink(theLink.getHrefResolved());
|
||||
}
|
||||
// lump alternate and other links together
|
||||
List syndLinks = new ArrayList();
|
||||
List<SyndLink> syndLinks = new ArrayList<SyndLink>();
|
||||
if (aFeed.getAlternateLinks() != null
|
||||
&& aFeed.getAlternateLinks().size() > 0) {
|
||||
syndLinks.addAll(createSyndLinks(aFeed.getAlternateLinks()));
|
||||
|
@ -98,7 +100,7 @@ public class ConverterForAtom03 implements Converter {
|
|||
}
|
||||
|
||||
|
||||
List aEntries = aFeed.getEntries();
|
||||
List<Entry> aEntries = aFeed.getEntries();
|
||||
if (aEntries!=null) {
|
||||
syndFeed.setEntries(createSyndEntries(aEntries, syndFeed.isPreservingWireFeed()));
|
||||
}
|
||||
|
@ -111,7 +113,7 @@ public class ConverterForAtom03 implements Converter {
|
|||
syndFeed.setLanguage(language);
|
||||
}
|
||||
|
||||
List authors = aFeed.getAuthors();
|
||||
List<Person> authors = aFeed.getAuthors();
|
||||
if (authors!=null && authors.size() > 0) {
|
||||
syndFeed.setAuthors(createSyndPersons(authors));
|
||||
}
|
||||
|
@ -128,9 +130,9 @@ public class ConverterForAtom03 implements Converter {
|
|||
|
||||
}
|
||||
|
||||
protected List createSyndLinks(List aLinks) {
|
||||
ArrayList sLinks = new ArrayList();
|
||||
for (Iterator iter = aLinks.iterator(); iter.hasNext();) {
|
||||
protected List<SyndLink> createSyndLinks(List<Link> aLinks) {
|
||||
ArrayList<SyndLink> sLinks = new ArrayList<SyndLink>();
|
||||
for (Iterator<Link> iter = aLinks.iterator(); iter.hasNext();) {
|
||||
Link link = (Link)iter.next();
|
||||
if (!link.getRel().equals("enclosure")) {
|
||||
SyndLink sLink = createSyndLink(link);
|
||||
|
@ -149,8 +151,8 @@ public class ConverterForAtom03 implements Converter {
|
|||
return syndLink;
|
||||
}
|
||||
|
||||
protected List createSyndEntries(List atomEntries, boolean preserveWireItems) {
|
||||
List syndEntries = new ArrayList();
|
||||
protected List<SyndEntry> createSyndEntries(List<Entry> atomEntries, boolean preserveWireItems) {
|
||||
List<SyndEntry> syndEntries = new ArrayList<SyndEntry>();
|
||||
for (int i=0;i<atomEntries.size();i++) {
|
||||
syndEntries.add(createSyndEntry((Entry) atomEntries.get(i), preserveWireItems));
|
||||
}
|
||||
|
@ -165,8 +167,8 @@ public class ConverterForAtom03 implements Converter {
|
|||
|
||||
syndEntry.setModules(ModuleUtils.cloneModules(entry.getModules()));
|
||||
|
||||
if (((List)entry.getForeignMarkup()).size() > 0) {
|
||||
syndEntry.setForeignMarkup((List)entry.getForeignMarkup());
|
||||
if (((List<Element>)entry.getForeignMarkup()).size() > 0) {
|
||||
syndEntry.setForeignMarkup((List<Element>)entry.getForeignMarkup());
|
||||
}
|
||||
|
||||
syndEntry.setTitle(entry.getTitle());
|
||||
|
@ -179,10 +181,10 @@ public class ConverterForAtom03 implements Converter {
|
|||
}
|
||||
|
||||
// Create synd enclosures from enclosure links
|
||||
List syndEnclosures = new ArrayList();
|
||||
List<SyndEnclosure> syndEnclosures = new ArrayList<SyndEnclosure>();
|
||||
if (entry.getOtherLinks() != null && entry.getOtherLinks().size() > 0) {
|
||||
List oLinks = entry.getOtherLinks();
|
||||
for (Iterator iter = oLinks.iterator(); iter.hasNext(); ) {
|
||||
List<Link> oLinks = entry.getOtherLinks();
|
||||
for (Iterator<Link> iter = oLinks.iterator(); iter.hasNext(); ) {
|
||||
Link thisLink = (Link)iter.next();
|
||||
if ("enclosure".equals(thisLink.getRel()))
|
||||
syndEnclosures.add(createSyndEnclosure(entry, thisLink));
|
||||
|
@ -191,7 +193,7 @@ public class ConverterForAtom03 implements Converter {
|
|||
syndEntry.setEnclosures(syndEnclosures);
|
||||
|
||||
// lump alternate and other links together
|
||||
List syndLinks = new ArrayList();
|
||||
List<SyndLink> syndLinks = new ArrayList<SyndLink>();
|
||||
if (entry.getAlternateLinks() != null
|
||||
&& entry.getAlternateLinks().size() > 0) {
|
||||
syndLinks.addAll(createSyndLinks(entry.getAlternateLinks()));
|
||||
|
@ -213,7 +215,7 @@ public class ConverterForAtom03 implements Converter {
|
|||
|
||||
Content content = entry.getSummary();
|
||||
if (content==null) {
|
||||
List contents = entry.getContents();
|
||||
List<Content> contents = entry.getContents();
|
||||
if (contents!=null && contents.size()>0) {
|
||||
content = (Content) contents.get(0);
|
||||
}
|
||||
|
@ -225,9 +227,9 @@ public class ConverterForAtom03 implements Converter {
|
|||
syndEntry.setDescription(sContent);
|
||||
}
|
||||
|
||||
List contents = entry.getContents();
|
||||
List<Content> contents = entry.getContents();
|
||||
if (contents.size()>0) {
|
||||
List sContents = new ArrayList();
|
||||
List<SyndContent> sContents = new ArrayList<SyndContent>();
|
||||
for (int i=0;i<contents.size();i++) {
|
||||
content = (Content) contents.get(i);
|
||||
SyndContent sContent = new SyndContentImpl();
|
||||
|
@ -239,7 +241,7 @@ public class ConverterForAtom03 implements Converter {
|
|||
syndEntry.setContents(sContents);
|
||||
}
|
||||
|
||||
List authors = entry.getAuthors();
|
||||
List<Person> authors = entry.getAuthors();
|
||||
if (authors!=null && authors.size() > 0) {
|
||||
syndEntry.setAuthors(createSyndPersons(authors));
|
||||
SyndPerson person0 = (SyndPerson)syndEntry.getAuthors().get(0);
|
||||
|
@ -292,11 +294,11 @@ public class ConverterForAtom03 implements Converter {
|
|||
}
|
||||
|
||||
// separate SyndEntry's links collection into alternate and other links
|
||||
List alternateLinks = new ArrayList();
|
||||
List otherLinks = new ArrayList();
|
||||
List slinks = syndFeed.getLinks();
|
||||
List<Link> alternateLinks = new ArrayList<Link>();
|
||||
List<Link> otherLinks = new ArrayList<Link>();
|
||||
List<SyndLink> slinks = syndFeed.getLinks();
|
||||
if (slinks != null) {
|
||||
for (Iterator iter=slinks.iterator(); iter.hasNext();) {
|
||||
for (Iterator<SyndLink> iter=slinks.iterator(); iter.hasNext();) {
|
||||
SyndLink syndLink = (SyndLink)iter.next();
|
||||
Link link = createAtomLink(syndLink);
|
||||
if (link.getRel() == null ||
|
||||
|
@ -328,7 +330,7 @@ public class ConverterForAtom03 implements Converter {
|
|||
|
||||
aFeed.setLanguage(syndFeed.getLanguage());
|
||||
|
||||
List authors = syndFeed.getAuthors();
|
||||
List<SyndPerson> authors = syndFeed.getAuthors();
|
||||
if (authors!=null && authors.size() > 0) {
|
||||
aFeed.setAuthors(createAtomPersons(authors));
|
||||
}
|
||||
|
@ -337,7 +339,7 @@ public class ConverterForAtom03 implements Converter {
|
|||
|
||||
aFeed.setModified(syndFeed.getPublishedDate());
|
||||
|
||||
List sEntries = syndFeed.getEntries();
|
||||
List<SyndEntry> sEntries = syndFeed.getEntries();
|
||||
if (sEntries!=null) {
|
||||
aFeed.setEntries(createAtomEntries(sEntries));
|
||||
}
|
||||
|
@ -345,9 +347,9 @@ public class ConverterForAtom03 implements Converter {
|
|||
return aFeed;
|
||||
}
|
||||
|
||||
protected static List createAtomPersons(List sPersons) {
|
||||
List persons = new ArrayList();
|
||||
for (Iterator iter = sPersons.iterator(); iter.hasNext(); ) {
|
||||
protected static List<Person> createAtomPersons(List<SyndPerson> sPersons) {
|
||||
List<Person> persons = new ArrayList<Person>();
|
||||
for (Iterator<SyndPerson> iter = sPersons.iterator(); iter.hasNext(); ) {
|
||||
SyndPerson sPerson = (SyndPerson)iter.next();
|
||||
Person person = new Person();
|
||||
person.setName(sPerson.getName());
|
||||
|
@ -359,9 +361,9 @@ public class ConverterForAtom03 implements Converter {
|
|||
return persons;
|
||||
}
|
||||
|
||||
protected static List createSyndPersons(List aPersons) {
|
||||
List persons = new ArrayList();
|
||||
for (Iterator iter = aPersons.iterator(); iter.hasNext(); ) {
|
||||
protected static List<SyndPerson> createSyndPersons(List<Person> aPersons) {
|
||||
List<SyndPerson> persons = new ArrayList<SyndPerson>();
|
||||
for (Iterator<Person> iter = aPersons.iterator(); iter.hasNext(); ) {
|
||||
Person aPerson = (Person)iter.next();
|
||||
SyndPerson person = new SyndPersonImpl();
|
||||
person.setName(aPerson.getName());
|
||||
|
@ -373,8 +375,8 @@ public class ConverterForAtom03 implements Converter {
|
|||
return persons;
|
||||
}
|
||||
|
||||
protected List createAtomEntries(List syndEntries) {
|
||||
List atomEntries = new ArrayList();
|
||||
protected List<Entry> createAtomEntries(List<SyndEntry> syndEntries) {
|
||||
List<Entry> atomEntries = new ArrayList<Entry>();
|
||||
for (int i=0;i<syndEntries.size();i++) {
|
||||
atomEntries.add(createAtomEntry((SyndEntry)syndEntries.get(i)));
|
||||
}
|
||||
|
@ -403,11 +405,11 @@ public class ConverterForAtom03 implements Converter {
|
|||
}
|
||||
|
||||
// separate SyndEntry's links collection into alternate and other links
|
||||
List alternateLinks = new ArrayList();
|
||||
List otherLinks = new ArrayList();
|
||||
List slinks = sEntry.getLinks();
|
||||
List<Link> alternateLinks = new ArrayList<Link>();
|
||||
List<Link> otherLinks = new ArrayList<Link>();
|
||||
List<SyndLink> slinks = sEntry.getLinks();
|
||||
if (slinks != null) {
|
||||
for (Iterator iter=slinks.iterator(); iter.hasNext();) {
|
||||
for (Iterator<SyndLink> iter=slinks.iterator(); iter.hasNext();) {
|
||||
SyndLink syndLink = (SyndLink)iter.next();
|
||||
Link link = createAtomLink(syndLink);
|
||||
if (link.getRel() == null ||
|
||||
|
@ -427,9 +429,9 @@ public class ConverterForAtom03 implements Converter {
|
|||
alternateLinks.add(link);
|
||||
}
|
||||
|
||||
List sEnclosures = sEntry.getEnclosures();
|
||||
List<SyndEnclosure> sEnclosures = sEntry.getEnclosures();
|
||||
if (sEnclosures != null) {
|
||||
for (Iterator iter=sEnclosures.iterator(); iter.hasNext();) {
|
||||
for (Iterator<SyndEnclosure> iter=sEnclosures.iterator(); iter.hasNext();) {
|
||||
SyndEnclosure syndEnclosure = (SyndEnclosure) iter.next();
|
||||
Link link = createAtomEnclosure(syndEnclosure);
|
||||
otherLinks.add(link);
|
||||
|
@ -449,9 +451,9 @@ public class ConverterForAtom03 implements Converter {
|
|||
aEntry.setSummary(content);
|
||||
}
|
||||
|
||||
List contents = sEntry.getContents();
|
||||
List<SyndContent> contents = sEntry.getContents();
|
||||
if (contents.size()>0) {
|
||||
List aContents = new ArrayList();
|
||||
List<Content> aContents = new ArrayList<Content>();
|
||||
for (int i=0;i<contents.size();i++) {
|
||||
sContent = (SyndContentImpl) contents.get(i);
|
||||
Content content = new Content();
|
||||
|
@ -464,13 +466,13 @@ public class ConverterForAtom03 implements Converter {
|
|||
aEntry.setContents(aContents);
|
||||
}
|
||||
|
||||
List sAuthors = sEntry.getAuthors();
|
||||
List<SyndPerson> sAuthors = sEntry.getAuthors();
|
||||
if (sAuthors!=null && sAuthors.size() > 0) {
|
||||
aEntry.setAuthors(createAtomPersons(sAuthors));
|
||||
} else if (sEntry.getAuthor() != null) {
|
||||
Person person = new Person();
|
||||
person.setName(sEntry.getAuthor());
|
||||
List authors = new ArrayList();
|
||||
List<Person> authors = new ArrayList<Person>();
|
||||
authors.add(person);
|
||||
aEntry.setAuthors(authors);
|
||||
}
|
||||
|
|
|
@ -21,6 +21,8 @@ import java.util.Date;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.jdom2.Element;
|
||||
|
||||
import com.sun.syndication.feed.WireFeed;
|
||||
import com.sun.syndication.feed.atom.Category;
|
||||
import com.sun.syndication.feed.atom.Content;
|
||||
|
@ -67,8 +69,8 @@ public class ConverterForAtom10 implements Converter {
|
|||
|
||||
syndFeed.setModules(ModuleUtils.cloneModules(aFeed.getModules()));
|
||||
|
||||
if (((List)feed.getForeignMarkup()).size() > 0) {
|
||||
syndFeed.setForeignMarkup((List)feed.getForeignMarkup());
|
||||
if (((List<Element>)feed.getForeignMarkup()).size() > 0) {
|
||||
syndFeed.setForeignMarkup((List<Element>)feed.getForeignMarkup());
|
||||
}
|
||||
|
||||
syndFeed.setEncoding(aFeed.getEncoding());
|
||||
|
@ -98,7 +100,7 @@ public class ConverterForAtom10 implements Converter {
|
|||
syndFeed.setLink(theLink.getHrefResolved());
|
||||
}
|
||||
// lump alternate and other links together
|
||||
List syndLinks = new ArrayList();
|
||||
List<SyndLink> syndLinks = new ArrayList<SyndLink>();
|
||||
if (aFeed.getAlternateLinks() != null
|
||||
&& aFeed.getAlternateLinks().size() > 0) {
|
||||
syndLinks.addAll(createSyndLinks(aFeed.getAlternateLinks()));
|
||||
|
@ -109,7 +111,7 @@ public class ConverterForAtom10 implements Converter {
|
|||
}
|
||||
syndFeed.setLinks(syndLinks);
|
||||
|
||||
List aEntries = aFeed.getEntries();
|
||||
List<Entry> aEntries = aFeed.getEntries();
|
||||
if (aEntries!=null) {
|
||||
syndFeed.setEntries(createSyndEntries(aFeed, aEntries, syndFeed.isPreservingWireFeed()));
|
||||
}
|
||||
|
@ -117,12 +119,12 @@ public class ConverterForAtom10 implements Converter {
|
|||
// Core Atom language/author/copyright/modified elements have precedence
|
||||
// over DC equivalent info.
|
||||
|
||||
List authors = aFeed.getAuthors();
|
||||
List<Person> authors = aFeed.getAuthors();
|
||||
if (authors!=null && authors.size() > 0) {
|
||||
syndFeed.setAuthors(ConverterForAtom03.createSyndPersons(authors));
|
||||
}
|
||||
|
||||
List contributors = aFeed.getContributors();
|
||||
List<Person> contributors = aFeed.getContributors();
|
||||
if (contributors!=null && contributors.size() > 0) {
|
||||
syndFeed.setContributors(ConverterForAtom03.createSyndPersons(contributors));
|
||||
}
|
||||
|
@ -139,9 +141,9 @@ public class ConverterForAtom10 implements Converter {
|
|||
|
||||
}
|
||||
|
||||
protected List createSyndLinks(List aLinks) {
|
||||
ArrayList sLinks = new ArrayList();
|
||||
for (Iterator iter = aLinks.iterator(); iter.hasNext();) {
|
||||
protected List<SyndLink> createSyndLinks(List<Link> aLinks) {
|
||||
ArrayList<SyndLink> sLinks = new ArrayList<SyndLink>();
|
||||
for (Iterator<Link> iter = aLinks.iterator(); iter.hasNext();) {
|
||||
Link link = (Link)iter.next();
|
||||
SyndLink sLink = createSyndLink(link);
|
||||
sLinks.add(sLink);
|
||||
|
@ -149,8 +151,8 @@ public class ConverterForAtom10 implements Converter {
|
|||
return sLinks;
|
||||
}
|
||||
|
||||
protected List createSyndEntries(Feed feed, List atomEntries, boolean preserveWireItems) {
|
||||
List syndEntries = new ArrayList();
|
||||
protected List<SyndEntry> createSyndEntries(Feed feed, List<Entry> atomEntries, boolean preserveWireItems) {
|
||||
List<SyndEntry> syndEntries = new ArrayList<SyndEntry>();
|
||||
for (int i=0;i<atomEntries.size();i++) {
|
||||
syndEntries.add(createSyndEntry(feed, (Entry) atomEntries.get(i), preserveWireItems));
|
||||
}
|
||||
|
@ -164,8 +166,8 @@ public class ConverterForAtom10 implements Converter {
|
|||
}
|
||||
syndEntry.setModules(ModuleUtils.cloneModules(entry.getModules()));
|
||||
|
||||
if (((List)entry.getForeignMarkup()).size() > 0) {
|
||||
syndEntry.setForeignMarkup((List)entry.getForeignMarkup());
|
||||
if (((List<Element>)entry.getForeignMarkup()).size() > 0) {
|
||||
syndEntry.setForeignMarkup((List<Element>)entry.getForeignMarkup());
|
||||
}
|
||||
|
||||
Content eTitle = entry.getTitleEx();
|
||||
|
@ -178,24 +180,24 @@ public class ConverterForAtom10 implements Converter {
|
|||
syndEntry.setDescription(createSyndContent(summary));
|
||||
}
|
||||
|
||||
List contents = entry.getContents();
|
||||
List<Content> contents = entry.getContents();
|
||||
if (contents != null && contents.size() > 0) {
|
||||
List sContents = new ArrayList();
|
||||
for (Iterator iter=contents.iterator(); iter.hasNext();) {
|
||||
List<SyndContent> sContents = new ArrayList<SyndContent>();
|
||||
for (Iterator<Content> iter=contents.iterator(); iter.hasNext();) {
|
||||
Content content = (Content)iter.next();
|
||||
sContents.add(createSyndContent(content));
|
||||
}
|
||||
syndEntry.setContents(sContents);
|
||||
}
|
||||
|
||||
List authors = entry.getAuthors();
|
||||
List<Person> authors = entry.getAuthors();
|
||||
if (authors!=null && authors.size() > 0) {
|
||||
syndEntry.setAuthors(ConverterForAtom03.createSyndPersons(authors));
|
||||
SyndPerson person0 = (SyndPerson)syndEntry.getAuthors().get(0);
|
||||
syndEntry.setAuthor(person0.getName());
|
||||
}
|
||||
|
||||
List contributors = entry.getContributors();
|
||||
List<Person> contributors = entry.getContributors();
|
||||
if (contributors!=null && contributors.size() > 0) {
|
||||
syndEntry.setContributors(ConverterForAtom03.createSyndPersons(contributors));
|
||||
}
|
||||
|
@ -210,10 +212,10 @@ public class ConverterForAtom10 implements Converter {
|
|||
syndEntry.setUpdatedDate(date);
|
||||
}
|
||||
|
||||
List categories = entry.getCategories();
|
||||
List<Category> categories = entry.getCategories();
|
||||
if (categories!=null) {
|
||||
List syndCategories = new ArrayList();
|
||||
for (Iterator iter=categories.iterator(); iter.hasNext();) {
|
||||
List<SyndCategory> syndCategories = new ArrayList<SyndCategory>();
|
||||
for (Iterator<Category> iter=categories.iterator(); iter.hasNext();) {
|
||||
Category c = (Category)iter.next();
|
||||
SyndCategory syndCategory = new SyndCategoryImpl();
|
||||
syndCategory.setName(c.getTerm());
|
||||
|
@ -233,10 +235,10 @@ public class ConverterForAtom10 implements Converter {
|
|||
}
|
||||
|
||||
// Create synd enclosures from enclosure links
|
||||
List syndEnclosures = new ArrayList();
|
||||
List<SyndEnclosure> syndEnclosures = new ArrayList<SyndEnclosure>();
|
||||
if (entry.getOtherLinks() != null && entry.getOtherLinks().size() > 0) {
|
||||
List oLinks = entry.getOtherLinks();
|
||||
for (Iterator iter = oLinks.iterator(); iter.hasNext(); ) {
|
||||
List<Link> oLinks = entry.getOtherLinks();
|
||||
for (Iterator<Link> iter = oLinks.iterator(); iter.hasNext(); ) {
|
||||
Link thisLink = (Link)iter.next();
|
||||
if ("enclosure".equals(thisLink.getRel()))
|
||||
syndEnclosures.add(
|
||||
|
@ -246,7 +248,7 @@ public class ConverterForAtom10 implements Converter {
|
|||
syndEntry.setEnclosures(syndEnclosures);
|
||||
|
||||
// lump alternate and other links together
|
||||
List syndLinks = new ArrayList();
|
||||
List<SyndLink> syndLinks = new ArrayList<SyndLink>();
|
||||
if (entry.getAlternateLinks() != null
|
||||
&& entry.getAlternateLinks().size() > 0) {
|
||||
syndLinks.addAll(createSyndLinks(entry.getAlternateLinks()));
|
||||
|
@ -341,11 +343,11 @@ public class ConverterForAtom10 implements Converter {
|
|||
}
|
||||
|
||||
// separate SyndEntry's links collection into alternate and other links
|
||||
List alternateLinks = new ArrayList();
|
||||
List otherLinks = new ArrayList();
|
||||
List slinks = syndFeed.getLinks();
|
||||
List<Link> alternateLinks = new ArrayList<Link>();
|
||||
List<Link> otherLinks = new ArrayList<Link>();
|
||||
List<SyndLink> slinks = syndFeed.getLinks();
|
||||
if (slinks != null) {
|
||||
for (Iterator iter=slinks.iterator(); iter.hasNext();) {
|
||||
for (Iterator<SyndLink> iter=slinks.iterator(); iter.hasNext();) {
|
||||
SyndLink syndLink = (SyndLink)iter.next();
|
||||
Link link = createAtomLink(syndLink);
|
||||
if (link.getRel() == null ||
|
||||
|
@ -367,10 +369,10 @@ public class ConverterForAtom10 implements Converter {
|
|||
if (alternateLinks.size() > 0) aFeed.setAlternateLinks(alternateLinks);
|
||||
if (otherLinks.size() > 0) aFeed.setOtherLinks(otherLinks);
|
||||
|
||||
List sCats = syndFeed.getCategories();
|
||||
List aCats = new ArrayList();
|
||||
List<SyndCategory> sCats = syndFeed.getCategories();
|
||||
List<Category> aCats = new ArrayList<Category>();
|
||||
if (sCats != null) {
|
||||
for (Iterator iter=sCats.iterator(); iter.hasNext();) {
|
||||
for (Iterator<SyndCategory> iter=sCats.iterator(); iter.hasNext();) {
|
||||
SyndCategory sCat = (SyndCategory)iter.next();
|
||||
Category aCat = new Category();
|
||||
aCat.setTerm(sCat.getName());
|
||||
|
@ -381,12 +383,12 @@ public class ConverterForAtom10 implements Converter {
|
|||
}
|
||||
if (aCats.size() > 0) aFeed.setCategories(aCats);
|
||||
|
||||
List authors = syndFeed.getAuthors();
|
||||
List<SyndPerson> authors = syndFeed.getAuthors();
|
||||
if (authors!=null && authors.size() > 0) {
|
||||
aFeed.setAuthors(ConverterForAtom03.createAtomPersons(authors));
|
||||
}
|
||||
|
||||
List contributors = syndFeed.getContributors();
|
||||
List<SyndPerson> contributors = syndFeed.getContributors();
|
||||
if (contributors!=null && contributors.size() > 0) {
|
||||
aFeed.setContributors(ConverterForAtom03.createAtomPersons(contributors));
|
||||
}
|
||||
|
@ -395,12 +397,12 @@ public class ConverterForAtom10 implements Converter {
|
|||
|
||||
aFeed.setUpdated(syndFeed.getPublishedDate());
|
||||
|
||||
List sEntries = syndFeed.getEntries();
|
||||
List<SyndEntry> sEntries = syndFeed.getEntries();
|
||||
if (sEntries!=null) {
|
||||
aFeed.setEntries(createAtomEntries(sEntries));
|
||||
}
|
||||
|
||||
if (((List)syndFeed.getForeignMarkup()).size() > 0) {
|
||||
if (((List<Element>)syndFeed.getForeignMarkup()).size() > 0) {
|
||||
aFeed.setForeignMarkup(syndFeed.getForeignMarkup());
|
||||
}
|
||||
return aFeed;
|
||||
|
@ -413,8 +415,8 @@ public class ConverterForAtom10 implements Converter {
|
|||
return sContent;
|
||||
}
|
||||
|
||||
protected List createAtomEntries(List syndEntries) {
|
||||
List atomEntries = new ArrayList();
|
||||
protected List<Entry> createAtomEntries(List<SyndEntry> syndEntries) {
|
||||
List<Entry> atomEntries = new ArrayList<Entry>();
|
||||
for (int i=0;i<syndEntries.size();i++) {
|
||||
atomEntries.add(createAtomEntry((SyndEntry)syndEntries.get(i)));
|
||||
}
|
||||
|
@ -428,8 +430,8 @@ public class ConverterForAtom10 implements Converter {
|
|||
return content;
|
||||
}
|
||||
|
||||
protected List createAtomContents(List syndContents) {
|
||||
List atomContents = new ArrayList();
|
||||
protected List<Content> createAtomContents(List<SyndContent> syndContents) {
|
||||
List<Content> atomContents = new ArrayList<Content>();
|
||||
for (int i=0;i<syndContents.size();i++) {
|
||||
atomContents.add(createAtomContent((SyndContent)syndContents.get(i)));
|
||||
}
|
||||
|
@ -459,13 +461,13 @@ public class ConverterForAtom10 implements Converter {
|
|||
}
|
||||
|
||||
// separate SyndEntry's links collection into alternate and other links
|
||||
List alternateLinks = new ArrayList();
|
||||
List otherLinks = new ArrayList();
|
||||
List slinks = sEntry.getLinks();
|
||||
List enclosures = sEntry.getEnclosures();
|
||||
List<Link> alternateLinks = new ArrayList<Link>();
|
||||
List<Link> otherLinks = new ArrayList<Link>();
|
||||
List<SyndLink> slinks = sEntry.getLinks();
|
||||
List<SyndEnclosure> enclosures = sEntry.getEnclosures();
|
||||
boolean linkRelEnclosureExists = false;
|
||||
if (slinks != null) {
|
||||
for (Iterator iter=slinks.iterator(); iter.hasNext();) {
|
||||
for (Iterator<SyndLink> iter=slinks.iterator(); iter.hasNext();) {
|
||||
SyndLink syndLink = (SyndLink)iter.next();
|
||||
Link link = createAtomLink(syndLink);
|
||||
// Set this flag if there's a link of rel = enclosure so that
|
||||
|
@ -494,7 +496,7 @@ public class ConverterForAtom10 implements Converter {
|
|||
// add SyndEnclosures as links with rel="enclosure" ONLY if
|
||||
// there are no SyndEntry.getLinks() with rel="enclosure"
|
||||
if (enclosures != null && linkRelEnclosureExists == false) {
|
||||
for (Iterator iter=enclosures.iterator(); iter.hasNext();) {
|
||||
for (Iterator<SyndEnclosure> iter=enclosures.iterator(); iter.hasNext();) {
|
||||
SyndEnclosure syndEncl = (SyndEnclosure)iter.next();
|
||||
Link link = createAtomEnclosure(syndEncl);
|
||||
otherLinks.add(link);
|
||||
|
@ -503,10 +505,10 @@ public class ConverterForAtom10 implements Converter {
|
|||
if (alternateLinks.size() > 0) aEntry.setAlternateLinks(alternateLinks);
|
||||
if (otherLinks.size() > 0) aEntry.setOtherLinks(otherLinks);
|
||||
|
||||
List sCats = sEntry.getCategories();
|
||||
List aCats = new ArrayList();
|
||||
List<SyndCategory> sCats = sEntry.getCategories();
|
||||
List<Category> aCats = new ArrayList<Category>();
|
||||
if (sCats != null) {
|
||||
for (Iterator iter=sCats.iterator(); iter.hasNext();) {
|
||||
for (Iterator<SyndCategory> iter=sCats.iterator(); iter.hasNext();) {
|
||||
SyndCategory sCat = (SyndCategory)iter.next();
|
||||
Category aCat = new Category();
|
||||
aCat.setTerm(sCat.getName());
|
||||
|
@ -517,7 +519,7 @@ public class ConverterForAtom10 implements Converter {
|
|||
}
|
||||
if (aCats.size() > 0) aEntry.setCategories(aCats);
|
||||
|
||||
List syndContents = sEntry.getContents();
|
||||
List<SyndContent> syndContents = sEntry.getContents();
|
||||
aEntry.setContents(createAtomContents(syndContents));
|
||||
|
||||
List authors = sEntry.getAuthors();
|
||||
|
@ -531,7 +533,7 @@ public class ConverterForAtom10 implements Converter {
|
|||
aEntry.setAuthors(authors);
|
||||
}
|
||||
|
||||
List contributors = sEntry.getContributors();
|
||||
List<SyndPerson> contributors = sEntry.getContributors();
|
||||
if (contributors!=null && contributors.size() > 0) {
|
||||
aEntry.setContributors(ConverterForAtom03.createAtomPersons(contributors));
|
||||
}
|
||||
|
@ -547,8 +549,8 @@ public class ConverterForAtom10 implements Converter {
|
|||
aEntry.setUpdated(sEntry.getPublishedDate());
|
||||
}
|
||||
|
||||
if (((List)sEntry.getForeignMarkup()).size() > 0) {
|
||||
aEntry.setForeignMarkup((List)sEntry.getForeignMarkup());
|
||||
if (((List<Element>)sEntry.getForeignMarkup()).size() > 0) {
|
||||
aEntry.setForeignMarkup((List<Element>)sEntry.getForeignMarkup());
|
||||
}
|
||||
|
||||
SyndFeed sSource = sEntry.getSource();
|
||||
|
|
|
@ -26,6 +26,8 @@ import com.sun.syndication.feed.synd.*;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class ConverterForRSS090 implements Converter {
|
||||
|
@ -45,7 +47,7 @@ public class ConverterForRSS090 implements Converter {
|
|||
|
||||
public void copyInto(WireFeed feed,SyndFeed syndFeed) {
|
||||
syndFeed.setModules(ModuleUtils.cloneModules(feed.getModules()));
|
||||
if (((List)feed.getForeignMarkup()).size() > 0) {
|
||||
if (((List<Element>)feed.getForeignMarkup()).size() > 0) {
|
||||
syndFeed.setForeignMarkup(feed.getForeignMarkup());
|
||||
}
|
||||
syndFeed.setEncoding(feed.getEncoding());
|
||||
|
@ -59,7 +61,7 @@ public class ConverterForRSS090 implements Converter {
|
|||
syndFeed.setImage(createSyndImage(image));
|
||||
}
|
||||
|
||||
List items = channel.getItems();
|
||||
List<Item> items = channel.getItems();
|
||||
if (items!=null) {
|
||||
syndFeed.setEntries(createSyndEntries(items, syndFeed.isPreservingWireFeed()));
|
||||
}
|
||||
|
@ -73,8 +75,8 @@ public class ConverterForRSS090 implements Converter {
|
|||
return syndImage;
|
||||
}
|
||||
|
||||
protected List createSyndEntries(List rssItems, boolean preserveWireItems) {
|
||||
List syndEntries = new ArrayList();
|
||||
protected List<SyndEntry> createSyndEntries(List<Item> rssItems, boolean preserveWireItems) {
|
||||
List<SyndEntry> syndEntries = new ArrayList<SyndEntry>();
|
||||
for (int i=0;i<rssItems.size();i++) {
|
||||
syndEntries.add(createSyndEntry((Item) rssItems.get(i), preserveWireItems));
|
||||
}
|
||||
|
@ -89,7 +91,7 @@ public class ConverterForRSS090 implements Converter {
|
|||
|
||||
syndEntry.setModules(ModuleUtils.cloneModules(item.getModules()));
|
||||
|
||||
if (((List)item.getForeignMarkup()).size() > 0) {
|
||||
if (((List<Element>)item.getForeignMarkup()).size() > 0) {
|
||||
syndEntry.setForeignMarkup(item.getForeignMarkup());
|
||||
}
|
||||
|
||||
|
@ -124,12 +126,12 @@ public class ConverterForRSS090 implements Converter {
|
|||
channel.setImage(createRSSImage(sImage));
|
||||
}
|
||||
|
||||
List sEntries = syndFeed.getEntries();
|
||||
List<SyndEntry> sEntries = syndFeed.getEntries();
|
||||
if (sEntries!=null) {
|
||||
channel.setItems(createRSSItems(sEntries));
|
||||
}
|
||||
|
||||
if (((List)syndFeed.getForeignMarkup()).size() > 0) {
|
||||
if (((List<Element>)syndFeed.getForeignMarkup()).size() > 0) {
|
||||
channel.setForeignMarkup(syndFeed.getForeignMarkup());
|
||||
}
|
||||
return channel;
|
||||
|
@ -143,8 +145,8 @@ public class ConverterForRSS090 implements Converter {
|
|||
return image;
|
||||
}
|
||||
|
||||
protected List createRSSItems(List sEntries) {
|
||||
List list = new ArrayList();
|
||||
protected List<Item> createRSSItems(List<SyndEntry> sEntries) {
|
||||
List<Item> list = new ArrayList<Item>();
|
||||
for (int i=0;i<sEntries.size();i++) {
|
||||
list.add(createRSSItem((SyndEntry)sEntries.get(i)));
|
||||
}
|
||||
|
@ -156,7 +158,7 @@ public class ConverterForRSS090 implements Converter {
|
|||
item.setModules(ModuleUtils.cloneModules(sEntry.getModules()));
|
||||
item.setTitle(sEntry.getTitle());
|
||||
item.setLink(sEntry.getLink());
|
||||
if (((List)sEntry.getForeignMarkup()).size() > 0) {
|
||||
if (((List<Element>)sEntry.getForeignMarkup()).size() > 0) {
|
||||
item.setForeignMarkup(sEntry.getForeignMarkup());
|
||||
}
|
||||
|
||||
|
|
|
@ -66,10 +66,10 @@ public class ConverterForRSS091Userland extends ConverterForRSS090 {
|
|||
String author = channel.getManagingEditor();
|
||||
|
||||
if (author != null) {
|
||||
List creators = ((DCModule) syndFeed.getModule(DCModule.URI)).getCreators();
|
||||
List<String> creators = ((DCModule) syndFeed.getModule(DCModule.URI)).getCreators();
|
||||
|
||||
if (!creators.contains(author)) {
|
||||
Set s = new HashSet(); // using a set to remove duplicates
|
||||
Set<String> s = new HashSet<String>(); // using a set to remove duplicates
|
||||
s.addAll(creators); // DC creators
|
||||
s.add(author); // feed native author
|
||||
creators.clear();
|
||||
|
@ -107,7 +107,7 @@ public class ConverterForRSS091Userland extends ConverterForRSS090 {
|
|||
item.setDescription(createItemDescription(sContent));
|
||||
}
|
||||
|
||||
List contents = sEntry.getContents();
|
||||
List<SyndContent> contents = sEntry.getContents();
|
||||
|
||||
if ((contents != null) && (contents.size() > 0)) {
|
||||
SyndContent syndContent = (SyndContent) contents.get(0);
|
||||
|
@ -159,7 +159,7 @@ public class ConverterForRSS091Userland extends ConverterForRSS090 {
|
|||
content.setType(cont.getType());
|
||||
content.setValue(cont.getValue());
|
||||
|
||||
List syndContents = new ArrayList();
|
||||
List<SyndContent> syndContents = new ArrayList<SyndContent>();
|
||||
syndContents.add(content);
|
||||
syndEntry.setContents(syndContents);
|
||||
}
|
||||
|
|
|
@ -45,22 +45,22 @@ public class ConverterForRSS092 extends ConverterForRSS091Userland {
|
|||
@Override
|
||||
protected SyndEntry createSyndEntry(Item item, boolean preserveWireItem) {
|
||||
SyndEntry syndEntry = super.createSyndEntry(item, preserveWireItem);
|
||||
List cats = item.getCategories();
|
||||
List<Category> cats = item.getCategories();
|
||||
if (cats.size()>0) {
|
||||
Set s = new LinkedHashSet(); // using a set to remove duplicates and use a LinkedHashSet to try to retain the document order
|
||||
Set<SyndCategory> s = new LinkedHashSet<SyndCategory>(); // using a set to remove duplicates and use a LinkedHashSet to try to retain the document order
|
||||
s.addAll(createSyndCategories(cats)); // feed native categories (as syndcat)
|
||||
s.addAll(syndEntry.getCategories()); // DC subjects (as syndcat)
|
||||
syndEntry.setCategories(new ArrayList(s)); //c
|
||||
syndEntry.setCategories(new ArrayList<SyndCategory>(s)); //c
|
||||
}
|
||||
List enclosures = item.getEnclosures();
|
||||
List<Enclosure> enclosures = item.getEnclosures();
|
||||
if (enclosures.size()>0) {
|
||||
syndEntry.setEnclosures(createSyndEnclosures(enclosures));
|
||||
}
|
||||
return syndEntry;
|
||||
}
|
||||
|
||||
protected List createSyndCategories(List rssCats) {
|
||||
List syndCats = new ArrayList();
|
||||
protected List<SyndCategory> createSyndCategories(List<Category> rssCats) {
|
||||
List<SyndCategory> syndCats = new ArrayList<SyndCategory>();
|
||||
for (int i=0;i<rssCats.size();i++) {
|
||||
Category rssCat = (Category) rssCats.get(i);
|
||||
SyndCategory sCat = new SyndCategoryImpl();
|
||||
|
@ -71,8 +71,8 @@ public class ConverterForRSS092 extends ConverterForRSS091Userland {
|
|||
return syndCats;
|
||||
}
|
||||
|
||||
protected List createSyndEnclosures(List enclosures) {
|
||||
List sEnclosures = new ArrayList();
|
||||
protected List<SyndEnclosure> createSyndEnclosures(List<Enclosure> enclosures) {
|
||||
List<SyndEnclosure> sEnclosures = new ArrayList<SyndEnclosure>();
|
||||
for (int i=0;i<enclosures.size();i++) {
|
||||
Enclosure enc = (Enclosure) enclosures.get(i);
|
||||
SyndEnclosure sEnc = new SyndEnclosureImpl();
|
||||
|
@ -88,19 +88,19 @@ public class ConverterForRSS092 extends ConverterForRSS091Userland {
|
|||
protected Item createRSSItem(SyndEntry sEntry) {
|
||||
Item item = super.createRSSItem(sEntry);
|
||||
|
||||
List sCats = sEntry.getCategories(); //c
|
||||
List<SyndCategory> sCats = sEntry.getCategories(); //c
|
||||
if (sCats.size()>0) {
|
||||
item.setCategories(createRSSCategories(sCats));
|
||||
}
|
||||
List sEnclosures = sEntry.getEnclosures();
|
||||
List<SyndEnclosure> sEnclosures = sEntry.getEnclosures();
|
||||
if (sEnclosures.size()>0) {
|
||||
item.setEnclosures(createEnclosures(sEnclosures));
|
||||
}
|
||||
return item;
|
||||
}
|
||||
|
||||
protected List createRSSCategories(List sCats) {
|
||||
List cats = new ArrayList();
|
||||
protected List<Category> createRSSCategories(List<SyndCategory> sCats) {
|
||||
List<Category> cats = new ArrayList<Category>();
|
||||
for (int i=0;i<sCats.size();i++) {
|
||||
SyndCategory sCat = (SyndCategory) sCats.get(i);
|
||||
Category cat = new Category();
|
||||
|
@ -111,8 +111,8 @@ public class ConverterForRSS092 extends ConverterForRSS091Userland {
|
|||
return cats;
|
||||
}
|
||||
|
||||
protected List createEnclosures(List sEnclosures) {
|
||||
List enclosures = new ArrayList();
|
||||
protected List<Enclosure> createEnclosures(List<SyndEnclosure> sEnclosures) {
|
||||
List<Enclosure> enclosures = new ArrayList<Enclosure>();
|
||||
for (int i=0;i<sEnclosures.size();i++) {
|
||||
SyndEnclosure sEnc = (SyndEnclosure) sEnclosures.get(i);
|
||||
Enclosure enc = new Enclosure();
|
||||
|
|
|
@ -18,9 +18,11 @@ package com.sun.syndication.feed.synd.impl;
|
|||
|
||||
import com.sun.syndication.feed.WireFeed;
|
||||
import com.sun.syndication.feed.module.DCModule;
|
||||
import com.sun.syndication.feed.rss.Category;
|
||||
import com.sun.syndication.feed.rss.Channel;
|
||||
import com.sun.syndication.feed.rss.Guid;
|
||||
import com.sun.syndication.feed.rss.Item;
|
||||
import com.sun.syndication.feed.synd.SyndCategory;
|
||||
import com.sun.syndication.feed.synd.SyndEntry;
|
||||
import com.sun.syndication.feed.synd.SyndFeed;
|
||||
import com.sun.syndication.feed.synd.SyndLink;
|
||||
|
@ -48,12 +50,12 @@ public class ConverterForRSS094 extends ConverterForRSS093 {
|
|||
public void copyInto(WireFeed feed,SyndFeed syndFeed) {
|
||||
Channel channel = (Channel) feed;
|
||||
super.copyInto(channel,syndFeed);
|
||||
List cats = channel.getCategories(); //c
|
||||
List<Category> cats = channel.getCategories(); //c
|
||||
if (cats.size()>0) {
|
||||
Set s = new HashSet(); // using a set to remove duplicates
|
||||
Set<SyndCategory> s = new HashSet<SyndCategory>(); // using a set to remove duplicates
|
||||
s.addAll(createSyndCategories(cats)); // feed native categories (as syndcat)
|
||||
s.addAll(syndFeed.getCategories()); // DC subjects (as syndcat)
|
||||
syndFeed.setCategories(new ArrayList(s));
|
||||
syndFeed.setCategories(new ArrayList<SyndCategory>(s));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -64,9 +66,9 @@ public class ConverterForRSS094 extends ConverterForRSS093 {
|
|||
// adding native feed author to DC creators list
|
||||
String author = item.getAuthor();
|
||||
if (author!=null) {
|
||||
List creators = ((DCModule)syndEntry.getModule(DCModule.URI)).getCreators();
|
||||
List<String> creators = ((DCModule)syndEntry.getModule(DCModule.URI)).getCreators();
|
||||
if (!creators.contains(author)) {
|
||||
Set s = new HashSet(); // using a set to remove duplicates
|
||||
Set<String> s = new HashSet<String>(); // using a set to remove duplicates
|
||||
s.addAll(creators); // DC creators
|
||||
s.add(author); // feed native author
|
||||
creators.clear();
|
||||
|
@ -97,7 +99,7 @@ public class ConverterForRSS094 extends ConverterForRSS093 {
|
|||
@Override
|
||||
protected WireFeed createRealFeed(String type,SyndFeed syndFeed) {
|
||||
Channel channel = (Channel) super.createRealFeed(type,syndFeed);
|
||||
List cats = syndFeed.getCategories(); //c
|
||||
List<SyndCategory> cats = syndFeed.getCategories(); //c
|
||||
if (cats.size()>0) {
|
||||
channel.setCategories(createRSSCategories(cats));
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ public class ConverterForRSS10 extends ConverterForRSS090 {
|
|||
SyndContent contContent = new SyndContentImpl();
|
||||
contContent.setType(cont.getType());
|
||||
contContent.setValue(cont.getValue());
|
||||
List contents = new ArrayList();
|
||||
List<SyndContent> contents = new ArrayList<SyndContent>();
|
||||
contents.add(contContent);
|
||||
syndEntry.setContents(contents);
|
||||
}
|
||||
|
@ -105,7 +105,7 @@ public class ConverterForRSS10 extends ConverterForRSS090 {
|
|||
if (desc!=null) {
|
||||
item.setDescription(createItemDescription(desc));
|
||||
}
|
||||
List contents = sEntry.getContents();
|
||||
List<SyndContent> contents = sEntry.getContents();
|
||||
if (contents!=null && contents.size() > 0) {
|
||||
item.setContent(createItemContent((SyndContent)contents.get(0)));
|
||||
}
|
||||
|
|
|
@ -17,8 +17,7 @@
|
|||
package com.sun.syndication.io;
|
||||
|
||||
import com.sun.syndication.feed.module.Module;
|
||||
import com.sun.syndication.feed.WireFeed;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.sun.syndication.io;
|
||||
|
||||
import com.sun.syndication.feed.module.Module;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
* Parses module metadata from a XML node (JDOM element).
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package com.sun.syndication.io;
|
||||
|
||||
import org.jdom.input.JDOMParseException;
|
||||
import org.jdom2.input.JDOMParseException;
|
||||
|
||||
/**
|
||||
* Exception thrown by WireFeedInput instance if it can not parse a feed.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.sun.syndication.io;
|
||||
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom2.JDOMException;
|
||||
import org.xml.sax.XMLReader;
|
||||
|
||||
/*
|
||||
|
@ -14,7 +14,7 @@ import org.xml.sax.XMLReader;
|
|||
* Crimson is one parser which is known not to support these features.
|
||||
*
|
||||
*/
|
||||
public class SAXBuilder extends org.jdom.input.SAXBuilder {
|
||||
public class SAXBuilder extends org.jdom2.input.SAXBuilder {
|
||||
|
||||
public SAXBuilder(boolean _validate) {
|
||||
super(_validate);
|
||||
|
|
|
@ -18,7 +18,7 @@ package com.sun.syndication.io;
|
|||
|
||||
import com.sun.syndication.feed.synd.SyndFeed;
|
||||
import com.sun.syndication.feed.synd.SyndFeedImpl;
|
||||
import org.jdom.Document;
|
||||
import org.jdom2.Document;
|
||||
import org.xml.sax.InputSource;
|
||||
|
||||
import java.io.File;
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.sun.syndication.io;
|
||||
|
||||
import com.sun.syndication.feed.synd.SyndFeed;
|
||||
import org.jdom.Document;
|
||||
import org.jdom2.Document;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
|
|
@ -18,7 +18,7 @@ package com.sun.syndication.io;
|
|||
|
||||
import com.sun.syndication.feed.WireFeed;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
import org.jdom.Document;
|
||||
import org.jdom2.Document;
|
||||
|
||||
/**
|
||||
* Generates an XML document (JDOM) out of a feed for a specific real feed type.
|
||||
|
|
|
@ -26,10 +26,10 @@ import java.util.List;
|
|||
import java.util.Map;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import org.jdom.Document;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom.input.DOMBuilder;
|
||||
import org.jdom.input.JDOMParseException;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.JDOMException;
|
||||
import org.jdom2.input.DOMBuilder;
|
||||
import org.jdom2.input.JDOMParseException;
|
||||
import org.xml.sax.EntityResolver;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXNotRecognizedException;
|
||||
|
@ -153,7 +153,7 @@ public class WireFeedInput {
|
|||
/**
|
||||
* Builds an WireFeed (RSS or Atom) from a file.
|
||||
* <p>
|
||||
* NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom.Document)'.
|
||||
* NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'.
|
||||
* <p>
|
||||
* @param file file to read to create the WireFeed.
|
||||
* @return the WireFeed read from the file.
|
||||
|
@ -177,7 +177,7 @@ public class WireFeedInput {
|
|||
/**
|
||||
* Builds an WireFeed (RSS or Atom) from an Reader.
|
||||
* <p>
|
||||
* NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom.Document)'.
|
||||
* NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'.
|
||||
* <p>
|
||||
* @param reader Reader to read to create the WireFeed.
|
||||
* @return the WireFeed read from the Reader.
|
||||
|
@ -208,7 +208,7 @@ public class WireFeedInput {
|
|||
/**
|
||||
* Builds an WireFeed (RSS or Atom) from an W3C SAX InputSource.
|
||||
* <p>
|
||||
* NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom.Document)'.
|
||||
* NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'.
|
||||
* <p>
|
||||
* @param is W3C SAX InputSource to read to create the WireFeed.
|
||||
* @return the WireFeed read from the W3C SAX InputSource.
|
||||
|
@ -236,7 +236,7 @@ public class WireFeedInput {
|
|||
/**
|
||||
* Builds an WireFeed (RSS or Atom) from an W3C DOM document.
|
||||
* <p>
|
||||
* NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom.Document)'.
|
||||
* NOTE: This method delages to the 'AsbtractFeed WireFeedInput#build(org.jdom2.Document)'.
|
||||
* <p>
|
||||
* @param document W3C DOM document to read to create the WireFeed.
|
||||
* @return the WireFeed read from the W3C DOM document.
|
||||
|
@ -278,9 +278,9 @@ public class WireFeedInput {
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates and sets up a org.jdom.input.SAXBuilder for parsing.
|
||||
* Creates and sets up a org.jdom2.input.SAXBuilder for parsing.
|
||||
*
|
||||
* @return a new org.jdom.input.SAXBuilder object
|
||||
* @return a new org.jdom2.input.SAXBuilder object
|
||||
*/
|
||||
protected SAXBuilder createSAXBuilder() {
|
||||
SAXBuilder saxBuilder = new SAXBuilder(_validate);
|
||||
|
|
|
@ -18,11 +18,11 @@ package com.sun.syndication.io;
|
|||
|
||||
import com.sun.syndication.feed.WireFeed;
|
||||
import com.sun.syndication.io.impl.FeedGenerators;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom.output.DOMOutputter;
|
||||
import org.jdom.output.Format;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.JDOMException;
|
||||
import org.jdom2.output.DOMOutputter;
|
||||
import org.jdom2.output.Format;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
|
|
|
@ -18,7 +18,7 @@ package com.sun.syndication.io;
|
|||
|
||||
import com.sun.syndication.feed.WireFeed;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
import org.jdom.Document;
|
||||
import org.jdom2.Document;
|
||||
|
||||
/**
|
||||
* Parses an XML document (JDOM) into a feed bean.
|
||||
|
|
|
@ -19,11 +19,11 @@ package com.sun.syndication.io.impl;
|
|||
import com.sun.syndication.feed.WireFeed;
|
||||
import com.sun.syndication.feed.atom.*;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom2.Attribute;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
|
||||
import java.io.StringReader;
|
||||
import java.util.List;
|
||||
|
@ -90,11 +90,11 @@ public class Atom03Generator extends BaseWireFeedGenerator {
|
|||
populateFeedHeader(feed,eFeed);
|
||||
checkFeedHeaderConstraints(eFeed);
|
||||
generateFeedModules(feed.getModules(),eFeed);
|
||||
generateForeignMarkup(eFeed, (List)feed.getForeignMarkup());
|
||||
generateForeignMarkup(eFeed, (List<Element>)feed.getForeignMarkup());
|
||||
}
|
||||
|
||||
protected void addEntries(Feed feed,Element parent) throws FeedException {
|
||||
List items = feed.getEntries();
|
||||
List<Entry> items = feed.getEntries();
|
||||
for (int i=0;i<items.size();i++) {
|
||||
addEntry((Entry)items.get(i),parent);
|
||||
}
|
||||
|
@ -116,7 +116,7 @@ public class Atom03Generator extends BaseWireFeedGenerator {
|
|||
eFeed.addContent(titleElement);
|
||||
}
|
||||
|
||||
List links = feed.getAlternateLinks();
|
||||
List<Link> links = feed.getAlternateLinks();
|
||||
for (int i = 0; i < links.size(); i++) {
|
||||
eFeed.addContent(generateLinkElement((Link)links.get(i)));
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ public class Atom03Generator extends BaseWireFeedGenerator {
|
|||
eFeed.addContent(authorElement);
|
||||
}
|
||||
|
||||
List contributors = feed.getContributors();
|
||||
List<Person> contributors = feed.getContributors();
|
||||
for (int i = 0; i < contributors.size(); i++) {
|
||||
Element contributorElement = new Element("contributor", getFeedNamespace());
|
||||
fillPersonElement(contributorElement, (Person)contributors.get(i));
|
||||
|
@ -175,7 +175,7 @@ public class Atom03Generator extends BaseWireFeedGenerator {
|
|||
fillContentElement(titleElement, entry.getTitleEx());
|
||||
eEntry.addContent(titleElement);
|
||||
}
|
||||
List links = entry.getAlternateLinks();
|
||||
List<Link> links = entry.getAlternateLinks();
|
||||
for (int i = 0; i < links.size(); i++) {
|
||||
eEntry.addContent(generateLinkElement((Link)links.get(i)));
|
||||
}
|
||||
|
@ -191,7 +191,7 @@ public class Atom03Generator extends BaseWireFeedGenerator {
|
|||
eEntry.addContent(authorElement);
|
||||
}
|
||||
|
||||
List contributors = entry.getContributors();
|
||||
List<Person> contributors = entry.getContributors();
|
||||
for (int i = 0; i < contributors.size(); i++) {
|
||||
Element contributorElement = new Element("contributor", getFeedNamespace());
|
||||
fillPersonElement(contributorElement, (Person)contributors.get(i));
|
||||
|
@ -225,14 +225,14 @@ public class Atom03Generator extends BaseWireFeedGenerator {
|
|||
eEntry.addContent(summaryElement);
|
||||
}
|
||||
|
||||
List contents = entry.getContents();
|
||||
List<Content> contents = entry.getContents();
|
||||
for (int i = 0; i < contents.size(); i++) {
|
||||
Element contentElement = new Element("content", getFeedNamespace());
|
||||
fillContentElement(contentElement, (Content)contents.get(i));
|
||||
eEntry.addContent(contentElement);
|
||||
}
|
||||
|
||||
generateForeignMarkup(eEntry, (List)entry.getForeignMarkup());
|
||||
generateForeignMarkup(eEntry, (List<Element>)entry.getForeignMarkup());
|
||||
}
|
||||
|
||||
protected void checkFeedHeaderConstraints(Element eFeed) throws FeedException {
|
||||
|
@ -329,7 +329,7 @@ public class Atom03Generator extends BaseWireFeedGenerator {
|
|||
throw new FeedException("Invalid XML",ex);
|
||||
}
|
||||
|
||||
List children = tmpDoc.getRootElement().removeContent();
|
||||
List<org.jdom2.Content> children = tmpDoc.getRootElement().removeContent();
|
||||
contentElement.addContent(children);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,10 +19,10 @@ package com.sun.syndication.io.impl;
|
|||
import com.sun.syndication.feed.WireFeed;
|
||||
import com.sun.syndication.feed.atom.*;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
@ -76,13 +76,13 @@ public class Atom03Parser extends BaseWireFeedParser {
|
|||
feed.setTitleEx(parseContent(e));
|
||||
}
|
||||
|
||||
List eList = eFeed.getChildren("link",getAtomNamespace());
|
||||
List<Element> eList = eFeed.getChildren("link",getAtomNamespace());
|
||||
feed.setAlternateLinks(parseAlternateLinks(eList));
|
||||
feed.setOtherLinks(parseOtherLinks(eList));
|
||||
|
||||
e = eFeed.getChild("author",getAtomNamespace());
|
||||
if (e!=null) {
|
||||
List authors = new ArrayList();
|
||||
List<Person> authors = new ArrayList<Person>();
|
||||
authors.add(parsePerson(e));
|
||||
feed.setAuthors(authors);
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ public class Atom03Parser extends BaseWireFeedParser {
|
|||
feed.setEntries(parseEntries(eList));
|
||||
}
|
||||
|
||||
List foreignMarkup =
|
||||
List<Element> foreignMarkup =
|
||||
extractForeignMarkup(eFeed, feed, getAtomNamespace());
|
||||
if (foreignMarkup.size() > 0) {
|
||||
feed.setForeignMarkup(foreignMarkup);
|
||||
|
@ -165,8 +165,8 @@ public class Atom03Parser extends BaseWireFeedParser {
|
|||
}
|
||||
|
||||
// List(Elements) -> List(Link)
|
||||
private List parseLinks(List eLinks,boolean alternate) {
|
||||
List links = new ArrayList();
|
||||
private List<Link> parseLinks(List<Element> eLinks,boolean alternate) {
|
||||
List<Link> links = new ArrayList<Link>();
|
||||
for (int i=0;i<eLinks.size();i++) {
|
||||
Element eLink = (Element) eLinks.get(i);
|
||||
String rel = getAttributeValue(eLink, "rel");
|
||||
|
@ -185,12 +185,12 @@ public class Atom03Parser extends BaseWireFeedParser {
|
|||
}
|
||||
|
||||
// List(Elements) -> List(Link)
|
||||
private List parseAlternateLinks(List eLinks) {
|
||||
private List<Link> parseAlternateLinks(List<Element> eLinks) {
|
||||
return parseLinks(eLinks,true);
|
||||
}
|
||||
|
||||
// List(Elements) -> List(Link)
|
||||
private List parseOtherLinks(List eLinks) {
|
||||
private List<Link> parseOtherLinks(List<Element> eLinks) {
|
||||
return parseLinks(eLinks,false);
|
||||
}
|
||||
|
||||
|
@ -212,8 +212,8 @@ public class Atom03Parser extends BaseWireFeedParser {
|
|||
}
|
||||
|
||||
// List(Elements) -> List(Persons)
|
||||
private List parsePersons(List ePersons) {
|
||||
List persons = new ArrayList();
|
||||
private List<Person> parsePersons(List<Element> ePersons) {
|
||||
List<Person> persons = new ArrayList<Person>();
|
||||
for (int i=0;i<ePersons.size();i++) {
|
||||
persons.add(parsePerson((Element)ePersons.get(i)));
|
||||
}
|
||||
|
@ -239,10 +239,10 @@ public class Atom03Parser extends BaseWireFeedParser {
|
|||
else
|
||||
if (mode.equals(Content.XML)) {
|
||||
XMLOutputter outputter = new XMLOutputter();
|
||||
List eContent = e.getContent();
|
||||
Iterator i = eContent.iterator();
|
||||
List<org.jdom2.Content> eContent = e.getContent();
|
||||
Iterator<org.jdom2.Content> i = eContent.iterator();
|
||||
while (i.hasNext()) {
|
||||
org.jdom.Content c = (org.jdom.Content) i.next();
|
||||
org.jdom2.Content c = (org.jdom2.Content) i.next();
|
||||
if (c instanceof Element) {
|
||||
Element eC = (Element) c;
|
||||
if (eC.getNamespace().equals(getAtomNamespace())) {
|
||||
|
@ -261,8 +261,8 @@ public class Atom03Parser extends BaseWireFeedParser {
|
|||
}
|
||||
|
||||
// List(Elements) -> List(Entries)
|
||||
private List parseEntries(List eEntries) {
|
||||
List entries = new ArrayList();
|
||||
private List<Entry> parseEntries(List<Element> eEntries) {
|
||||
List<Entry> entries = new ArrayList<Entry>();
|
||||
for (int i=0;i<eEntries.size();i++) {
|
||||
entries.add(parseEntry((Element)eEntries.get(i)));
|
||||
}
|
||||
|
@ -277,13 +277,13 @@ public class Atom03Parser extends BaseWireFeedParser {
|
|||
entry.setTitleEx(parseContent(e));
|
||||
}
|
||||
|
||||
List eList = eEntry.getChildren("link",getAtomNamespace());
|
||||
List<Element> eList = eEntry.getChildren("link",getAtomNamespace());
|
||||
entry.setAlternateLinks(parseAlternateLinks(eList));
|
||||
entry.setOtherLinks(parseOtherLinks(eList));
|
||||
|
||||
e = eEntry.getChild("author",getAtomNamespace());
|
||||
if (e!=null) {
|
||||
List authors = new ArrayList();
|
||||
List<Person> authors = new ArrayList<Person>();
|
||||
authors.add(parsePerson(e));
|
||||
entry.setAuthors(authors);
|
||||
}
|
||||
|
@ -320,7 +320,7 @@ public class Atom03Parser extends BaseWireFeedParser {
|
|||
|
||||
eList = eEntry.getChildren("content",getAtomNamespace());
|
||||
if (eList.size()>0) {
|
||||
List content = new ArrayList();
|
||||
List<Content> content = new ArrayList<Content>();
|
||||
for (int i=0;i<eList.size();i++) {
|
||||
content.add(parseContent((Element)eList.get(i)));
|
||||
}
|
||||
|
@ -329,7 +329,7 @@ public class Atom03Parser extends BaseWireFeedParser {
|
|||
|
||||
entry.setModules(parseItemModules(eEntry));
|
||||
|
||||
List foreignMarkup =
|
||||
List<Element> foreignMarkup =
|
||||
extractForeignMarkup(eEntry, entry, getAtomNamespace());
|
||||
if (foreignMarkup.size() > 0) {
|
||||
entry.setForeignMarkup(foreignMarkup);
|
||||
|
|
|
@ -20,11 +20,11 @@ import java.io.StringReader;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom2.Attribute;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
|
||||
import com.sun.syndication.feed.WireFeed;
|
||||
import com.sun.syndication.feed.atom.Category;
|
||||
|
@ -39,7 +39,7 @@ import com.sun.syndication.io.WireFeedOutput;
|
|||
import java.io.IOException;
|
||||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
|
||||
/**
|
||||
* Feed Generator for Atom
|
||||
|
@ -105,13 +105,13 @@ public class Atom10Generator extends BaseWireFeedGenerator {
|
|||
protected void addFeed(Feed feed,Element parent) throws FeedException {
|
||||
Element eFeed = parent;
|
||||
populateFeedHeader(feed,eFeed);
|
||||
generateForeignMarkup(eFeed, (List)feed.getForeignMarkup());
|
||||
generateForeignMarkup(eFeed, (List<Element>)feed.getForeignMarkup());
|
||||
checkFeedHeaderConstraints(eFeed);
|
||||
generateFeedModules(feed.getModules(),eFeed);
|
||||
}
|
||||
|
||||
protected void addEntries(Feed feed,Element parent) throws FeedException {
|
||||
List items = feed.getEntries();
|
||||
List<Entry> items = feed.getEntries();
|
||||
for (int i=0;i<items.size();i++) {
|
||||
addEntry((Entry)items.get(i),parent);
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ public class Atom10Generator extends BaseWireFeedGenerator {
|
|||
eEntry.setAttribute("base", entry.getXmlBase(), Namespace.XML_NAMESPACE);
|
||||
}
|
||||
populateEntry(entry,eEntry);
|
||||
generateForeignMarkup(eEntry, (List)entry.getForeignMarkup());
|
||||
generateForeignMarkup(eEntry, (List<Element>)entry.getForeignMarkup());
|
||||
checkEntryConstraints(eEntry);
|
||||
generateItemModules(entry.getModules(),eEntry);
|
||||
parent.addContent(eEntry);
|
||||
|
@ -137,7 +137,7 @@ public class Atom10Generator extends BaseWireFeedGenerator {
|
|||
eFeed.addContent(titleElement);
|
||||
}
|
||||
|
||||
List links = feed.getAlternateLinks();
|
||||
List<Link> links = feed.getAlternateLinks();
|
||||
if (links != null) for (int i = 0; i < links.size(); i++) {
|
||||
eFeed.addContent(generateLinkElement((Link)links.get(i)));
|
||||
}
|
||||
|
@ -146,12 +146,12 @@ public class Atom10Generator extends BaseWireFeedGenerator {
|
|||
eFeed.addContent(generateLinkElement((Link)links.get(j)));
|
||||
}
|
||||
|
||||
List cats = feed.getCategories();
|
||||
if (cats != null) for (Iterator iter=cats.iterator(); iter.hasNext();) {
|
||||
List<Category> cats = feed.getCategories();
|
||||
if (cats != null) for (Iterator<Category> iter=cats.iterator(); iter.hasNext();) {
|
||||
eFeed.addContent(generateCategoryElement((Category)iter.next()));
|
||||
}
|
||||
|
||||
List authors = feed.getAuthors();
|
||||
List<Person> authors = feed.getAuthors();
|
||||
if (authors != null && authors.size() > 0) {
|
||||
for (int i = 0; i < authors.size(); i++) {
|
||||
Element authorElement = new Element("author", getFeedNamespace());
|
||||
|
@ -160,7 +160,7 @@ public class Atom10Generator extends BaseWireFeedGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
List contributors = feed.getContributors();
|
||||
List<Person> contributors = feed.getContributors();
|
||||
if (contributors != null && contributors.size() > 0) {
|
||||
for (int i = 0; i < contributors.size(); i++) {
|
||||
Element contributorElement = new Element("contributor", getFeedNamespace());
|
||||
|
@ -208,7 +208,7 @@ public class Atom10Generator extends BaseWireFeedGenerator {
|
|||
fillContentElement(titleElement, entry.getTitleEx());
|
||||
eEntry.addContent(titleElement);
|
||||
}
|
||||
List links = entry.getAlternateLinks();
|
||||
List<Link> links = entry.getAlternateLinks();
|
||||
if (links != null) {
|
||||
for (int i = 0; i < links.size(); i++) {
|
||||
eEntry.addContent(generateLinkElement((Link)links.get(i)));
|
||||
|
@ -221,14 +221,14 @@ public class Atom10Generator extends BaseWireFeedGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
List cats = entry.getCategories();
|
||||
List<Category> cats = entry.getCategories();
|
||||
if (cats != null) {
|
||||
for (int i = 0; i < cats.size(); i++) {
|
||||
eEntry.addContent(generateCategoryElement((Category)cats.get(i)));
|
||||
}
|
||||
}
|
||||
|
||||
List authors = entry.getAuthors();
|
||||
List<Person> authors = entry.getAuthors();
|
||||
if (authors != null && authors.size() > 0) {
|
||||
for (int i = 0; i < authors.size(); i++) {
|
||||
Element authorElement = new Element("author", getFeedNamespace());
|
||||
|
@ -237,7 +237,7 @@ public class Atom10Generator extends BaseWireFeedGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
List contributors = entry.getContributors();
|
||||
List<Person> contributors = entry.getContributors();
|
||||
if (contributors != null && contributors.size() > 0) {
|
||||
for (int i = 0; i < contributors.size(); i++) {
|
||||
Element contributorElement = new Element("contributor", getFeedNamespace());
|
||||
|
@ -409,7 +409,7 @@ public class Atom10Generator extends BaseWireFeedGenerator {
|
|||
catch (Exception ex) {
|
||||
throw new FeedException("Invalid XML",ex);
|
||||
}
|
||||
List children = tmpDoc.getRootElement().removeContent();
|
||||
List<org.jdom2.Content> children = tmpDoc.getRootElement().removeContent();
|
||||
contentElement.addContent(children);
|
||||
} else {
|
||||
// must be type html, text or some other non-XML format
|
||||
|
@ -453,7 +453,7 @@ public class Atom10Generator extends BaseWireFeedGenerator {
|
|||
throws IllegalArgumentException, FeedException, IOException {
|
||||
|
||||
// Build a feed containing only the entry
|
||||
List entries = new ArrayList();
|
||||
List<Entry> entries = new ArrayList<Entry>();
|
||||
entries.add(entry);
|
||||
Feed feed1 = new Feed();
|
||||
feed1.setFeedType("atom_1.0");
|
||||
|
|
|
@ -20,10 +20,10 @@ import java.util.ArrayList;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.output.XMLOutputter;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.output.XMLOutputter;
|
||||
|
||||
import com.sun.syndication.feed.WireFeed;
|
||||
import com.sun.syndication.feed.atom.Category;
|
||||
|
@ -40,10 +40,10 @@ import java.io.IOException;
|
|||
import java.io.Reader;
|
||||
import java.net.MalformedURLException;
|
||||
import java.util.regex.Pattern;
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.JDOMException;
|
||||
import org.jdom.Parent;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom2.Attribute;
|
||||
import org.jdom2.JDOMException;
|
||||
import org.jdom2.Parent;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
|
||||
/**
|
||||
* Parser for Atom 1.0
|
||||
|
@ -117,12 +117,12 @@ public class Atom10Parser extends BaseWireFeedParser {
|
|||
|
||||
feed.setModules(parseFeedModules(eFeed));
|
||||
|
||||
List eList = eFeed.getChildren("entry",getAtomNamespace());
|
||||
List<Element> eList = eFeed.getChildren("entry",getAtomNamespace());
|
||||
if (eList.size()>0) {
|
||||
feed.setEntries(parseEntries(feed, baseURI, eList));
|
||||
}
|
||||
|
||||
List foreignMarkup =
|
||||
List<Element> foreignMarkup =
|
||||
extractForeignMarkup(eFeed, feed, getAtomNamespace());
|
||||
if (foreignMarkup.size() > 0) {
|
||||
feed.setForeignMarkup(foreignMarkup);
|
||||
|
@ -142,11 +142,11 @@ public class Atom10Parser extends BaseWireFeedParser {
|
|||
feed.setTitleEx(c);
|
||||
}
|
||||
|
||||
List eList = eFeed.getChildren("link",getAtomNamespace());
|
||||
List<Element> eList = eFeed.getChildren("link",getAtomNamespace());
|
||||
feed.setAlternateLinks(parseAlternateLinks(feed, null, baseURI, eList));
|
||||
feed.setOtherLinks(parseOtherLinks(feed, null, baseURI, eList));
|
||||
|
||||
List cList = eFeed.getChildren("category",getAtomNamespace());
|
||||
List<Element> cList = eFeed.getChildren("category",getAtomNamespace());
|
||||
feed.setCategories(parseCategories(baseURI, cList));
|
||||
|
||||
eList = eFeed.getChildren("author", getAtomNamespace());
|
||||
|
@ -246,8 +246,8 @@ public class Atom10Parser extends BaseWireFeedParser {
|
|||
}
|
||||
|
||||
// List(Elements) -> List(Link)
|
||||
private List parseAlternateLinks(Feed feed, Entry entry, String baseURI, List eLinks) {
|
||||
List links = new ArrayList();
|
||||
private List<Link> parseAlternateLinks(Feed feed, Entry entry, String baseURI, List<Element> eLinks) {
|
||||
List<Link> links = new ArrayList<Link>();
|
||||
for (int i=0;i<eLinks.size();i++) {
|
||||
Element eLink = (Element) eLinks.get(i);
|
||||
Link link = parseLink(feed, entry, baseURI, eLink);
|
||||
|
@ -260,8 +260,8 @@ public class Atom10Parser extends BaseWireFeedParser {
|
|||
return (links.size()>0) ? links : null;
|
||||
}
|
||||
|
||||
private List parseOtherLinks(Feed feed, Entry entry, String baseURI, List eLinks) {
|
||||
List links = new ArrayList();
|
||||
private List<Link> parseOtherLinks(Feed feed, Entry entry, String baseURI, List<Element> eLinks) {
|
||||
List<Link> links = new ArrayList<Link>();
|
||||
for (int i=0;i<eLinks.size();i++) {
|
||||
Element eLink = (Element) eLinks.get(i);
|
||||
Link link = parseLink(feed, entry, baseURI, eLink);
|
||||
|
@ -294,8 +294,8 @@ public class Atom10Parser extends BaseWireFeedParser {
|
|||
}
|
||||
|
||||
// List(Elements) -> List(Persons)
|
||||
private List parsePersons(String baseURI, List ePersons) {
|
||||
List persons = new ArrayList();
|
||||
private List<Person> parsePersons(String baseURI, List<Element> ePersons) {
|
||||
List<Person> persons = new ArrayList<Person>();
|
||||
for (int i=0;i<ePersons.size();i++) {
|
||||
persons.add(parsePerson(baseURI, (Element)ePersons.get(i)));
|
||||
}
|
||||
|
@ -320,10 +320,10 @@ public class Atom10Parser extends BaseWireFeedParser {
|
|||
if (type.equals(Content.XHTML) || (type.indexOf("/xml")) != -1 || (type.indexOf("+xml")) != -1) {
|
||||
// XHTML content needs special handling
|
||||
XMLOutputter outputter = new XMLOutputter();
|
||||
List eContent = e.getContent();
|
||||
Iterator i = eContent.iterator();
|
||||
List<org.jdom2.Content> eContent = e.getContent();
|
||||
Iterator<org.jdom2.Content> i = eContent.iterator();
|
||||
while (i.hasNext()) {
|
||||
org.jdom.Content c = (org.jdom.Content) i.next();
|
||||
org.jdom2.Content c = (org.jdom2.Content) i.next();
|
||||
if (c instanceof Element) {
|
||||
Element eC = (Element) c;
|
||||
if (eC.getNamespace().equals(getAtomNamespace())) {
|
||||
|
@ -340,8 +340,8 @@ public class Atom10Parser extends BaseWireFeedParser {
|
|||
}
|
||||
|
||||
// List(Elements) -> List(Entries)
|
||||
protected List parseEntries(Feed feed, String baseURI, List eEntries) {
|
||||
List entries = new ArrayList();
|
||||
protected List<Entry> parseEntries(Feed feed, String baseURI, List<Element> eEntries) {
|
||||
List<Entry> entries = new ArrayList<Entry>();
|
||||
for (int i=0;i<eEntries.size();i++) {
|
||||
entries.add(parseEntry(feed, (Element)eEntries.get(i), baseURI));
|
||||
}
|
||||
|
@ -364,7 +364,7 @@ public class Atom10Parser extends BaseWireFeedParser {
|
|||
entry.setTitleEx(c);
|
||||
}
|
||||
|
||||
List eList = eEntry.getChildren("link",getAtomNamespace());
|
||||
List<Element> eList = eEntry.getChildren("link",getAtomNamespace());
|
||||
entry.setAlternateLinks(parseAlternateLinks(feed, entry, baseURI, eList));
|
||||
entry.setOtherLinks(parseOtherLinks(feed, entry, baseURI, eList));
|
||||
|
||||
|
@ -400,7 +400,7 @@ public class Atom10Parser extends BaseWireFeedParser {
|
|||
|
||||
e = eEntry.getChild("content",getAtomNamespace());
|
||||
if (e!=null) {
|
||||
List contents = new ArrayList();
|
||||
List<Content> contents = new ArrayList<Content>();
|
||||
contents.add(parseContent(e));
|
||||
entry.setContents(contents);
|
||||
}
|
||||
|
@ -410,7 +410,7 @@ public class Atom10Parser extends BaseWireFeedParser {
|
|||
entry.setRights(e.getText());
|
||||
}
|
||||
|
||||
List cList = eEntry.getChildren("category",getAtomNamespace());
|
||||
List<Element> cList = eEntry.getChildren("category",getAtomNamespace());
|
||||
entry.setCategories(parseCategories(baseURI, cList));
|
||||
|
||||
// TODO: SHOULD handle Atom entry source element
|
||||
|
@ -421,7 +421,7 @@ public class Atom10Parser extends BaseWireFeedParser {
|
|||
|
||||
entry.setModules(parseItemModules(eEntry));
|
||||
|
||||
List foreignMarkup =
|
||||
List<Element> foreignMarkup =
|
||||
extractForeignMarkup(eEntry, entry, getAtomNamespace());
|
||||
if (foreignMarkup.size() > 0) {
|
||||
entry.setForeignMarkup(foreignMarkup);
|
||||
|
@ -429,8 +429,8 @@ public class Atom10Parser extends BaseWireFeedParser {
|
|||
return entry;
|
||||
}
|
||||
|
||||
private List parseCategories(String baseURI, List eCategories) {
|
||||
List cats = new ArrayList();
|
||||
private List<Category> parseCategories(String baseURI, List<Element> eCategories) {
|
||||
List<Category> cats = new ArrayList<Category>();
|
||||
for (int i=0;i<eCategories.size();i++) {
|
||||
Element eCategory = (Element) eCategories.get(i);
|
||||
cats.add(parseCategory(baseURI, eCategory));
|
||||
|
@ -561,9 +561,9 @@ public class Atom10Parser extends BaseWireFeedParser {
|
|||
*/
|
||||
private String findAtomLink(Element parent, String rel) {
|
||||
String ret = null;
|
||||
List linksList = parent.getChildren("link", ATOM_10_NS);
|
||||
List<Element> linksList = parent.getChildren("link", ATOM_10_NS);
|
||||
if (linksList != null) {
|
||||
for (Iterator links = linksList.iterator(); links.hasNext(); ) {
|
||||
for (Iterator<Element> links = linksList.iterator(); links.hasNext(); ) {
|
||||
Element link = (Element)links.next();
|
||||
Attribute relAtt = getAttribute(link, "rel");
|
||||
Attribute hrefAtt = getAttribute(link, "href");
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
package com.sun.syndication.io.impl;
|
||||
|
||||
import com.sun.syndication.io.WireFeedGenerator;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.Parent;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.Parent;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
|
|
|
@ -2,14 +2,15 @@ package com.sun.syndication.io.impl;
|
|||
|
||||
import com.sun.syndication.feed.WireFeed;
|
||||
import com.sun.syndication.feed.module.Extendable;
|
||||
import com.sun.syndication.feed.module.Module;
|
||||
import com.sun.syndication.io.WireFeedParser;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
import java.util.List;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom2.Namespace;
|
||||
import org.jdom2.Attribute;
|
||||
|
||||
/**
|
||||
* @author Alejandro Abdelnur
|
||||
|
@ -60,21 +61,21 @@ public abstract class BaseWireFeedParser implements WireFeedParser {
|
|||
return _type;
|
||||
}
|
||||
|
||||
protected List parseFeedModules(Element feedElement) {
|
||||
protected List<Module> parseFeedModules(Element feedElement) {
|
||||
return _feedModuleParsers.parseModules(feedElement);
|
||||
}
|
||||
|
||||
protected List parseItemModules(Element itemElement) {
|
||||
protected List<Module> parseItemModules(Element itemElement) {
|
||||
return _itemModuleParsers.parseModules(itemElement);
|
||||
}
|
||||
|
||||
protected List parsePersonModules(Element itemElement) {
|
||||
protected List<Module> parsePersonModules(Element itemElement) {
|
||||
return _personModuleParsers.parseModules(itemElement);
|
||||
}
|
||||
|
||||
protected List extractForeignMarkup(Element e, Extendable ext, Namespace basens) {
|
||||
ArrayList foreignMarkup = new ArrayList();
|
||||
Iterator children = e.getChildren().iterator();
|
||||
protected List<Element> extractForeignMarkup(Element e, Extendable ext, Namespace basens) {
|
||||
ArrayList<Element> foreignMarkup = new ArrayList<Element>();
|
||||
Iterator<Element> children = e.getChildren().iterator();
|
||||
while (children.hasNext()) {
|
||||
Element elem = (Element)children.next();
|
||||
if (
|
||||
|
@ -89,7 +90,7 @@ public abstract class BaseWireFeedParser implements WireFeedParser {
|
|||
}
|
||||
}
|
||||
// Now we can detach the foreign markup elements
|
||||
Iterator fm = foreignMarkup.iterator();
|
||||
Iterator<Element> fm = foreignMarkup.iterator();
|
||||
while (fm.hasNext()) {
|
||||
Element elem = (Element)fm.next();
|
||||
elem.detach();
|
||||
|
|
|
@ -20,9 +20,9 @@ import com.sun.syndication.feed.module.Module;
|
|||
import com.sun.syndication.feed.module.DCModule;
|
||||
import com.sun.syndication.feed.module.DCSubject;
|
||||
import com.sun.syndication.io.ModuleGenerator;
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Attribute;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
|
@ -50,10 +50,10 @@ public class DCModuleGenerator implements ModuleGenerator {
|
|||
private static final Namespace TAXO_NS = Namespace.getNamespace("taxo", TAXO_URI);
|
||||
private static final Namespace RDF_NS = Namespace.getNamespace("rdf", RDF_URI);
|
||||
|
||||
private static final Set NAMESPACES;
|
||||
private static final Set<Namespace> NAMESPACES;
|
||||
|
||||
static {
|
||||
Set nss = new HashSet();
|
||||
Set<Namespace> nss = new HashSet<Namespace>();
|
||||
nss.add(DC_NS);
|
||||
nss.add(TAXO_NS);
|
||||
nss.add(RDF_NS);
|
||||
|
@ -87,7 +87,7 @@ public class DCModuleGenerator implements ModuleGenerator {
|
|||
*
|
||||
* @return a set with all the URIs this module generator uses.
|
||||
*/
|
||||
public final Set getNamespaces() {
|
||||
public final Set<Namespace> getNamespaces() {
|
||||
return NAMESPACES;
|
||||
}
|
||||
|
||||
|
@ -106,7 +106,7 @@ public class DCModuleGenerator implements ModuleGenerator {
|
|||
if (dcModule.getCreator() != null) {
|
||||
element.addContent(generateSimpleElementList("creator", dcModule.getCreators()));
|
||||
}
|
||||
List subjects = dcModule.getSubjects();
|
||||
List<DCSubject> subjects = dcModule.getSubjects();
|
||||
for (int i = 0; i < subjects.size(); i++) {
|
||||
element.addContent(generateSubjectElement((DCSubject) subjects.get(i)));
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ public class DCModuleGenerator implements ModuleGenerator {
|
|||
element.addContent(generateSimpleElementList("contributor", dcModule.getContributors()));
|
||||
}
|
||||
if (dcModule.getDate() != null) {
|
||||
for (Iterator i = dcModule.getDates().iterator(); i.hasNext();) {
|
||||
for (Iterator<Date> i = dcModule.getDates().iterator(); i.hasNext();) {
|
||||
element.addContent(generateSimpleElement("date",
|
||||
DateParser.formatW3CDateTime((Date) i.next())));
|
||||
}
|
||||
|
@ -201,9 +201,9 @@ public class DCModuleGenerator implements ModuleGenerator {
|
|||
* @param value the list of values for the elements.
|
||||
* @return a list of Elements created.
|
||||
*/
|
||||
protected final List generateSimpleElementList(String name, List value) {
|
||||
List elements = new ArrayList();
|
||||
for (Iterator i = value.iterator(); i.hasNext();) {
|
||||
protected final List<Element> generateSimpleElementList(String name, List<String> value) {
|
||||
List<Element> elements = new ArrayList<Element>();
|
||||
for (Iterator<String> i = value.iterator(); i.hasNext();) {
|
||||
elements.add(generateSimpleElement(name, (String) i.next()));
|
||||
}
|
||||
|
||||
|
|
|
@ -22,12 +22,12 @@ import com.sun.syndication.feed.module.Module;
|
|||
import com.sun.syndication.feed.module.DCModule;
|
||||
import com.sun.syndication.feed.module.DCSubject;
|
||||
import com.sun.syndication.io.ModuleParser;
|
||||
import com.sun.syndication.io.WireFeedParser;
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Attribute;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -69,7 +69,7 @@ public class DCModuleParser implements ModuleParser {
|
|||
boolean foundSomething = false;
|
||||
DCModule dcm = new DCModuleImpl();
|
||||
|
||||
List eList = dcRoot.getChildren("title", getDCNamespace());
|
||||
List<Element> eList = dcRoot.getChildren("title", getDCNamespace());
|
||||
if (eList.size() > 0) {
|
||||
foundSomething = true;
|
||||
dcm.setTitles(parseElementList(eList));
|
||||
|
@ -172,15 +172,15 @@ public class DCModuleParser implements ModuleParser {
|
|||
* @param eList the element list to parse.
|
||||
* @return a list of subjects parsed from the elements.
|
||||
*/
|
||||
protected final List parseSubjects(List eList) {
|
||||
List subjects = new ArrayList();
|
||||
for (Iterator i = eList.iterator(); i.hasNext();) {
|
||||
protected final List<DCSubject> parseSubjects(List<Element> eList) {
|
||||
List<DCSubject> subjects = new ArrayList<DCSubject>();
|
||||
for (Iterator<Element> i = eList.iterator(); i.hasNext();) {
|
||||
Element eSubject = (Element) i.next();
|
||||
Element eDesc = eSubject.getChild("Description", getRDFNamespace());
|
||||
if (eDesc != null) {
|
||||
String taxonomy = getTaxonomy(eDesc);
|
||||
List eValues = eDesc.getChildren("value", getRDFNamespace());
|
||||
for (Iterator v = eValues.iterator(); v.hasNext();) {
|
||||
List<Element> eValues = eDesc.getChildren("value", getRDFNamespace());
|
||||
for (Iterator<Element> v = eValues.iterator(); v.hasNext();) {
|
||||
Element eValue = (Element) v.next();
|
||||
DCSubject subject = new DCSubjectImpl();
|
||||
subject.setTaxonomyUri(taxonomy);
|
||||
|
@ -203,9 +203,9 @@ public class DCModuleParser implements ModuleParser {
|
|||
* @param eList the list of elements to parse.
|
||||
* @return the list of strings
|
||||
*/
|
||||
protected final List parseElementList(List eList) {
|
||||
List values= new ArrayList();
|
||||
for (Iterator i = eList.iterator(); i.hasNext();) {
|
||||
protected final List<String> parseElementList(List<Element> eList) {
|
||||
List<String> values= new ArrayList<String>();
|
||||
for (Iterator<Element> i = eList.iterator(); i.hasNext();) {
|
||||
Element e = (Element) i.next();
|
||||
values.add(e.getText());
|
||||
}
|
||||
|
@ -219,9 +219,9 @@ public class DCModuleParser implements ModuleParser {
|
|||
* @param eList the list of elements to parse.
|
||||
* @return the list of dates.
|
||||
*/
|
||||
protected final List parseElementListDate(List eList) {
|
||||
List values = new ArrayList();
|
||||
for (Iterator i = eList.iterator(); i.hasNext();) {
|
||||
protected final List<Date> parseElementListDate(List<Element> eList) {
|
||||
List<Date> values = new ArrayList<Date>();
|
||||
for (Iterator<Element> i = eList.iterator(); i.hasNext();) {
|
||||
Element e = (Element) i.next();
|
||||
values.add(DateParser.parseDate(e.getText()));
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.sun.syndication.io.impl;
|
||||
|
||||
import com.sun.syndication.io.WireFeedParser;
|
||||
import org.jdom.Document;
|
||||
import org.jdom2.Document;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,7 +18,7 @@ package com.sun.syndication.io.impl;
|
|||
|
||||
import com.sun.syndication.feed.module.Module;
|
||||
import com.sun.syndication.io.ModuleGenerator;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
|
|
@ -19,8 +19,8 @@ package com.sun.syndication.io.impl;
|
|||
import com.sun.syndication.feed.module.Module;
|
||||
import com.sun.syndication.io.ModuleParser;
|
||||
import com.sun.syndication.io.WireFeedParser;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -40,9 +40,9 @@ public class ModuleParsers extends PluginManager {
|
|||
return getKeys();
|
||||
}
|
||||
|
||||
public List parseModules(Element root) {
|
||||
List parsers = getPlugins();
|
||||
List modules = null;
|
||||
public List<Module> parseModules(Element root) {
|
||||
List<ModuleParser> parsers = getPlugins();
|
||||
List<Module> modules = null;
|
||||
for (int i=0;i<parsers.size();i++) {
|
||||
ModuleParser parser = (ModuleParser) parsers.get(i);
|
||||
String namespaceUri = parser.getNamespaceUri();
|
||||
|
@ -51,7 +51,7 @@ public class ModuleParsers extends PluginManager {
|
|||
Module module = parser.parse(root);
|
||||
if (module != null) {
|
||||
if (modules == null) {
|
||||
modules = new ArrayList();
|
||||
modules = new ArrayList<Module>();
|
||||
}
|
||||
modules.add(module);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class ModuleParsers extends PluginManager {
|
|||
// boolean hasElements = namespace.equals(root.getNamespace());
|
||||
|
||||
if (!hasElements) {
|
||||
List children = root.getChildren();
|
||||
List<Element> children = root.getChildren();
|
||||
for (int i=0;!hasElements && i < children.size();i++) {
|
||||
Element child = (Element) children.get(i);
|
||||
hasElements = namespace.equals(child.getNamespace());
|
||||
|
|
|
@ -27,8 +27,8 @@ public class PropertiesLoader {
|
|||
private static final String EXTRA_PLUGIN_FILE = "rome.properties";
|
||||
|
||||
|
||||
private static Map clMap =
|
||||
new WeakHashMap();
|
||||
private static Map<ClassLoader, PropertiesLoader> clMap =
|
||||
new WeakHashMap<ClassLoader, PropertiesLoader>();
|
||||
|
||||
|
||||
/**
|
||||
|
@ -65,7 +65,7 @@ public class PropertiesLoader {
|
|||
*
|
||||
*/
|
||||
private PropertiesLoader(String masterFileLocation,String extraFileLocation) throws IOException {
|
||||
List propertiesList = new ArrayList();
|
||||
List<Properties> propertiesList = new ArrayList<Properties>();
|
||||
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
||||
|
||||
try {
|
||||
|
@ -82,7 +82,7 @@ public class PropertiesLoader {
|
|||
throw ex;
|
||||
}
|
||||
|
||||
Enumeration urls = classLoader.getResources(extraFileLocation);
|
||||
Enumeration<URL> urls = classLoader.getResources(extraFileLocation);
|
||||
while (urls.hasMoreElements()) {
|
||||
URL url = (URL) urls.nextElement();
|
||||
Properties p = new Properties();
|
||||
|
@ -115,7 +115,7 @@ public class PropertiesLoader {
|
|||
*
|
||||
*/
|
||||
public String[] getTokenizedProperty(String key,String separator) {
|
||||
List entriesList = new ArrayList();
|
||||
List<String> entriesList = new ArrayList<String>();
|
||||
for (int i=0;i<_properties.length;i++) {
|
||||
String values = _properties[i].getProperty(key);
|
||||
if (values!=null) {
|
||||
|
@ -140,7 +140,7 @@ public class PropertiesLoader {
|
|||
*
|
||||
*/
|
||||
public String[] getProperty(String key) {
|
||||
List entriesList = new ArrayList();
|
||||
List<String> entriesList = new ArrayList<String>();
|
||||
for (int i=0;i<_properties.length;i++) {
|
||||
String values = _properties[i].getProperty(key);
|
||||
if (values!=null) {
|
||||
|
|
|
@ -19,9 +19,9 @@ package com.sun.syndication.io.impl;
|
|||
import com.sun.syndication.feed.WireFeed;
|
||||
import com.sun.syndication.feed.rss.*;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -88,7 +88,7 @@ public class RSS090Generator extends BaseWireFeedGenerator {
|
|||
addImage(channel,parent);
|
||||
addTextInput(channel,parent);
|
||||
addItems(channel,parent);
|
||||
generateForeignMarkup(parent, (List)channel.getForeignMarkup());
|
||||
generateForeignMarkup(parent, (List<Element>)channel.getForeignMarkup());
|
||||
}
|
||||
|
||||
protected void addChannel(Channel channel,Element parent) throws FeedException {
|
||||
|
@ -204,7 +204,7 @@ public class RSS090Generator extends BaseWireFeedGenerator {
|
|||
}
|
||||
|
||||
protected void addItems(Channel channel,Element parent) throws FeedException {
|
||||
List items = channel.getItems();
|
||||
List<Item> items = channel.getItems();
|
||||
for (int i=0;i<items.size();i++) {
|
||||
addItem((Item)items.get(i),parent, i);
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ public class RSS090Generator extends BaseWireFeedGenerator {
|
|||
if (link!=null) {
|
||||
eItem.addContent(generateSimpleElement("link",link));
|
||||
}
|
||||
generateForeignMarkup(eItem, (List)item.getForeignMarkup());
|
||||
generateForeignMarkup(eItem, (List<Element>)item.getForeignMarkup());
|
||||
}
|
||||
|
||||
protected Element generateSimpleElement(String name, String value) {
|
||||
|
|
|
@ -17,14 +17,15 @@
|
|||
package com.sun.syndication.io.impl;
|
||||
|
||||
import com.sun.syndication.feed.WireFeed;
|
||||
import com.sun.syndication.feed.module.Module;
|
||||
import com.sun.syndication.feed.rss.Channel;
|
||||
import com.sun.syndication.feed.rss.Image;
|
||||
import com.sun.syndication.feed.rss.Item;
|
||||
import com.sun.syndication.feed.rss.TextInput;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
@ -57,7 +58,7 @@ public class RSS090Parser extends BaseWireFeedParser {
|
|||
|
||||
Element rssRoot = document.getRootElement();
|
||||
Namespace defaultNS = rssRoot.getNamespace();
|
||||
List additionalNSs = rssRoot.getAdditionalNamespaces();
|
||||
List<Namespace> additionalNSs = rssRoot.getAdditionalNamespaces();
|
||||
|
||||
ok = defaultNS!=null && defaultNS.equals(getRDFNamespace());
|
||||
if (ok) {
|
||||
|
@ -165,9 +166,9 @@ public class RSS090Parser extends BaseWireFeedParser {
|
|||
// effectively putting the sharing channel module inside the RSS tag
|
||||
// and not inside the channel itself. So we also need to look for
|
||||
// channel modules from the root RSS element.
|
||||
List allFeedModules = new ArrayList();
|
||||
List rootModules = parseFeedModules(rssRoot);
|
||||
List channelModules = parseFeedModules(eChannel);
|
||||
List<Module> allFeedModules = new ArrayList<Module>();
|
||||
List<Module> rootModules = parseFeedModules(rssRoot);
|
||||
List<Module> channelModules = parseFeedModules(eChannel);
|
||||
if (rootModules != null) {
|
||||
allFeedModules.addAll(rootModules);
|
||||
}
|
||||
|
@ -177,7 +178,7 @@ public class RSS090Parser extends BaseWireFeedParser {
|
|||
channel.setModules(allFeedModules);
|
||||
channel.setItems(parseItems(rssRoot));
|
||||
|
||||
List foreignMarkup =
|
||||
List<Element> foreignMarkup =
|
||||
extractForeignMarkup(eChannel, channel, getRSSNamespace());
|
||||
if (foreignMarkup.size() > 0) {
|
||||
channel.setForeignMarkup(foreignMarkup);
|
||||
|
@ -191,7 +192,7 @@ public class RSS090Parser extends BaseWireFeedParser {
|
|||
* And RSS0.91, RSS0.02, RSS0.93, RSS0.94 and RSS2.0 have the item elements under the 'channel' element.
|
||||
* <p/>
|
||||
*/
|
||||
protected List getItems(Element rssRoot) {
|
||||
protected List<Element> getItems(Element rssRoot) {
|
||||
return rssRoot.getChildren("item",getRSSNamespace());
|
||||
}
|
||||
|
||||
|
@ -254,11 +255,11 @@ public class RSS090Parser extends BaseWireFeedParser {
|
|||
* @param rssRoot the root element of the RSS document to parse for all items information.
|
||||
* @return a list with all the parsed RSSItem beans.
|
||||
*/
|
||||
protected List parseItems(Element rssRoot) {
|
||||
Collection eItems = getItems(rssRoot);
|
||||
protected List<Item> parseItems(Element rssRoot) {
|
||||
Collection<Element> eItems = getItems(rssRoot);
|
||||
|
||||
List items = new ArrayList();
|
||||
for (Iterator i=eItems.iterator();i.hasNext();) {
|
||||
List<Item> items = new ArrayList<Item>();
|
||||
for (Iterator<Element> i=eItems.iterator();i.hasNext();) {
|
||||
Element eItem = (Element) i.next();
|
||||
items.add(parseItem(rssRoot,eItem));
|
||||
}
|
||||
|
@ -289,12 +290,12 @@ public class RSS090Parser extends BaseWireFeedParser {
|
|||
|
||||
item.setModules(parseItemModules(eItem));
|
||||
|
||||
List foreignMarkup =
|
||||
List<Element> foreignMarkup =
|
||||
extractForeignMarkup(eItem, item, getRSSNamespace());
|
||||
//content:encoded elements are treated special, without a module, they have to be removed from the foreign
|
||||
//markup to avoid duplication in case of read/write. Note that this fix will break if a content module is
|
||||
//used
|
||||
Iterator iterator = foreignMarkup.iterator();
|
||||
Iterator<Element> iterator = foreignMarkup.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Element ie = (Element)iterator.next();
|
||||
if (getContentNamespace().equals(ie.getNamespace()) && ie.getName().equals("encoded")) {
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
*/
|
||||
package com.sun.syndication.io.impl;
|
||||
|
||||
import org.jdom.DocType;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.DocType;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
* Feed Generator for RSS 0.91
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
package com.sun.syndication.io.impl;
|
||||
|
||||
import org.jdom.*;
|
||||
import org.jdom2.*;
|
||||
|
||||
/**
|
||||
*/
|
||||
|
|
|
@ -22,10 +22,10 @@ import com.sun.syndication.feed.rss.Image;
|
|||
import com.sun.syndication.feed.rss.Item;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Attribute;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
@ -94,7 +94,7 @@ public class RSS091UserlandGenerator extends RSS090Generator {
|
|||
Element skipHours = eChannel.getChild("skipHours");
|
||||
|
||||
if (skipHours != null) {
|
||||
List hours = skipHours.getChildren();
|
||||
List<Element> hours = skipHours.getChildren();
|
||||
|
||||
for (int i = 0; i < hours.size(); i++) {
|
||||
Element hour = (Element) hours.get(i);
|
||||
|
@ -154,7 +154,7 @@ public class RSS091UserlandGenerator extends RSS090Generator {
|
|||
return root;
|
||||
}
|
||||
|
||||
protected Element generateSkipDaysElement(List days) {
|
||||
protected Element generateSkipDaysElement(List<String> days) {
|
||||
Element skipDaysElement = new Element("skipDays");
|
||||
|
||||
for (int i = 0; i < days.size(); i++) {
|
||||
|
@ -164,7 +164,7 @@ public class RSS091UserlandGenerator extends RSS090Generator {
|
|||
return skipDaysElement;
|
||||
}
|
||||
|
||||
protected Element generateSkipHoursElement(List hours) {
|
||||
protected Element generateSkipHoursElement(List<Integer> hours) {
|
||||
Element skipHoursElement = new Element("skipHours", getFeedNamespace());
|
||||
|
||||
for (int i = 0; i < hours.size(); i++) {
|
||||
|
@ -225,13 +225,13 @@ public class RSS091UserlandGenerator extends RSS090Generator {
|
|||
eChannel.addContent(generateSimpleElement("webMaster", webMaster));
|
||||
}
|
||||
|
||||
List skipHours = channel.getSkipHours();
|
||||
List<Integer> skipHours = channel.getSkipHours();
|
||||
|
||||
if ((skipHours != null) && (skipHours.size() > 0)) {
|
||||
eChannel.addContent(generateSkipHoursElement(skipHours));
|
||||
}
|
||||
|
||||
List skipDays = channel.getSkipDays();
|
||||
List<String> skipDays = channel.getSkipDays();
|
||||
|
||||
if ((skipDays != null) && (skipDays.size() > 0)) {
|
||||
eChannel.addContent(generateSkipDaysElement(skipDays));
|
||||
|
|
|
@ -22,10 +22,10 @@ import com.sun.syndication.feed.rss.Content;
|
|||
import com.sun.syndication.feed.rss.Description;
|
||||
import com.sun.syndication.feed.rss.Image;
|
||||
import com.sun.syndication.feed.rss.Item;
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Attribute;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
|
@ -123,8 +123,8 @@ public class RSS091UserlandParser extends RSS090Parser {
|
|||
}
|
||||
e = eChannel.getChild("skipHours");
|
||||
if (e!=null) {
|
||||
List skipHours = new ArrayList();
|
||||
List eHours = e.getChildren("hour",getRSSNamespace());
|
||||
List<Integer> skipHours = new ArrayList<Integer>();
|
||||
List<Element> eHours = e.getChildren("hour",getRSSNamespace());
|
||||
for (int i=0;i<eHours.size();i++) {
|
||||
Element eHour = (Element) eHours.get(i);
|
||||
skipHours.add(new Integer(eHour.getText().trim()));
|
||||
|
@ -134,8 +134,8 @@ public class RSS091UserlandParser extends RSS090Parser {
|
|||
|
||||
e = eChannel.getChild("skipDays");
|
||||
if (e!=null) {
|
||||
List skipDays = new ArrayList();
|
||||
List eDays = e.getChildren("day",getRSSNamespace());
|
||||
List<String> skipDays = new ArrayList<String>();
|
||||
List<Element> eDays = e.getChildren("day",getRSSNamespace());
|
||||
for (int i=0;i<eDays.size();i++) {
|
||||
Element eDay = (Element) eDays.get(i);
|
||||
skipDays.add(eDay.getText().trim());
|
||||
|
@ -185,9 +185,10 @@ public class RSS091UserlandParser extends RSS090Parser {
|
|||
/**
|
||||
* It looks for the 'item' elements under the 'channel' elemment.
|
||||
*/
|
||||
protected List getItems(Element rssRoot) {
|
||||
protected List<Element> getItems(Element rssRoot) {
|
||||
Element eChannel = rssRoot.getChild("channel",getRSSNamespace());
|
||||
return (eChannel!=null) ? eChannel.getChildren("item",getRSSNamespace()) : Collections.EMPTY_LIST;
|
||||
List<Element> emptyList = Collections.emptyList();
|
||||
return (eChannel!=null) ? eChannel.getChildren("item",getRSSNamespace()) : emptyList;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -18,8 +18,8 @@ package com.sun.syndication.io.impl;
|
|||
|
||||
import com.sun.syndication.feed.rss.*;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Attribute;
|
||||
import org.jdom2.Element;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -77,7 +77,7 @@ public class RSS092Generator extends RSS091UserlandGenerator {
|
|||
}
|
||||
|
||||
// Another one to thanks DW for
|
||||
protected int getNumberOfEnclosures(List enclosures) {
|
||||
protected int getNumberOfEnclosures(List<Enclosure> enclosures) {
|
||||
return (enclosures.size()>0) ? 1 : 0;
|
||||
}
|
||||
|
||||
|
@ -89,12 +89,12 @@ public class RSS092Generator extends RSS091UserlandGenerator {
|
|||
eItem.addContent(generateSourceElement(source));
|
||||
}
|
||||
|
||||
List enclosures = item.getEnclosures();
|
||||
List<Enclosure> enclosures = item.getEnclosures();
|
||||
for(int i = 0; i < getNumberOfEnclosures(enclosures); i++) {
|
||||
eItem.addContent(generateEnclosure((Enclosure)enclosures.get(i)));
|
||||
}
|
||||
|
||||
List categories = item.getCategories();
|
||||
List<Category> categories = item.getCategories();
|
||||
for(int i = 0; i < categories.size(); i++) {
|
||||
eItem.addContent(generateCategoryElement((Category)categories.get(i)));
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ import com.sun.syndication.feed.rss.Description;
|
|||
import com.sun.syndication.feed.rss.Enclosure;
|
||||
import com.sun.syndication.feed.rss.Item;
|
||||
import com.sun.syndication.feed.rss.Source;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -91,9 +91,9 @@ public class RSS092Parser extends RSS091UserlandParser {
|
|||
|
||||
// 0.92 allows one enclosure occurrence, 0.93 multiple
|
||||
// just saving to write some code.
|
||||
List eEnclosures = eItem.getChildren("enclosure");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
|
||||
List<Element> eEnclosures = eItem.getChildren("enclosure");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
|
||||
if (eEnclosures.size()>0) {
|
||||
List enclosures = new ArrayList();
|
||||
List<Enclosure> enclosures = new ArrayList<Enclosure>();
|
||||
for (int i=0;i<eEnclosures.size();i++) {
|
||||
e = (Element) eEnclosures.get(i);
|
||||
|
||||
|
@ -114,16 +114,16 @@ public class RSS092Parser extends RSS091UserlandParser {
|
|||
item.setEnclosures(enclosures);
|
||||
}
|
||||
|
||||
List eCats = eItem.getChildren("category");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
|
||||
List<Element> eCats = eItem.getChildren("category");//getRSSNamespace()); DONT KNOW WHY DOESN'T WORK
|
||||
item.setCategories(parseCategories(eCats));
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
protected List parseCategories(List eCats) {
|
||||
List cats = null;
|
||||
protected List<Category> parseCategories(List<Element> eCats) {
|
||||
List<Category> cats = null;
|
||||
if (eCats.size()>0) {
|
||||
cats = new ArrayList();
|
||||
cats = new ArrayList<Category>();
|
||||
for (int i=0;i<eCats.size();i++) {
|
||||
Category cat = new Category();
|
||||
Element e = (Element) eCats.get(i);
|
||||
|
|
|
@ -16,8 +16,9 @@
|
|||
*/
|
||||
package com.sun.syndication.io.impl;
|
||||
|
||||
import com.sun.syndication.feed.rss.Enclosure;
|
||||
import com.sun.syndication.feed.rss.Item;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
@ -55,7 +56,7 @@ public class RSS093Generator extends RSS092Generator {
|
|||
}
|
||||
|
||||
// Another one to thanks DW for
|
||||
protected int getNumberOfEnclosures(List enclosures) {
|
||||
protected int getNumberOfEnclosures(List<Enclosure> enclosures) {
|
||||
return enclosures.size();
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
package com.sun.syndication.io.impl;
|
||||
|
||||
import com.sun.syndication.feed.rss.Item;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
*/
|
||||
|
|
|
@ -18,8 +18,8 @@ package com.sun.syndication.io.impl;
|
|||
|
||||
import com.sun.syndication.feed.rss.Description;
|
||||
import com.sun.syndication.feed.rss.Item;
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Attribute;
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
* Feed Generator for RSS 0.94
|
||||
|
|
|
@ -21,7 +21,7 @@ import com.sun.syndication.feed.rss.Channel;
|
|||
import com.sun.syndication.feed.rss.Description;
|
||||
import com.sun.syndication.feed.rss.Guid;
|
||||
import com.sun.syndication.feed.rss.Item;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -45,7 +45,7 @@ public class RSS094Parser extends RSS093Parser {
|
|||
Channel channel = (Channel) super.parseChannel(rssRoot);
|
||||
Element eChannel = rssRoot.getChild("channel",getRSSNamespace());
|
||||
|
||||
List eCats = eChannel.getChildren("category",getRSSNamespace());
|
||||
List<Element> eCats = eChannel.getChildren("category",getRSSNamespace());
|
||||
channel.setCategories(parseCategories(eCats));
|
||||
|
||||
Element eTtl = eChannel.getChild("ttl",getRSSNamespace());
|
||||
|
|
|
@ -20,8 +20,8 @@ import com.sun.syndication.feed.rss.Description;
|
|||
import com.sun.syndication.feed.rss.Item;
|
||||
import com.sun.syndication.feed.rss.Channel;
|
||||
import com.sun.syndication.io.FeedException;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -55,7 +55,7 @@ public class RSS10Generator extends RSS090Generator {
|
|||
if (channel.getUri() != null) {
|
||||
eChannel.setAttribute("about", channel.getUri(), getRDFNamespace());
|
||||
}
|
||||
List items = channel.getItems();
|
||||
List<Item> items = channel.getItems();
|
||||
if (items.size()>0) {
|
||||
Element eItems = new Element("items",getFeedNamespace());
|
||||
Element eSeq = new Element("Seq",getRDFNamespace());
|
||||
|
|
|
@ -21,9 +21,9 @@ import com.sun.syndication.feed.rss.Channel;
|
|||
import com.sun.syndication.feed.rss.Content;
|
||||
import com.sun.syndication.feed.rss.Description;
|
||||
import com.sun.syndication.feed.rss.Item;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -56,7 +56,7 @@ public class RSS10Parser extends RSS090Parser {
|
|||
|
||||
Element rssRoot = document.getRootElement();
|
||||
Namespace defaultNS = rssRoot.getNamespace();
|
||||
List additionalNSs = rssRoot.getAdditionalNamespaces();
|
||||
List<Namespace> additionalNSs = rssRoot.getAdditionalNamespaces();
|
||||
|
||||
ok = defaultNS!=null && defaultNS.equals(getRDFNamespace());
|
||||
if (ok) {
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.sun.syndication.feed.rss.Category;
|
|||
import com.sun.syndication.feed.rss.Channel;
|
||||
import com.sun.syndication.feed.rss.Guid;
|
||||
import com.sun.syndication.feed.rss.Item;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Element;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -56,7 +56,7 @@ public class RSS20Generator extends RSS094Generator {
|
|||
eChannel.addContent(generateSimpleElement("ttl", String.valueOf(ttl)));
|
||||
}
|
||||
|
||||
List categories = channel.getCategories();
|
||||
List<Category> categories = channel.getCategories();
|
||||
for(int i = 0; i < categories.size(); i++) {
|
||||
eChannel.addContent(generateCategoryElement((Category)categories.get(i)));
|
||||
}
|
||||
|
|
|
@ -17,9 +17,9 @@
|
|||
package com.sun.syndication.io.impl;
|
||||
|
||||
import com.sun.syndication.feed.rss.Description;
|
||||
import org.jdom.Attribute;
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom2.Attribute;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
|
||||
/**
|
||||
*/
|
||||
|
|
|
@ -16,9 +16,9 @@
|
|||
*/
|
||||
package com.sun.syndication.io.impl;
|
||||
|
||||
import org.jdom.Document;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
import com.sun.syndication.feed.WireFeed;
|
||||
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@ package com.sun.syndication.io.impl;
|
|||
import com.sun.syndication.feed.module.Module;
|
||||
import com.sun.syndication.feed.module.SyModule;
|
||||
import com.sun.syndication.io.ModuleGenerator;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
|
@ -39,10 +39,10 @@ public class SyModuleGenerator implements ModuleGenerator {
|
|||
private static final String SY_URI = "http://purl.org/rss/1.0/modules/syndication/";
|
||||
private static final Namespace SY_NS = Namespace.getNamespace("sy", SY_URI);
|
||||
|
||||
private static final Set NAMESPACES;
|
||||
private static final Set<Namespace> NAMESPACES;
|
||||
|
||||
static {
|
||||
Set nss = new HashSet();
|
||||
Set<Namespace> nss = new HashSet<Namespace>();
|
||||
nss.add(SY_NS);
|
||||
NAMESPACES = Collections.unmodifiableSet(nss);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public class SyModuleGenerator implements ModuleGenerator {
|
|||
*
|
||||
* @return a set with all the URIs (JDOM Namespace elements) this module generator uses.
|
||||
*/
|
||||
public Set getNamespaces() {
|
||||
public Set<Namespace> getNamespaces() {
|
||||
return NAMESPACES;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,8 +20,8 @@ import com.sun.syndication.feed.module.Module;
|
|||
import com.sun.syndication.feed.module.SyModule;
|
||||
import com.sun.syndication.feed.module.SyModuleImpl;
|
||||
import com.sun.syndication.io.ModuleParser;
|
||||
import org.jdom.Element;
|
||||
import org.jdom.Namespace;
|
||||
import org.jdom2.Element;
|
||||
import org.jdom2.Namespace;
|
||||
|
||||
/**
|
||||
*/
|
||||
|
|
|
@ -339,7 +339,7 @@ public class XmlFixerReader extends Reader {
|
|||
in.close();
|
||||
}
|
||||
|
||||
private static Map CODED_ENTITIES = new HashMap();
|
||||
private static Map<String, String> CODED_ENTITIES = new HashMap<String, String>();
|
||||
|
||||
static {
|
||||
// note: refer to Character entity references in HTML 4
|
||||
|
|
|
@ -11,8 +11,8 @@ import java.io.InputStreamReader;
|
|||
import java.io.Reader;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.jdom.Document;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom2.Document;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
|
||||
/**
|
||||
* @author pat, tucu
|
||||
|
|
|
@ -95,7 +95,7 @@ public abstract class SyndFeedTest extends FeedTest {
|
|||
}
|
||||
|
||||
public void testEntries() throws Exception {
|
||||
List entrylist = getCachedSyndFeed().getEntries();
|
||||
List<SyndEntry> entrylist = getCachedSyndFeed().getEntries();
|
||||
assertEquals(2, entrylist.size());
|
||||
}
|
||||
|
||||
|
@ -228,7 +228,7 @@ public abstract class SyndFeedTest extends FeedTest {
|
|||
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
|
||||
<cloud domain="rpc.sys.com" port="80" path="/RPC2" registerProcedure="pingMe" protocol="soap"/>
|
||||
<ttl>60</ttl>
|
||||
<rating>(PICS-1.1 Òhttp://www.classify.org/safesurf/Ó l r (SS~~000 1))</rating>
|
||||
<rating>(PICS-1.1 <EFBFBD>http://www.classify.org/safesurf/<EFBFBD> l r (SS~~000 1))</rating>
|
||||
|
||||
<skiphours>
|
||||
<hour>0</hour>
|
||||
|
|
|
@ -52,7 +52,7 @@ public class TestSyndFeedAtom03 extends SyndFeedTest {
|
|||
|
||||
|
||||
protected void _testEntry(int i) throws Exception {
|
||||
List items = getCachedSyndFeed().getEntries();
|
||||
List<SyndEntry> items = getCachedSyndFeed().getEntries();
|
||||
SyndEntry entry = (SyndEntry) items.get(i);
|
||||
assertProperty(entry.getTitle(),"feed.entry["+i+"].title");
|
||||
assertProperty(entry.getLink(),"feed.entry["+i+"].link^href");
|
||||
|
|
|
@ -101,7 +101,7 @@ public class TestSyndFeedAtom03DCSyModules extends TestSyndFeedAtom03 {
|
|||
}
|
||||
|
||||
protected void _testEntryDCModule(int i) throws Exception {
|
||||
List entries = getCachedSyndFeed().getEntries();
|
||||
List<SyndEntry> entries = getCachedSyndFeed().getEntries();
|
||||
SyndEntry entry = (SyndEntry) entries.get(i);
|
||||
DCModule dc = (DCModule) entry.getModule(DCModule.URI);
|
||||
_testDCModule(dc,"feed.entry["+i+"].",true,i);
|
||||
|
|
|
@ -7,8 +7,9 @@ package com.sun.syndication.unittest;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.jdom2.Element;
|
||||
|
||||
import com.sun.syndication.feed.atom.Entry;
|
||||
import com.sun.syndication.feed.rss.Item;
|
||||
import com.sun.syndication.feed.synd.SyndContent;
|
||||
import com.sun.syndication.feed.synd.SyndEnclosure;
|
||||
import com.sun.syndication.feed.synd.SyndEntry;
|
||||
|
@ -39,7 +40,7 @@ public class TestSyndFeedAtom10 extends TestSyndFeedAtom03 {
|
|||
assertProperty(getCachedSyndFeed().getTitleEx().getValue(),"feed.title");
|
||||
assertEquals("html", getCachedSyndFeed().getTitleEx().getType());
|
||||
|
||||
List altLinks = getCachedSyndFeed().getLinks();
|
||||
List<SyndLink> altLinks = getCachedSyndFeed().getLinks();
|
||||
assertEquals(3, altLinks.size());
|
||||
|
||||
assertEquals("http://example.com/blog", ((SyndLink)altLinks.get(0)).getHref());
|
||||
|
@ -62,7 +63,7 @@ public class TestSyndFeedAtom10 extends TestSyndFeedAtom03 {
|
|||
}
|
||||
|
||||
public void testForeignMarkup() throws Exception {
|
||||
assertEquals(1, ((List)getCachedSyndFeed().getForeignMarkup()).size());
|
||||
assertEquals(1, ((List<Element>)getCachedSyndFeed().getForeignMarkup()).size());
|
||||
}
|
||||
|
||||
public void testPublishedDate() throws Exception {
|
||||
|
@ -72,7 +73,7 @@ public class TestSyndFeedAtom10 extends TestSyndFeedAtom03 {
|
|||
|
||||
|
||||
protected void _testEntry(int i) throws Exception {
|
||||
List items = getCachedSyndFeed().getEntries();
|
||||
List<SyndEntry> items = getCachedSyndFeed().getEntries();
|
||||
SyndEntry entry = (SyndEntry) items.get(i);
|
||||
|
||||
assertProperty(entry.getTitle(),"feed.entry["+i+"].title");
|
||||
|
@ -86,10 +87,10 @@ public class TestSyndFeedAtom10 extends TestSyndFeedAtom03 {
|
|||
assertEquals(entry.getPublishedDate(),d);
|
||||
assertProperty(entry.getDescription().getValue(),"feed.entry["+i+"].summary");
|
||||
assertProperty(((SyndContent)entry.getContents().get(0)).getValue(),"feed.entry["+i+"].content[0]");
|
||||
assertEquals(1, ((List)entry.getForeignMarkup()).size());
|
||||
assertEquals(1, ((List<Element>)entry.getForeignMarkup()).size());
|
||||
|
||||
if (i == 0) {
|
||||
List links = entry.getLinks();
|
||||
List<SyndLink> links = entry.getLinks();
|
||||
assertEquals(4, links.size());
|
||||
|
||||
assertEquals("http://example.com/blog/entry1", ((SyndLink)links.get(0)).getHref());
|
||||
|
|
|
@ -4,10 +4,6 @@ import com.sun.syndication.feed.synd.SyndEntry;
|
|||
import com.sun.syndication.feed.synd.SyndFeed;
|
||||
import com.sun.syndication.io.impl.Atom10Parser;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class TestSyndFeedAtom10Bray extends FeedTest {
|
||||
|
||||
protected void setUp() throws Exception {
|
||||
|
|
|
@ -4,8 +4,6 @@ import com.sun.syndication.feed.synd.SyndEntry;
|
|||
import com.sun.syndication.feed.synd.SyndFeed;
|
||||
import com.sun.syndication.io.impl.Atom10Parser;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
public class TestSyndFeedAtom10b extends FeedTest {
|
||||
|
@ -26,9 +24,8 @@ public class TestSyndFeedAtom10b extends FeedTest {
|
|||
}
|
||||
|
||||
public void testXmlBaseConformance() throws Exception {
|
||||
List errors = new ArrayList();
|
||||
SyndFeed feed = getSyndFeed(false);
|
||||
List entries = feed.getEntries();
|
||||
List<SyndEntry> entries = feed.getEntries();
|
||||
for (int index = 0; index < entries.size(); index++) {
|
||||
SyndEntry entry = (SyndEntry) entries.get(index);
|
||||
assertEquals(
|
||||
|
|
|
@ -1,15 +1,7 @@
|
|||
package com.sun.syndication.unittest;
|
||||
|
||||
import com.sun.syndication.feed.synd.SyndLink;
|
||||
import com.sun.syndication.feed.synd.SyndEntry;
|
||||
import com.sun.syndication.feed.synd.SyndEnclosure;
|
||||
import com.sun.syndication.feed.synd.SyndContent;
|
||||
import com.sun.syndication.feed.atom.Feed;
|
||||
import com.sun.syndication.feed.atom.Link;
|
||||
import com.sun.syndication.io.impl.DateParser;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
|
||||
public class TestSyndFeedAtom10prefix extends FeedTest {
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public class TestSyndFeedRSS090 extends SyndFeedTest {
|
|||
}
|
||||
|
||||
protected void _testItem(int i) throws Exception {
|
||||
List items = getCachedSyndFeed().getEntries();
|
||||
List<SyndEntry> items = getCachedSyndFeed().getEntries();
|
||||
SyndEntry entry = (SyndEntry) items.get(i);
|
||||
assertProperty(entry.getTitle(),"item["+i+"].title");
|
||||
assertProperty(entry.getLink(),"item["+i+"].link");
|
||||
|
|
|
@ -62,7 +62,7 @@ public class TestSyndFeedRSS091N extends SyndFeedTest {
|
|||
}
|
||||
|
||||
protected void _testItem(int i) throws Exception {
|
||||
List items = getCachedSyndFeed().getEntries();
|
||||
List<SyndEntry> items = getCachedSyndFeed().getEntries();
|
||||
SyndEntry entry = (SyndEntry) items.get(i);
|
||||
assertProperty(entry.getTitle(),"channel.item["+i+"].title");
|
||||
assertProperty(entry.getLink(),"channel.item["+i+"].link");
|
||||
|
|
|
@ -32,7 +32,7 @@ public class TestSyndFeedRSS092 extends TestSyndFeedRSS091N {
|
|||
|
||||
protected void _testItem(int i) throws Exception {
|
||||
super._testItem(i);
|
||||
List items = getCachedSyndFeed().getEntries();
|
||||
List<SyndEntry> items = getCachedSyndFeed().getEntries();
|
||||
SyndEntry entry = (SyndEntry) items.get(i);
|
||||
|
||||
assertProperty(entry.getTitle(),"channel.item["+i+"].title");
|
||||
|
@ -42,9 +42,9 @@ public class TestSyndFeedRSS092 extends TestSyndFeedRSS091N {
|
|||
_testEnclosures(entry.getEnclosures(),"channel.item["+i+"]");
|
||||
}
|
||||
|
||||
protected void _testCategories(List cats,String prefix) throws Exception {
|
||||
Set s1 = new HashSet();
|
||||
Set s2 = new HashSet();
|
||||
protected void _testCategories(List<SyndCategory> cats,String prefix) throws Exception {
|
||||
Set<String> s1 = new HashSet<String>();
|
||||
Set<String> s2 = new HashSet<String>();
|
||||
for (int i=0;i<cats.size();i++) {
|
||||
SyndCategory cat = (SyndCategory) cats.get(i);
|
||||
s1.add(cat.getTaxonomyUri()+" "+cat.getName());
|
||||
|
@ -53,9 +53,9 @@ public class TestSyndFeedRSS092 extends TestSyndFeedRSS091N {
|
|||
assertTrue(s1.equals(s2));
|
||||
}
|
||||
|
||||
protected void _testEnclosures(List encs,String prefix) throws Exception {
|
||||
Set s1 = new HashSet();
|
||||
Set s2 = new HashSet();
|
||||
protected void _testEnclosures(List<SyndEnclosure> encs,String prefix) throws Exception {
|
||||
Set<String> s1 = new HashSet<String>();
|
||||
Set<String> s2 = new HashSet<String>();
|
||||
for (int i=0;i<encs.size();i++) {
|
||||
SyndEnclosure enc = (SyndEnclosure) encs.get(i);
|
||||
s1.add(enc.getUrl()+" "+enc.getType()+" "+enc.getLength());
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
|
||||
package com.sun.syndication.unittest;
|
||||
|
||||
import com.sun.syndication.feed.synd.SyndCategory;
|
||||
import com.sun.syndication.feed.synd.SyndEntry;
|
||||
import com.sun.syndication.feed.synd.SyndEnclosure;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -19,9 +17,9 @@ public class TestSyndFeedRSS092Alt extends TestSyndFeedRSS092 {
|
|||
super(feedType,feedFileName);
|
||||
}
|
||||
|
||||
protected void _testEnclosures(List encs,String prefix) throws Exception {
|
||||
Set s1 = new HashSet();
|
||||
Set s2 = new HashSet();
|
||||
protected void _testEnclosures(List<SyndEnclosure> encs,String prefix) throws Exception {
|
||||
Set<String> s1 = new HashSet<String>();
|
||||
Set<String> s2 = new HashSet<String>();
|
||||
for (int i=0;i<encs.size();i++) {
|
||||
SyndEnclosure enc = (SyndEnclosure) encs.get(i);
|
||||
s1.add(enc.getUrl()+" "+enc.getType()+" "+enc.getLength());
|
||||
|
|
|
@ -30,7 +30,7 @@ public class TestSyndFeedRSS093 extends TestSyndFeedRSS092 {
|
|||
|
||||
protected void _testItem(int i) throws Exception {
|
||||
super._testItem(i);
|
||||
List items = getCachedSyndFeed().getEntries();
|
||||
List<SyndEntry> items = getCachedSyndFeed().getEntries();
|
||||
SyndEntry entry = (SyndEntry) items.get(i);
|
||||
Date d = DateParser.parseRFC822("Mon, 0"+(i+1)+" Jan 2001 00:00:00 GMT");
|
||||
assertEquals(entry.getPublishedDate(),d);
|
||||
|
|
|
@ -41,7 +41,7 @@ public class TestSyndFeedRSS094 extends TestSyndFeedRSS093 {
|
|||
protected void _testItem(int i) throws Exception {
|
||||
super._testItem(i);
|
||||
|
||||
List items = getCachedSyndFeed()
|
||||
List<SyndEntry> items = getCachedSyndFeed()
|
||||
.getEntries();
|
||||
SyndEntry entry = (SyndEntry) items.get(i);
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ public class TestSyndFeedRSS10 extends TestSyndFeedRSS090 {
|
|||
|
||||
protected void _testItem(int i) throws Exception {
|
||||
super._testItem(i);
|
||||
List items = getCachedSyndFeed().getEntries();
|
||||
List<SyndEntry> items = getCachedSyndFeed().getEntries();
|
||||
SyndEntry entry = (SyndEntry) items.get(i);
|
||||
assertProperty(entry.getDescription().getValue(),"item["+i+"].description");
|
||||
assertProperty(((SyndContent)entry.getContents().get(0)).getValue(), "item["+i+"].content");
|
||||
|
|
|
@ -96,7 +96,7 @@ public class TestSyndFeedRSS10DCMulti extends TestSyndFeedRSS10 {
|
|||
}
|
||||
|
||||
protected void _testItemDCModule(int i) throws Exception {
|
||||
List entries = getCachedSyndFeed().getEntries();
|
||||
List<SyndEntry> entries = getCachedSyndFeed().getEntries();
|
||||
SyndEntry entry = (SyndEntry) entries.get(i);
|
||||
DCModule dc = (DCModule) entry.getModule(DCModule.URI);
|
||||
_testDCModule(dc, "item[" + i + "].");
|
||||
|
|
|
@ -86,7 +86,7 @@ public class TestSyndFeedRSS10DCSyModules extends TestSyndFeedRSS10 {
|
|||
}
|
||||
|
||||
protected void _testItemDCModule(int i) throws Exception {
|
||||
List entries = getCachedSyndFeed().getEntries();
|
||||
List<SyndEntry> entries = getCachedSyndFeed().getEntries();
|
||||
SyndEntry entry = (SyndEntry) entries.get(i);
|
||||
DCModule dc = (DCModule) entry.getModule(DCModule.URI);
|
||||
_testDCModule(dc,"item["+i+"].");
|
||||
|
|
|
@ -32,7 +32,7 @@ public class TestSyndFeedRSS20 extends TestSyndFeedRSS094 {
|
|||
|
||||
protected void _testItem(int i) throws Exception {
|
||||
super._testItem(i);
|
||||
List items = getCachedSyndFeed().getEntries();
|
||||
List<SyndEntry> items = getCachedSyndFeed().getEntries();
|
||||
SyndEntry entry = (SyndEntry) items.get(i);
|
||||
assertProperty(((SyndContent)entry.getContents().get(0)).getValue(), "channel.item["+i+"].content");
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ package com.sun.syndication.unittest;
|
|||
import com.sun.syndication.io.XmlReader;
|
||||
import com.sun.syndication.io.impl.XmlFixerReader;
|
||||
import junit.framework.TestCase;
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
|
||||
import java.io.*;
|
||||
|
||||
|
|
|
@ -247,7 +247,7 @@ public class TestXmlReader extends TestCase {
|
|||
private static final int[] UTF_16LE_BOM_BYTES = {0xFF,0XFE};
|
||||
private static final int[] UTF_8_BOM_BYTES = {0xEF,0xBB,0xBF};
|
||||
|
||||
private static final Map BOMs = new HashMap();
|
||||
private static final Map<String, int[]> BOMs = new HashMap<String, int[]>();
|
||||
|
||||
static {
|
||||
BOMs.put("no-bom",NO_BOM_BYTES);
|
||||
|
@ -271,7 +271,7 @@ public class TestXmlReader extends TestCase {
|
|||
private static final MessageFormat INFO = new MessageFormat(
|
||||
"\nBOM : {0}\nDoc : {1}\nStream Enc : {2}\nProlog Enc : {3}\n");
|
||||
|
||||
private static final Map XMLs = new HashMap();
|
||||
private static final Map<String, MessageFormat> XMLs = new HashMap<String, MessageFormat>();
|
||||
|
||||
static {
|
||||
XMLs.put(XML1, XML);
|
||||
|
|
|
@ -20,7 +20,7 @@ import com.sun.syndication.io.impl.XmlFixerReader;
|
|||
import com.sun.syndication.io.XmlReader;
|
||||
import com.sun.syndication.unittest.SyndFeedTest;
|
||||
|
||||
import org.jdom.input.SAXBuilder;
|
||||
import org.jdom2.input.SAXBuilder;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.ByteArrayInputStream;
|
||||
|
|
Loading…
Reference in a new issue