Пример #1
0
  @Override
  public Actor get(CommandArgs arguments, List<? extends Annotation> modifiers)
      throws ArgumentException, ProvisionException {
    Namespace namespace = arguments.getNamespace();
    checkState(namespace.containsKey(Actor.class), "Namespace does not contain an Actor");

    return namespace.get(Actor.class);
  }
Пример #2
0
 @Nullable
 @Override
 public String get(CommandArgs arguments, List<? extends Annotation> modifiers)
     throws ArgumentException {
   StringBuilder builder = new StringBuilder();
   boolean first = true;
   while (true) {
     if (!first) {
       builder.append(" ");
     }
     try {
       builder.append(arguments.next());
     } catch (MissingArgumentException ignored) {
       break;
     }
     first = false;
   }
   if (first) {
     throw new MissingArgumentException();
   }
   String v = builder.toString();
   validate(v, modifiers);
   return v;
 }