Package org.jboss.forge.shell.plugins

Examples of org.jboss.forge.shell.plugins.DefaultCommand


               commandMeta.setDefault(true);
               commandMeta.setName(pluginMeta.getName());

               // favor help text from this annotation over others
               DefaultCommand def = Annotations.getAnnotation(method, DefaultCommand.class);
               if ((def.help() != null) && !def.help().trim().isEmpty())
               {
                  commandMeta.setHelp(def.help());
               }
            }

            if (Annotations.isAnnotationPresent(method, RequiresResource.class))
            {
View Full Code Here


               commandMeta.setDefault(true);
               commandMeta.setName(pluginMeta.getName());

               // favor help text from this annotation over others
               DefaultCommand def = Annotations.getAnnotation(method, DefaultCommand.class);
               if ((def.help() != null) && !def.help().trim().isEmpty())
               {
                  commandMeta.setHelp(def.help());
               }
            }

            // This works because @SetupCommand is annotated by @Command
            if (Annotations.isAnnotationPresent(method, SetupCommand.class))
            {
               if (pluginMeta.hasSetupCommand())
               {
                  throw new IllegalStateException("Plugins may only have one @"
                           + SetupCommand.class.getSimpleName()
                           + ", but [" + pluginMeta.getType() + "] has more than one.");
               }

               commandMeta.setSetup(true);
               commandMeta.setName("setup");

               // favor help text from this annotation over others
               SetupCommand def = Annotations.getAnnotation(method, SetupCommand.class);
               if ((def.help() != null) && !def.help().trim().isEmpty())
               {
                  commandMeta.setHelp(def.help());
               }
            }

            /*
             * We don't want to do this if it is a setup command.
View Full Code Here

               commandMeta.setDefault(true);
               commandMeta.setName(pluginMeta.getName());

               // favor help text from this annotation over others
               DefaultCommand def = Annotations.getAnnotation(method, DefaultCommand.class);
               if ((def.help() != null) && !def.help().trim().isEmpty())
               {
                  commandMeta.setHelp(def.help());
               }
            }

            // This works because @SetupCommand is annotated by @Command
            if (Annotations.isAnnotationPresent(method, SetupCommand.class))
            {
               if (pluginMeta.hasSetupCommand())
               {
                  throw new IllegalStateException("Plugins may only have one @"
                           + SetupCommand.class.getSimpleName()
                           + ", but [" + pluginMeta.getType() + "] has more than one.");
               }

               commandMeta.setSetup(true);
               commandMeta.setName("setup");

               // favor help text from this annotation over others
               SetupCommand def = Annotations.getAnnotation(method, SetupCommand.class);
               if ((def.help() != null) && !def.help().trim().isEmpty())
               {
                  commandMeta.setHelp(def.help());
               }
            }

            /*
             * We don't want to do this if it is a setup command.
View Full Code Here

               commandMeta.setDefault(true);
               commandMeta.setName(pluginMeta.getName());

               // favor help text from this annotation over others
               DefaultCommand def = Annotations.getAnnotation(method, DefaultCommand.class);
               if ((def.help() != null) && !def.help().trim().isEmpty())
               {
                  commandMeta.setHelp(def.help());
               }
            }

            if (Annotations.isAnnotationPresent(method, RequiresResource.class))
            {
View Full Code Here

               commandMeta.setDefault(true);
               commandMeta.setName(pluginMeta.getName());

               // favor help text from this annotation over others
               DefaultCommand def = Annotations.getAnnotation(method, DefaultCommand.class);
               if ((def.help() != null) && !def.help().trim().isEmpty())
               {
                  commandMeta.setHelp(def.help());
               }
            }

            // This works because @SetupCommand is annotated by @Command
            if (Annotations.isAnnotationPresent(method, SetupCommand.class))
            {
               if (pluginMeta.hasSetupCommand())
               {
                  throw new IllegalStateException("Plugins may only have one @"
                           + SetupCommand.class.getSimpleName()
                           + ", but [" + pluginMeta.getType() + "] has more than one.");
               }

               commandMeta.setSetup(true);
               commandMeta.setName("setup");

               // favor help text from this annotation over others
               SetupCommand def = Annotations.getAnnotation(method, SetupCommand.class);
               if ((def.help() != null) && !def.help().trim().isEmpty())
               {
                  commandMeta.setHelp(def.help());
               }
            }

            /*
             * We don't want to do this if it is a setup command.
View Full Code Here

               commandMeta.setDefault(true);
               commandMeta.setName(pluginMeta.getName());

               // favor help text from this annotation over others
               DefaultCommand def = Annotations.getAnnotation(method, DefaultCommand.class);
               if ((def.help() != null) && !def.help().trim().isEmpty())
               {
                  commandMeta.setHelp(def.help());
               }
            }

            // This works because @SetupCommand is annotated by @Command
            if (Annotations.isAnnotationPresent(method, SetupCommand.class))
            {
               if (pluginMeta.hasSetupCommand())
               {
                  throw new IllegalStateException("Plugins may only have one @"
                           + SetupCommand.class.getSimpleName()
                           + ", but [" + pluginMeta.getType() + "] has more than one.");
               }

               commandMeta.setSetup(true);
               commandMeta.setName("setup");

               // favor help text from this annotation over others
               SetupCommand def = Annotations.getAnnotation(method, SetupCommand.class);
               if ((def.help() != null) && !def.help().trim().isEmpty())
               {
                  commandMeta.setHelp(def.help());
               }
            }

            /*
             * We don't want to do this if it is a setup command.
View Full Code Here

TOP

Related Classes of org.jboss.forge.shell.plugins.DefaultCommand

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.