Java XML JAXB Marshaller getMarshaller()

Here you can find the source of getMarshaller()

Description

get Marshaller

License

Open Source License

Declaration

private static Marshaller getMarshaller() throws JAXBException 

Method Source Code


//package com.java2s;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;

public class Main {
    private static JAXBContext jaxbContext;
    private static ThreadLocal<Marshaller> marshaller = new ThreadLocal<Marshaller>();

    private static Marshaller getMarshaller() throws JAXBException {
        Marshaller m = marshaller.get();
        if (m == null) {
            m = jaxbContext.createMarshaller();
            marshaller.set(m);//from   w ww .jav a2s  . c o  m
        }
        return m;
    }
}

Related

  1. createMarshaller(JAXBContext context)
  2. createMarshaller(JAXBContext ctx, boolean indent)
  3. createMarshaller(Object object)
  4. createMarshaller(String pack)
  5. getJSIDLMarshaller()
  6. getMarshaller()
  7. getMarshaller(boolean prettyFormat)
  8. getMarshaller(Class c)
  9. getMarshaller(Class clazz)