Package org.jboss.aesh.cl.internal

Examples of org.jboss.aesh.cl.internal.ProcessedCommandBuilder


    private static AeshCommandContainer doGenerateCommandLineParser(Object commandObject,
                                                                    boolean clazzIsaCommand, boolean isChild) throws CommandLineParserException {
        Class clazz = commandObject.getClass();
        CommandDefinition command = (CommandDefinition) clazz.getAnnotation(CommandDefinition.class);
        if(command != null) {
            ProcessedCommand processedCommand = new ProcessedCommandBuilder()
                    .name(command.name())
                    .description(command.description())
                    .validator(command.validator())
                    .resultHandler(command.resultHandler()).create();

            processCommand(processedCommand, clazz);

            if(clazzIsaCommand)
                return new AeshCommandContainer(
                        new CommandLineParserBuilder()
                                .processedCommand(processedCommand)
                                .command((Command) commandObject)
                                .create());
            else
                return new AeshCommandContainer(
                        new CommandLineParserBuilder()
                                .processedCommand(processedCommand)
                                .create());
        }
        GroupCommandDefinition groupCommand = (GroupCommandDefinition) clazz.getAnnotation(GroupCommandDefinition.class);
        if(groupCommand != null) {
            ProcessedCommand processedGroupCommand = new ProcessedCommandBuilder()
                    .name(groupCommand.name())
                    .description(groupCommand.description())
                    .validator(groupCommand.validator())
                    .resultHandler(groupCommand.resultHandler())
                    .create();
View Full Code Here


        }
        return parser;
    }

    private ProcessedCommand generateProcessedCommand() throws CommandLineParserException {
        return new ProcessedCommandBuilder()
                .name(name)
                .description(description)
                .addOptions(options)
                .resultHandler(resultHandler)
                .validator(validator)
View Full Code Here

TOP

Related Classes of org.jboss.aesh.cl.internal.ProcessedCommandBuilder

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.