com.lindar.wellrested.xml.WellRestedXMLUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of well-rested-client Show documentation
Show all versions of well-rested-client Show documentation
A nice and easy java http client wrapper built on top of apache httpclient
package com.lindar.wellrested.xml;
import java.io.StringReader;
import java.io.StringWriter;
import javax.xml.bind.JAXB;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class WellRestedXMLUtil {
public static String fromObjectToString(T xmlObject) {
StringWriter sw = new StringWriter();
JAXB.marshal(xmlObject, sw);
return sw.toString();
}
public static T fromStringToObject(String xmlString, Class xmlObjClass) {
return JAXB.unmarshal(new StringReader(xmlString), xmlObjClass);
}
private WellRestedXMLUtil() {
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy