mil.dod.th.ose.jaxb.proto.converter/src/mil/dod/th/ose/jaxbprotoconverter/main/JaxbToProtoConverterMain.java
public void process(final File xsdFilesDir, final File protoDestPath, final File javaDestPath, 
            final String baseProtoPackageName, final String enumConvertersPackageName, 
            final String importableProtoPath) throws JaxbProtoConvertException
    {
        System.out.format("Generating proto files to %s%n", protoDestPath);
        System.out.format("Generating Java files to %s%n", javaDestPath);
        
        final DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
        final DocumentBuilder docBuilder;
        try
        {
            docBuilder = builderFactory.newDocumentBuilder();
        }
        catch (final ParserConfigurationException ex)
        {
            throw new JaxbProtoConvertException(ex);
        }
        
        final XsdModel xsdModel;
        try
        {
            xsdModel = m_XsdParser.parseXsdFiles(docBuilder, xsdFilesDir, createXsdFileList(xsdFilesDir));
        }
        catch (final ClassNotFoundException | ParserConfigurationException | SAXException | IOException ex)
        {
            throw new JaxbProtoConvertException(ex);
        }
        Map<String, String> imports = new HashMap<String, String>();
        try
        {
            imports = m_ProtoFileParser.parseProtoFilesForTypes(importableProtoPath);
        }
        catch (final IOException ex)
        {
            throw new JaxbProtoConvertException(ex);
        }
        final ProtoModel protoModel = 
                m_JaxbClassParser.parseJaxbClasses(xsdModel, imports, xsdFilesDir);
        try
        {
            m_ProtoFileGenerator.generateProtoFiles(protoModel, xsdFilesDir, protoDestPath, baseProtoPackageName);
        }
        catch (final IOException ex)
        {
            throw new JaxbProtoConvertException(ex);
        }

        final String enumConvertersPath = String.format(PKG_PATH_FORMAT, javaDestPath.getPath(),
                enumConvertersPackageName.replace('.', File.separatorChar));
        final File enumConvertersDir = m_FileService.getFile(enumConvertersPath);
        try
        {
            m_ProtoEnumToConverterFile.generateEnumConverters(protoModel, enumConvertersDir, xsdFilesDir, 
                    "EnumConverter", baseProtoPackageName, enumConvertersPackageName);
        }
        catch (final FileNotFoundException exception)
        {
            throw new JaxbProtoConvertException(exception);
        }
    }
/**
     * Process the JAXB classes and create proto files from them.
     * 
     * @param xsdFilesDir
     *      directory where XSD files that should be parsed are located.
     * @param protoDestPath
     *      where to put the generated proto files
     * @param javaDestPath
     *      where to put the generated Java files
     * @param baseProtoPackageName
     *      Java package name to use for the proto message files
     * @param enumConvertersPackageName
     *      Java package name to use for the enumeration converters
     * @param importableProtoPath
     *      path containing proto files that can be referenced by proto files being created
     * @throws JaxbProtoConvertException
     *      if there is a problem processing the JAXB classes
     */
Process the JAXB classes and create proto files from them.

