Java XML JAXB Unmarshaller createUnmarshaller()

Here you can find the source of createUnmarshaller()

Description

create Unmarshaller

License

Open Source License

Declaration

private static Unmarshaller createUnmarshaller() throws JAXBException 

Method Source Code

//package com.java2s;
/*//w  ww.j a  va2 s  . com
 * @(#)GmlHelper.java   
 *
 * Copyright (C) 2010 www.interpss.org
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE
 * as published by the Free Software Foundation; either version 2.1
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * @Author Mike Zhou
 * @Version 1.0
 * @Date 08/15/2010
 * 
 *   Revision History
 *   ================
 *
 */

import javax.xml.bind.JAXBContext;

import javax.xml.bind.JAXBException;

import javax.xml.bind.Unmarshaller;

public class Main {
    private static final String Gml_NS = "org.graphdrawing.gml";
    private static Unmarshaller unmarshaller = null;

    private static Unmarshaller createUnmarshaller() throws JAXBException {
        if (unmarshaller == null) {
            JAXBContext jaxbContext = JAXBContext.newInstance(Gml_NS);
            unmarshaller = jaxbContext.createUnmarshaller();
        }
        return unmarshaller;
    }
}

Related

  1. castUnmarshalled(Object unmarshalled, Class clazz)
  2. closeUnmarshaller(Unmarshaller u)
  3. createUnmarshaller()
  4. createUnmarshaller()
  5. createUnmarshaller(Class jaxbBindClass)
  6. createUnmarshaller(Class clazz)
  7. createUnmarshaller(Class clazz)
  8. createUnmarshaller(Class clazz)