@@ -0,0 +1,3354 @@
+/*%0A * The MIT License (MIT)%0A *%0A * Copyright (c) 2015 Ivan Maslov%0A *%0A * Permission is hereby granted, free of charge, to any person obtaining a copy%0A * of this software and associated documentation files (the %22Software%22), to deal%0A * in the Software without restriction, including without limitation the rights%0A * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A * copies of the Software, and to permit persons to whom the Software is%0A * furnished to do so, subject to the following conditions:%0A *%0A * The above copyright notice and this permission notice shall be included in all%0A * copies or substantial portions of the Software.%0A *%0A * THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE%0A * SOFTWARE.%0A */%0A%0Apackage info.maslowis.twitterripper.jcommander;%0A%0Aimport com.beust.jcommander.JCommander;%0Aimport info.maslowis.twitterripper.command.Command;%0Aimport info.maslowis.twitterripper.command.impl.Clear;%0Aimport info.maslowis.twitterripper.command.impl.Exit;%0Aimport info.maslowis.twitterripper.command.impl.Help;%0Aimport info.maslowis.twitterripper.command.impl.twitter.*;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A/**%0A * Factory for %7B@link com.beust.jcommander.JCommander%7D%0A * %3Cp/%3E%0A * %3Cp%3E%3Cem%3EThis class should not be instancing.%3C/em%3E It provide a static factory method.%3C/p%3E%0A *%0A * @author Ivan Maslov%0A */%0Apublic final class JCommanderFactory %7B%0A%0A    private JCommanderFactory() %7B%0A    %7D%0A%0A    /**%0A     * Returns new instance %7B@link com.beust.jcommander.JCommander%7D with available commandNames for application%0A     *%0A     * @return %7B@link com.beust.jcommander.JCommander%7D%0A     */%0A    public static JCommander getInstance() %7B%0A        JCommander jCommander = new JCommander();%0A        for (Command command : getCommands()) %7B%0A            jCommander.addCommand(command.getName(), command, command.getAliases());%0A        %7D%0A        return jCommander;%0A    %7D%0A%0A    /*Initialize available commands*/%0A    private static List%3CCommand%3E getCommands() %7B%0A        List%3CCommand%3E commands = new ArrayList%3C%3E();%0A        /*Twitter commands*/%0A        commands.add(new UserSearch());%0A        commands.add(new TweetShow());%0A        commands.add(new TweetDelete());%0A        commands.add(new TweetDeleteAll());%0A        commands.add(new TweetAdd());%0A        commands.add(new TimelineGetId());%0A        commands.add(new TimelineGetName());%0A        commands.add(new FriendUpdateId());%0A        commands.add(new FriendUpdateName());%0A        commands.add(new FriendUpdateName());%0A        commands.add(new FriendGetId());%0A        commands.add(new FriendGetName());%0A        commands.add(new FriendDeleteId());%0A        commands.add(new FriendDeleteName());%0A        commands.add(new FriendDeleteAll());%0A        commands.add(new FriendAddId());%0A        commands.add(new FriendAddName());%0A        /*Common commands*/%0A        commands.add(new Help());%0A        commands.add(new Clear());%0A        commands.add(new Exit());%0A        return commands;%0A    %7D%0A%7D%0A

Add factory for JCommander