函数参数信息

@param args 参数列表
@return 格式化输出
341235
protected String getParameters(Object[] args) {
    if (args == null)
      return "";
    StringBuilder sbd = new StringBuilder();
    if (args.length > 0) {
      for (Object i : args) {
        if (i == null) {
          sbd.append("null");
        } else {
          Class clz = i.getClass();
          if (isPrimitive(clz)) {
            sbd.append(evalPrimitive(i));
          } else if (clz.isArray()) {
            evalArray(i, sbd);
          } else if (Collection.class.isAssignableFrom(clz)) {
            Object[] arr = ((Collection<?>) i).toArray();
            evalArray(arr, sbd);
          } else if (i instanceof Date) {
            sbd.append('"').append(formatYmdHis(((Date) i))).append('"');
          } else if (i instanceof IdEntity) {
            sbd.append(i.getClass().getSimpleName()).append("[id=").append(((IdEntity) i).getId()).append(']');
          }else {
            sbd.append(clz.getSimpleName()).append(":OBJ");
          }
        }
        sbd.append(',');
      }
      sbd.setLength(sbd.length() - 1);
    }
    return sbd.toString();
  }
307630
static String getArgumentTypesAsString(Object... arguments) {
        StringBuilder argumentsAsString = new StringBuilder();
        final String noParameters = "<none>";
        if (arguments != null && arguments.length != 0) {
            for (int i = 0; i < arguments.length; i++) {
                String argumentName = null;
                Object argument = arguments[i];

                if (argument instanceof Class<?>) {
                    argumentName = ((Class<?>) argument).getName();
                } else if (argument instanceof Class<?>[] && arguments.length == 1) {
                    Class<?>[] argumentArray = (Class<?>[]) argument;
                    if (argumentArray.length > 0) {
                        for (int j = 0; j < argumentArray.length; j++) {
                            appendArgument(argumentsAsString, j,
                                    argumentArray[j] == null ? "null" : getUnproxyType(argumentArray[j]).getName(),
                                    argumentArray);
                        }
                        return argumentsAsString.toString();
                    } else {
                        argumentName = noParameters;
                    }
                } else if (argument == null) {
                    argumentName = "null";
                } else {
                    argumentName = getUnproxyType(argument).getName();
                }
                appendArgument(argumentsAsString, i, argumentName, arguments);
            }
        } else {
            argumentsAsString.append("<none>");
        }
        return argumentsAsString.toString();
    }
155448
public static void info(String msg, Object... args) {
		if (BaseProcessor.JUNIT_TEST_MODE) {
			logger.info(String.format(msg, args));
		}

		if (!BaseProcessor.JUNIT_TEST_MODE && BaseProcessor.DEBUG_MODE)
			messager.printMessage(Diagnostic.Kind.NOTE, String.format(msg, args));
		
	}
686799
private static boolean checkArgs(String[] args) {
		boolean result = (args.length > 0);
		if (!result) {
			System.out
					.println("Usage: java -jar JWPLTimeMachine.jar <config-file>");
		}
		return result;
	}
290484
public int parseParameters(String[] args) {
		
		// check for action
		if (args.length < 1) {
			System.out.println("Please specify an action.");
			printHelp();
			return 1;
		}
		
		// get action
		String action = args[0];
		
		// remove action from parameters
		String[] params = Arrays.copyOfRange(args, 1, args.length);
		
		// do action
		if (action.equals(ACTION_RUN)) {
			return run(params);
		} else if (action.equals(ACTION_LIST)) {
			return list(params);
		} else if (action.equals(ACTION_INFO)) {
			return info(params);
		} else if (action.equals(ACTION_CANCEL)) {
			return cancel(params);
		} else if (action.equals("-h") || action.equals("--help")) {
			printHelp();
			return 0;
		} else {
			System.out.println("Invalid action!");
			printHelp();
			return 1;
		}
	}
1067746
protected String getMessage(String key, String... args) {

        return Messages.get().getBundle(m_cms.getRequestContext().getLocale()).key(key, args);
    }
