Create new Context for JAXB - Java XML

Java examples for XML:JAXB

Description

Create new Context for JAXB

Demo Code


//package com.java2s;

import javax.xml.bind.JAXBContext;

public class Main {
    public static void main(String[] argv) throws Exception {
        Class classJAXB = String.class;
        System.out.println(newContext(classJAXB));
    }//ww  w  .ja  v a 2s  .co  m

    private static JAXBContext newContext(Class<?> classJAXB)
            throws Exception {
        return JAXBContext.newInstance(classJAXB);
    }
}

Related Tutorials