Java XML JAXB Marshaller createMarshaller()

Here you can find the source of createMarshaller()

Description

create Marshaller

License

Educational Community License

Declaration

private static Marshaller createMarshaller() throws JAXBException 

Method Source Code

//package com.java2s;
//License from project: Educational Community License 

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;

public class Main {
    private static JAXBContext context;

    private static Marshaller createMarshaller() throws JAXBException {
        return getContext().createMarshaller();
    }/*  ww w .  j  a v a 2  s  .c o  m*/

    private static JAXBContext getContext() throws JAXBException {
        // although not thread-safe, the worst that happens is double instantiation
        if (context == null) {
            context = JAXBContext.newInstance("org.opentestsystem.rdw.common.model.trt");
        }
        return context;
    }
}

Related

  1. createJAXBMarshaller(JAXBContext jaxbContext)
  2. createMarshall(String pkgName)
  3. createMarshaller(Class clazz, Map settings)
  4. createMarshaller(Class clazz)
  5. createMarshaller(JAXBContext context)
  6. createMarshaller(JAXBContext ctx, boolean indent)