Package org.apache.maven.doxia

Examples of org.apache.maven.doxia.Converter


        if ( showErrors )
        {
            System.out.println( "+ Error stacktraces are turned on." );
        }

        Converter converter = new DefaultConverter();
        Log log = new SystemStreamLog();
        if ( debug )
        {
            log.setLogLevel( Log.LEVEL_DEBUG );
        }
        converter.enableLogging( log );

        InputFileWrapper input;
        OutputFileWrapper output;
        try
        {
            input =
                InputFileWrapper.valueOf( commandLine.getOptionValue( CLIManager.IN ),
                                          commandLine.getOptionValue( CLIManager.FROM ),
                                          commandLine.getOptionValue( CLIManager.INENCODING ),
                                          converter.getInputFormats() );
            output =
                OutputFileWrapper.valueOf( commandLine.getOptionValue( CLIManager.OUT ),
                                           commandLine.getOptionValue( CLIManager.TO ),
                                           commandLine.getOptionValue( CLIManager.OUTENCODING ),
                                           converter.getOutputFormats() );
        }
        catch ( IllegalArgumentException e )
        {
            showFatalError( "Illegal argument: " + e.getMessage(), e, showErrors );

            CLIManager.displayHelp();

            return 1;
        }
        catch ( UnsupportedEncodingException e )
        {
            showFatalError( e.getMessage(), e, showErrors );

            return 1;
        }
        catch ( FileNotFoundException e )
        {
            showFatalError( e.getMessage(), e, showErrors );

            return 1;
        }

        boolean format = commandLine.hasOption( CLIManager.FORMAT );
        converter.setFormatOutput( format );

        try
        {
            converter.convert( input, output );
        }
        catch ( UnsupportedFormatException e )
        {
            showFatalError( e.getMessage(), e, showErrors );
View Full Code Here

TOP

Related Classes of org.apache.maven.doxia.Converter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.