Examples of ArgumentProcessor


Examples of net.sourceforge.marathon.util.ArgumentProcessor

        String args = getFixtureProperty(Constants.PROP_APPLICATION_ARGUMENTS);
        return tokenize(args);
    }

    private static List<String> tokenize(String args) {
        ArgumentProcessor p = new ArgumentProcessor(args);
        return p.parseArguments();
    }
View Full Code Here

Examples of net.sourceforge.marathon.util.ArgumentProcessor

        if (vmCommand.equals(""))
            vmCommand = "java";
        command.add(vmCommand);
        String vmArgs = props.getProperty(Constants.PROP_APPLICATION_VM_ARGUMENTS, "");
        if (!vmArgs.equals("")) {
            ArgumentProcessor p = new ArgumentProcessor(vmArgs);
            command.addAll(p.parseArguments());
        }
        String classPath = props.getProperty(Constants.PROP_APPLICATION_PATH, "");
        if (!classPath.equals("")) {
            command.add("-classpath");
            command.add("\"" + classPath + "\" ");
        }
        Set<Object> keys = props.keySet();
        for (Iterator<Object> iter = keys.iterator(); iter.hasNext();) {
            String key = (String) iter.next();
            if (key.startsWith(Constants.PROP_PROPPREFIX)) {
                String value = props.getProperty(key);
                command.add("-D" + key.substring(Constants.PROP_PROPPREFIX.length()) + "=" + value);
            }
        }
        String mainClass = props.getProperty(Constants.PROP_APPLICATION_MAINCLASS);
        if (mainClass == null || mainClass.equals(""))
            throw new RuntimeException("Main Class Not Given");
        command.add(mainClass);
        String args = props.getProperty(Constants.PROP_APPLICATION_ARGUMENTS, "");
        if (!args.equals("")) {
            ArgumentProcessor p = new ArgumentProcessor(args);
            command.addAll(p.parseArguments());
        }
        return command.toArray(new String[command.size()]);
    }
View Full Code Here

Examples of net.sourceforge.marathon.util.ArgumentProcessor

        if (vmCommand.equals(""))
            vmCommand = "java";
        command.add(vmCommand);
        String vmArgs = props.getProperty(Constants.PROP_APPLICATION_VM_ARGUMENTS, "");
        if (!vmArgs.equals("")) {
            ArgumentProcessor p = new ArgumentProcessor(vmArgs);
            command.addAll(p.parseArguments());
        }
        String classPath = props.getProperty(Constants.PROP_APPLICATION_PATH, "");
        if (!classPath.equals("")) {
            command.add("-classpath");
            command.add(classPath);
        }
        Set<Object> keys = props.keySet();
        for (Iterator<Object> iter = keys.iterator(); iter.hasNext();) {
            String key = (String) iter.next();
            if (key.startsWith(Constants.PROP_PROPPREFIX)) {
                String value = props.getProperty(key);
                command.add("-D" + key.substring(Constants.PROP_PROPPREFIX.length()) + "=" + value);
            }
        }
        String mainClass = props.getProperty(Constants.PROP_APPLICATION_MAINCLASS);
        if (mainClass == null || mainClass.equals(""))
            throw new RuntimeException("Main Class Not Given");
        command.add(mainClass);
        String args = props.getProperty(Constants.PROP_APPLICATION_ARGUMENTS, "");
        if (!args.equals("")) {
            ArgumentProcessor p = new ArgumentProcessor(args);
            command.addAll(p.parseArguments());
        }
        return command.toArray(new String[command.size()]);
    }
View Full Code Here

Examples of org.jruby.util.cli.ArgumentProcessor

    public String getCopyrightString() {
        return OutputStrings.getCopyrightString();
    }

    public void processArguments(String[] arguments) {
        new ArgumentProcessor(arguments, this).processArguments();
        tryProcessArgumentsWithRubyopts();
    }
View Full Code Here

Examples of org.jruby.util.cli.ArgumentProcessor

           
            if (rubyopt == null || "".equals(rubyopt)) return;

            if (rubyopt.split("\\s").length != 0) {
                String[] rubyoptArgs = rubyopt.split("\\s+");
                new ArgumentProcessor(rubyoptArgs, false, true, this).processArguments();
            }
        } catch (SecurityException se) {
            // ignore and do nothing
        }
    }
View Full Code Here

Examples of org.jruby.util.cli.ArgumentProcessor

    public LoadService createLoadService(Ruby runtime) {
        return creator.create(runtime);
    }

    public void processArguments(String[] arguments) {
        new ArgumentProcessor(arguments, this).processArguments();
        tryProcessArgumentsWithRubyopts();
    }
View Full Code Here

Examples of org.jruby.util.cli.ArgumentProcessor

           
            if (rubyopt == null || "".equals(rubyopt)) return;

            if (rubyopt.split("\\s").length != 0) {
                String[] rubyoptArgs = rubyopt.split("\\s+");
                new ArgumentProcessor(rubyoptArgs, false, true, true, this).processArguments();
            }
        } catch (SecurityException se) {
            // ignore and do nothing
        }
    }
View Full Code Here

Examples of org.wymiwyg.commons.util.arguments.ArgumentProcessor

      showHelp(invocationString);
      return;
    }
    final List<String> unusedArguments = new ArrayList<String>();
    try {
      argumentHandler.processArguments(new ArgumentProcessor() {
        public void process(List<String> argumentList) throws InvalidArgumentsException {
          unusedArguments.addAll(argumentList);
         
        }
      });
View Full Code Here

Examples of org.wymiwyg.commons.util.arguments.ArgumentProcessor

  public void start(String... args) throws Throwable {
    LauncherArguments arguments;
    try {
      final ArgumentHandler argumentHandler = new ArgumentHandler(args);
      arguments = argumentHandler.getInstance(LauncherArguments.class);
      argumentHandler.processArguments(new ArgumentProcessor() {

        @Override
        public void process(List<String> remaining) throws InvalidArgumentsException {
          if (remaining.size() > 0) {
            throw new InvalidArgumentsException("The following arguments could not be understood: " + remaining);
View Full Code Here

Examples of org.wymiwyg.commons.util.arguments.ArgumentProcessor

    }
    if (helpArguments.getShowHelp()) {
      showHelp();
      return;
    }
    argumentHandler.processArguments(new ArgumentProcessor() {
      /**
       * @see org.wymiwyg.commons.util.arguments.ArgumentProcessor#process(java.util.List)
       */
      public void process(List<String> argumentList) {
        if (argumentList.size() > 0) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.