This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ReportDefintionBase { | |
public static final String T = "t"; | |
public static final String F = "f"; | |
public final String toXMLString() { | |
StringWriter stringWriter = new StringWriter(); | |
Marshaller marshaller = null; | |
try { | |
marshaller = JAXBContext.newInstance(this.getClass()).createMarshaller(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class XmlHelper { | |
private static Logger logger = LoggerFactory.getLogger(XmlHelper.class); | |
public static <T> T fromXml(String xml, Class<?> clazz) { | |
Unmarshaller um = null; | |
try { | |
um = JAXBContext.newInstance(clazz).createUnmarshaller(); | |
Object obj = um.unmarshal(new StringReader(xml)); | |
return (T) obj; |