com.github.fedy2.weather.binding.RSSParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of yahoo-weather-java-api Show documentation
Show all versions of yahoo-weather-java-api Show documentation
A Java library for the yahoo weather RSS feed service
/**
*
*/
package com.github.fedy2.weather.binding;
import java.io.StringReader;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Unmarshaller;
import com.github.fedy2.weather.data.Rss;
/**
* @author "Federico De Faveri [email protected]"
*
*/
public class RSSParser {
protected Unmarshaller unmarshaller;
public RSSParser() throws JAXBException
{
JAXBContext context = JAXBContext.newInstance(Rss.class);
unmarshaller = context.createUnmarshaller();
}
public Rss parse(String xml) throws JAXBException
{
return (Rss)unmarshaller.unmarshal(new StringReader(xml));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy