importjavax.xml.bind.JAXBContext;importjavax.xml.bind.JAXBElement;importjavax.xml.bind.JAXBException;importjava.io.IOException;importjava.io.Reader;importjava.io.StringReader;//TODO methods from this class should be probably merged with YoutrackUnmarshallerpublicfinalclassErrorUnmarshaller{// -------------------------- STATIC METHODS --------------------------publicstaticStringunmarshal(Stringstring)throwsJAXBException,IOException{returnunmarshal(newStringReader(string));}publicstaticStringunmarshal(Readerreader)throwsJAXBException,IOException{Stringcontent=IOUtils.toString(reader);try{JAXBContextjaxbContext=JAXBContext.newInstance(ObjectFactory.class);@SuppressWarnings("unchecked")finalJAXBElement<String>element=(JAXBElement<String>)jaxbContext.createUnmarshaller().unmarshal(newStringReader(content));returnelement.getValue();}catch(JAXBExceptione){// TODO we need logging hereSystem.err.println("Cannot unmarshal input stream.\n"+content+e);throwe;}}// --------------------------- CONSTRUCTORS ---------------------------privateErrorUnmarshaller(){}}