// Path: src/main/java/nl/ulso/sprox/ParseException.java
// public final class ParseException extends XmlProcessorException {
//     public ParseException(Class resultClass, String value) {
//         super(createMessage(resultClass, value));
//     }
// 
//     public ParseException(Class resultClass, String value, Throwable cause) {
//         super(createMessage(resultClass, value), cause);
//     }
// 
//     private static String createMessage(Class resultClass, String value) {
//         return "Could not parse string \"" + value + "\" into a value of type \"" + resultClass + "\"";
//     }
// }
// 
// Path: src/main/java/nl/ulso/sprox/Parser.java
// public interface Parser<T> {
// 
//     /**
//      * Parses a string value into a specific type.
//      *
//      * @param value String value to parse.
//      * @return The result of parsing the value.
//      * @throws ParseException If the value could not be parsed.
//      */
//     T fromString(String value) throws ParseException;
// }


import nl.ulso.sprox.ParseException;
import nl.ulso.sprox.Parser;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
package nl.ulso.sprox.opml;


public class Rfc822DateTimeParser implements Parser<DateTime> {

    // Not sure if this pattern is completely correct, but all dates in the test data are parsed correctly.
    private static final DateTimeFormatter parser = DateTimeFormat.forPattern("EEE, dd MMM YYYY HH:mm:ss ZZZ");

    public DateTime fromString(String value) throws ParseException {
        try {
            return parser.parseDateTime(value);
// Path: src/main/java/nl/ulso/sprox/ParseException.java
// public final class ParseException extends XmlProcessorException {
//     public ParseException(Class resultClass, String value) {
//         super(createMessage(resultClass, value));
//     }
// 
//     public ParseException(Class resultClass, String value, Throwable cause) {
//         super(createMessage(resultClass, value), cause);
//     }
// 
//     private static String createMessage(Class resultClass, String value) {
//         return "Could not parse string \"" + value + "\" into a value of type \"" + resultClass + "\"";
//     }
// }
// 
// Path: src/main/java/nl/ulso/sprox/Parser.java
// public interface Parser<T> {
// 
//     /**
//      * Parses a string value into a specific type.
//      *
//      * @param value String value to parse.
//      * @return The result of parsing the value.
//      * @throws ParseException If the value could not be parsed.
//      */
//     T fromString(String value) throws ParseException;
// }


// Path: src/test/java/nl/ulso/sprox/opml/Rfc822DateTimeParser.java
import nl.ulso.sprox.ParseException;
import nl.ulso.sprox.Parser;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

package nl.ulso.sprox.opml;


public class Rfc822DateTimeParser implements Parser<DateTime> {

    // Not sure if this pattern is completely correct, but all dates in the test data are parsed correctly.
    private static final DateTimeFormatter parser = DateTimeFormat.forPattern("EEE, dd MMM YYYY HH:mm:ss ZZZ");

    public DateTime fromString(String value) throws ParseException {
        try {
            return parser.parseDateTime(value);
        } catch (IllegalArgumentException e) {