com.vaushell.sampleexec.App.java Source code

Java tutorial

Introduction

Here is the source code for com.vaushell.sampleexec.App.java

Source

/*
 * Copyright (C) 2013 Fabien Vauchelles (fabien_AT_vauchelles_DOT_com).
 *
 * This library 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 3, 29 June 2007, of the License, or (at your option) any later version.
 *
 * This library 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
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 * MA 02110-1301  USA
 */

package com.vaushell.sampleexec;

import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.configuration.XMLConfiguration;

/**
 * Main class.
 *
 * @author Fabien Vauchelles (fabien_AT_vauchelles_DOT_com)
 */
public final class App {
    // PUBLIC
    /**
     * Main method.
     *
     * @param args Command line arguments
     * @throws ConfigurationException
     */
    public static void main(final String... args) throws ConfigurationException {
        // My config
        final XMLConfiguration config;
        if (args.length > 0) {
            config = new XMLConfiguration(args[0]);
        } else {
            config = new XMLConfiguration("conf/configuration.xml");
        }

        // Declare
        final MyExemple ex = new MyExemple();

        // Init
        ex.init(config);

        // Show first page
        ex.showFirstPage();

    }

    // PRIVATE
    private App() {
        // Nothing
    }
}