public com.sun.syndication.feed.module.Module parse(org.jdom2.Element element) {
AbstractITunesObject module = null;
if (element.getName().equals("channel")) {
FeedInformationImpl feedInfo = new FeedInformationImpl();
module = feedInfo;
//Now I am going to get the channel specific tags
Element owner = element.getChild("owner", ns);
if (owner != null) {
Element name = owner.getChild("name", ns);
if (name != null) {
feedInfo.setOwnerName(name.getValue().trim());
}
Element email = owner.getChild("email", ns);
if (email != null) {
feedInfo.setOwnerEmailAddress(email.getValue().trim());
}
}
Element image = element.getChild("image", ns);
if ((image != null) && (image.getAttributeValue("href") != null)) {
try {
URL imageURL = new URL(image.getAttributeValue("href").trim());
feedInfo.setImage(imageURL);
} catch (MalformedURLException e) {
log.finer("Malformed URL Exception reading itunes:image tag: " + image.getAttributeValue("href"));
}
}
List categories = element.getChildren("category", ns);
for (Iterator it = categories.iterator(); it.hasNext();) {
Element category = (Element) it.next();
if ((category != null) && (category.getAttribute("text") != null)) {
Category cat = new Category();
cat.setName(category.getAttribute("text").getValue().trim());
Element subcategory = category.getChild("category", ns);
if (subcategory != null && subcategory.getAttribute("text") != null) {
Subcategory subcat = new Subcategory();
subcat.setName(subcategory.getAttribute("text").getValue().trim());
cat.setSubcategory(subcat);
}
feedInfo.getCategories().add(cat);
}
}
} else if (element.getName().equals("item")) {
EntryInformationImpl entryInfo = new EntryInformationImpl();