Example #1
0
 private String[] makeCommandLine(List<String> commandLineList) {
   final String[] commandLine = new String[commandLineList.size()];
   for (int i = 0; i < commandLine.length; ++i) {
     commandLine[i] = commandLineList.get(i);
   }
   log.verbose("Compilation arguments:");
   log.verbose(DefaultGroovyMethods.join(commandLine, "\n"));
   return commandLine;
 }
Example #2
0
  public Object invokeMethod(String name, Object args) {
    if (args != null && args.getClass().isArray()) {
      args = DefaultGroovyMethods.join((Object[]) args, ",");
    }

    //
    // FIXME: This kinda sucks as an output format, should probably ucase name and then
    //        warp prefix in [] and then output the args.  Basically what the SimpleLog
    //        does in JCL.
    //

    System.out.println(prefix + name + "] " + args);

    return null;
  }
Example #3
0
  public String toString() {
    List buffer = new ArrayList();

    if (this.years != 0) buffer.add(this.years + " years");
    if (this.months != 0) buffer.add(this.months + " months");
    if (this.days != 0) buffer.add(this.days + " days");
    if (this.hours != 0) buffer.add(this.hours + " hours");
    if (this.minutes != 0) buffer.add(this.minutes + " minutes");

    if (this.seconds != 0 || this.millis != 0)
      buffer.add(
          (seconds == 0 ? (millis < 0 ? "-0" : "0") : seconds)
              + "."
              + DefaultGroovyMethods.padLeft("" + Math.abs(millis), 3, "0")
              + " seconds");

    if (buffer.size() != 0) {
      return DefaultGroovyMethods.join(buffer, ", ");
    } else {
      return "0";
    }
  }
 static void resetMethodExpressionPattern() {
   String expressionPattern = DefaultGroovyMethods.join(methodExpressions.keySet(), "|");
   methodExpressinPattern =
       Pattern.compile("\\p{Upper}[\\p{Lower}\\d]+(" + expressionPattern + ")");
 }