src/main/java/org/jboss/loom/utils/XmlUtils.java
public static Marshaller createMarshaller( Class cls ) throws JAXBException {
        Map<String, Object> props = new HashMap();
        props.put( Marshaller.JAXB_FORMATTED_OUTPUT, true );
        props.put( Marshaller.JAXB_ENCODING, "UTF-8");
        //marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://www.jboss.org/schema/swanloom.xsd swanloom.xsd");
        JAXBContext jc = org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(new Class[]{cls}, props);
        
        // JDK way: Marshaller mar = JAXBContext.newInstance(MigrationReportJaxbBean.class).createMarshaller();
        
        return jc.createMarshaller();
    }
/**
     *  Creates this app's standard marshaller.
     *  TODO: Use it in methods below.
     */
Creates this app's standard marshaller.
TODO: Use it in methods below.
Creates this app ' s standard marshaller . TODO : Use it in methods below .
public static Marshaller createMarshaller( Class cls ) throws JAXBException {
        Map<String, Object> props = new HashMap();
        props.put( Marshaller.JAXB_FORMATTED_OUTPUT, true );
        props.put( Marshaller.JAXB_ENCODING, "UTF-8");
        JAXBContext jc = org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(new Class[]{cls}, props);
        return jc.createMarshaller();
    }
public static Marshaller createMarshaller ( Class cls ) throws JAXBException { Map < String , Object > props = new HashMap ( ) ; props . put ( Marshaller . JAXB_FORMATTED_OUTPUT , true ) ; props . put ( Marshaller . JAXB_ENCODING , "UTF-8" ) ; JAXBContext jc = org . eclipse . persistence . jaxb . JAXBContextFactory . createContext ( new Class [ ] { cls } , props ) ; return jc . createMarshaller ( ) ; }
Creates this app's standard marshaller.
Creates this app ' s standard marshaller .
//marshaller.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://www.jboss.org/schema/swanloom.xsd swanloom.xsd"); // JDK way: Marshaller mar = JAXBContext.newInstance(MigrationReportJaxbBean.class).createMarshaller();