Blame view

src/main/java/pl/it_crowd/youtrack/api/YoutrackUnmarshaller.java 773 Bytes
bernard authored
1
package pl.it_crowd.youtrack.api;
bernard authored
2
bernard authored
3
import pl.it_crowd.youtrack.api.rest.ObjectFactory;
bernard authored
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import java.io.Reader;
import java.io.StringReader;

public final class YoutrackUnmarshaller {
// -------------------------- STATIC METHODS --------------------------

    public static Object unmarshall(String string) throws JAXBException
    {
        return unmarshall(new StringReader(string));
    }

    public static Object unmarshall(Reader reader) throws JAXBException
    {
        return JAXBContext.newInstance(ObjectFactory.class).createUnmarshaller().unmarshal(reader);
    }

// --------------------------- CONSTRUCTORS ---------------------------

    private YoutrackUnmarshaller()
    {
    }
}