Java examples for XML:JAXB
new Marshaller for JAXB
//package com.java2s; import javax.xml.bind.JAXBContext; import javax.xml.bind.Marshaller; public class Main { public static void main(String[] argv) throws Exception { Class classJAXB = String.class; System.out.println(newMarshaller(classJAXB)); }/*from w ww . j av a 2 s. co m*/ private static Marshaller newMarshaller(Class<?> classJAXB) throws Exception { return newContext(classJAXB).createMarshaller(); } private static JAXBContext newContext(Class<?> classJAXB) throws Exception { return JAXBContext.newInstance(classJAXB); } }