Пример #1
0
 private static Object[] convertActionArguments(NetAction action, String[] arguments)
     throws InvalidValueException {
   List<NetType> argTypes = action.getArguments();
   List<Object> ret = new ArrayList<Object>();
   if (argTypes.size() != arguments.length) throw new InvalidValueException();
   for (int i = 0; i < arguments.length; i++) ret.add(convertValue(argTypes.get(i), arguments[i]));
   return ret.toArray();
 }
Пример #2
0
 private static void checkActionArguments(NetAction action, Object[] arguments)
     throws InvalidValueException {
   List<NetType> argTypes = action.getArguments();
   if (argTypes.size() != arguments.length) throw new InvalidValueException();
   for (int i = 0; i < arguments.length; i++) checkValue(argTypes.get(i), arguments[i]);
 }