285568
public java.util.List<String> getArgs() {
        if (args == null) {
            args = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return args;
    }
267027
public static void main(final String[] args) {
        Switch about = new Switch("a", "about", "display about message");
        Switch help = new Switch("h", "help", "display help message");
        FileArgument fastaFile = new FileArgument("i", "fasta-file", "input FASTA file, default stdin", false);
        StringArgument outputFilePrefix = new StringArgument("p", "output-file-prefix", "output file prefix, default \"\"", false);
        StringArgument outputFileExtension = new StringArgument("x", "output-file-extension", "output file extension, default " + DEFAULT_OUTPUT_FILE_EXTENSION, false);
        FileArgument outputDirectory = new FileArgument("d", "output-directory", "output directory, default .", false);

        ArgumentList arguments = new ArgumentList(about, help, fastaFile, outputFilePrefix, outputFileExtension, outputDirectory);
        CommandLine commandLine = new CommandLine(args);

        SplitFasta splitFasta = null;
        try
        {
            CommandLineParser.parse(commandLine, arguments);
            if (about.wasFound()) {
                About.about(System.out);
                System.exit(0);
            }
            if (help.wasFound()) {
                Usage.usage(USAGE, null, commandLine, arguments, System.out);
                System.exit(0);
            }
            splitFasta = new SplitFasta(fastaFile.getValue(), outputFilePrefix.getValue(DEFAULT_OUTPUT_FILE_PREFIX), outputFileExtension.getValue(DEFAULT_OUTPUT_FILE_EXTENSION), outputDirectory.getValue(DEFAULT_OUTPUT_DIRECTORY));
        }
        catch (CommandLineParseException e) {
            Usage.usage(USAGE, e, commandLine, arguments, System.err);
            System.exit(-1);
        }
        try {
            System.exit(splitFasta.call());
        }
        catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }
353636
public static String getString(String aKey, Object[] args)
    {
        assert (aKey != null);

        String pattern = getBundle().getString(aKey);
        if (args == null)
            return pattern;

        MessageFormat format = new MessageFormat(pattern);
        return format.format(args).toString();
    }
498891
function (arguments) {
                var argData = ArgumentHelpers.prepareCallback(arguments);
                var callback = argData.callback;
                var args = argData.arguments;
                if (callback) {
                    args.pop();
                }
                return args;
            }
356524
public static void main(String[] args) {
		if (args.length > 0) {
			System.out.printf("%s\n", getFullVersion());
		} else {
			System.out.println(VERSION);
		}
	}
458896
boolean parseCmdLineArgs(String[] args) throws IllegalArgumentException {
        for (int i = 0; i < args.length; i++) {
            if (args[i].toLowerCase().contains("help") || args[i].toLowerCase().contains("usage")) {
                // print the usage information and exit.
                printUsage();
                return true;
            }
            boolean accepted = false;
            for (Option option : options) {
                if (args[i].equalsIgnoreCase(option.name)) {
                    if (i + option.nargs < args.length) {
                        i += option.accept(args, i + 1);
                    } else {
                        throw new IllegalArgumentException(getLocalizedParmString("CWTRA0022E",
                                                                                  new Object[] { option.name, option.nargs }));
                    }
                    accepted = true;
                    break;
                }
            }
            if (!accepted) {
                throw new IllegalArgumentException(getLocalizedParmString("CWTRA0023E", new Object[] { args[i] }));
            }
        }
        return false;
    }
1232627
private void getArgs(Apply<?> apply, List<String> args) {
        if (apply instanceof Op.Bin<?>) {
            Op.Bin<?> bin = (Op.Bin<?>) apply;

            getArgs(bin.left, args);
            getArgs(bin.right, args);
        }
        else if (apply instanceof Arg.Pred<?>) {
            args.add(((Arg.Pred<?>)apply).getDescription());
        }
    }
471129
protected String getValue(String arg) {
        String[] split = arg.split("=");
        if (split.length <= 1) {
            return null;
        }
        return split[1];
    }
160011
public String getArguments(MethodInvocation invocation) {

		try {
			Object[] args = invocation.getArguments();
			if (args == null)
				return null;
			if (args.length != 1)
				return null;// 参数是一个主键

			if (args[0] == null)
				return null;
			return args[0].toString();
		} catch (Exception ex) {
			Debug.logError("[JdonFramework] method:"
					+ invocation.getMethod().getName() + "  " + ex, module);
			return null;
		}

	}
132716
@Override
    public boolean parseArguments(final PrintStream messageStream, final String[] args) {
        this.argv = args;
        this.messageStream = messageStream;
        if (prefix.isEmpty()) {
            commandLine = callerOptions.getClass().getSimpleName();
        }
        for (int i = 0; i < args.length; ++i) {
            final String arg = args[i];
            if (arg.equals("-h") || arg.equals("--help")) {
                messageStream.append(usage(false, true));
                return false;
            }
            if (arg.equals("-H") || arg.equals("--stdhelp")) {
                messageStream.append(usage(true, true));
                return false;
            }

            if (arg.equals("--version")) {
                messageStream.println(getVersion());
                return false;
            }

            final String[] pair = arg.split("=", 2);
            if (pair.length == 2) {
                if (pair[1].isEmpty() && i < args.length - 1) {
                    pair[1] = args[++i];
                }
                if (!parseOption(pair[0], pair[1], false)) {
                    messageStream.println();
                    messageStream.append(usage(true, true));
                    return false;
                }
            } else if (!parsePositionalArgument(arg)) {
                messageStream.println();
                messageStream.append(usage(false, true));
                return false;
            }
        }
        if (!checkNumArguments()) {
            messageStream.println();
            messageStream.append(usage(false, true));
            return false;
        }

        return true;
    }
259317
private String getArgumentName(final String arg) {
        int pos = arg.indexOf("=");
        if (pos == -1) {
            pos = arg.indexOf(":");
        }
        return arg.substring(0, pos != -1 ? pos : arg.length());
    }