@param xsdFilesDir
directory where XSD files that should be parsed are located.
Process the JAXB classes and create proto files from them . @param xsdFilesDir directory where XSD files that should be parsed are located .
public void process(final File xsdFilesDir, final File protoDestPath, final File javaDestPath, 
            final String baseProtoPackageName, final String enumConvertersPackageName, 
            final String importableProtoPath) throws JaxbProtoConvertException
    {
        System.out.format("Generating proto files to %s%n", protoDestPath);
        System.out.format("Generating Java files to %s%n", javaDestPath);
        final DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
        final DocumentBuilder docBuilder;
        try
        {
            docBuilder = builderFactory.newDocumentBuilder();
        }
        catch (final ParserConfigurationException ex)
        {
            throw new JaxbProtoConvertException(ex);
        }
        final XsdModel xsdModel;
        try
        {
            xsdModel = m_XsdParser.parseXsdFiles(docBuilder, xsdFilesDir, createXsdFileList(xsdFilesDir));
        }
        catch (final ClassNotFoundException | ParserConfigurationException | SAXException | IOException ex)
        {
            throw new JaxbProtoConvertException(ex);
        }
        Map<String, String> imports = new HashMap<String, String>();
        try
        {
            imports = m_ProtoFileParser.parseProtoFilesForTypes(importableProtoPath);
        }
        catch (final IOException ex)
        {
            throw new JaxbProtoConvertException(ex);
        }
        final ProtoModel protoModel = 
                m_JaxbClassParser.parseJaxbClasses(xsdModel, imports, xsdFilesDir);
        try
        {
            m_ProtoFileGenerator.generateProtoFiles(protoModel, xsdFilesDir, protoDestPath, baseProtoPackageName);
        }
        catch (final IOException ex)
        {
            throw new JaxbProtoConvertException(ex);
        }
        final String enumConvertersPath = String.format(PKG_PATH_FORMAT, javaDestPath.getPath(),
                enumConvertersPackageName.replace('.', File.separatorChar));
        final File enumConvertersDir = m_FileService.getFile(enumConvertersPath);
        try
        {
            m_ProtoEnumToConverterFile.generateEnumConverters(protoModel, enumConvertersDir, xsdFilesDir, 
                    "EnumConverter", baseProtoPackageName, enumConvertersPackageName);
        }
        catch (final FileNotFoundException exception)
        {
            throw new JaxbProtoConvertException(exception);
        }
    }
public void process ( final File xsdFilesDir , final File protoDestPath , final File javaDestPath , final String baseProtoPackageName , final String enumConvertersPackageName , final String importableProtoPath ) throws JaxbProtoConvertException { System . out . format ( "Generating proto files to %s%n" , protoDestPath ) ; System . out . format ( "Generating Java files to %s%n" , javaDestPath ) ; final DocumentBuilderFactory builderFactory = DocumentBuilderFactory . newInstance ( ) ; final DocumentBuilder docBuilder ; try { docBuilder = builderFactory . newDocumentBuilder ( ) ; } catch ( final ParserConfigurationException ex ) { throw new JaxbProtoConvertException ( ex ) ; } final XsdModel xsdModel ; try { xsdModel = m_XsdParser . parseXsdFiles ( docBuilder , xsdFilesDir , createXsdFileList ( xsdFilesDir ) ) ; } catch ( final ClassNotFoundException | ParserConfigurationException | SAXException | IOException ex ) { throw new JaxbProtoConvertException ( ex ) ; } Map < String , String > imports = new HashMap < String , String > ( ) ; try { imports = m_ProtoFileParser . parseProtoFilesForTypes ( importableProtoPath ) ; } catch ( final IOException ex ) { throw new JaxbProtoConvertException ( ex ) ; } final ProtoModel protoModel = m_JaxbClassParser . parseJaxbClasses ( xsdModel , imports , xsdFilesDir ) ; try { m_ProtoFileGenerator . generateProtoFiles ( protoModel , xsdFilesDir , protoDestPath , baseProtoPackageName ) ; } catch ( final IOException ex ) { throw new JaxbProtoConvertException ( ex ) ; } final String enumConvertersPath = String . format ( PKG_PATH_FORMAT , javaDestPath . getPath ( ) , enumConvertersPackageName . replace ( '.' , File . separatorChar ) ) ; final File enumConvertersDir = m_FileService . getFile ( enumConvertersPath ) ; try { m_ProtoEnumToConverterFile . generateEnumConverters ( protoModel , enumConvertersDir , xsdFilesDir , "EnumConverter" , baseProtoPackageName , enumConvertersPackageName ) ; } catch ( final FileNotFoundException exception ) { throw new JaxbProtoConvertException ( exception ) ; } }
Process the JAXB classes and create proto files from them.
Process the JAXB classes and create proto files from them .