All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.javastro.ivoa.jaxb.SchemaGenerator Maven / Gradle / Ivy

The newest version!
/*
 * $Id$
 * 
 * Created on 26 Oct 2013 by Paul Harrison ([email protected])
 * Copyright 2013 Manchester University. All rights reserved.
 *
 * This software is published under the terms of the Academic 
 * Free License, a copy of which has been included 
 * with this distribution in the LICENSE.txt file.  
 *
 */

package org.javastro.ivoa.jaxb;

import java.io.IOException;

import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.SchemaOutputResolver;


/**
 * Generate schema from the JAXB models.
 * 
 * @author Paul Harrison ([email protected]) 26 Oct 2013
 * @version $Revision$ $date$
 */
public class SchemaGenerator {

    
    public void generate(String context) throws JAXBException, IOException
    {
        generate(context,new SchemaNamer());
    }
   
    public void generate(String contextPath,SchemaOutputResolver sor) throws JAXBException, IOException {
        jakarta.xml.bind.JAXBContext jaxbContext = JAXBContext
                .newInstance(contextPath);
        System.out.println("generating schema for regtap");
        jaxbContext.generateSchema(sor);
    }

    public static void main(String[] args) {
        SchemaGenerator sg = new SchemaGenerator();
        try {
            sg.generate(args[0]);
        } catch (JAXBException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}

/*
 * $Log$
 */




© 2015 - 2025 Weber Informatics LLC | Privacy Policy