< prev index next >

jdk/src/jdk.jline/share/classes/jdk/internal/jline/console/completer/ArgumentCompleter.java

Print this page


   1 /*
   2  * Copyright (c) 2002-2012, the original author or authors.
   3  *
   4  * This software is distributable under the BSD license. See the terms of the
   5  * BSD license in the documentation provided with this software.
   6  *
   7  * http://www.opensource.org/licenses/bsd-license.php
   8  */
   9 package jline.console.completer;
  10 
  11 import jline.internal.Log;
  12 
  13 import java.util.ArrayList;
  14 import java.util.Arrays;
  15 import java.util.Collection;
  16 import java.util.LinkedList;
  17 import java.util.List;
  18 
  19 import static jline.internal.Preconditions.checkNotNull;
  20 
  21 /**
  22  * A {@link Completer} implementation that invokes a child completer using the appropriate <i>separator</i> argument.
  23  * This can be used instead of the individual completers having to know about argument parsing semantics.
  24  *
  25  * @author <a href="mailto:mwp1@cornell.edu">Marc Prud'hommeaux</a>
  26  * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
  27  * @since 2.3
  28  */
  29 public class ArgumentCompleter
  30     implements Completer
  31 {
  32     private final ArgumentDelimiter delimiter;
  33 
  34     private final List<Completer> completers = new ArrayList<Completer>();
  35 
  36     private boolean strict = true;
  37 
  38     /**
  39      * Create a new completer with the specified argument delimiter.


   1 /*
   2  * Copyright (c) 2002-2012, the original author or authors.
   3  *
   4  * This software is distributable under the BSD license. See the terms of the
   5  * BSD license in the documentation provided with this software.
   6  *
   7  * http://www.opensource.org/licenses/bsd-license.php
   8  */
   9 package jdk.internal.jline.console.completer;
  10 
  11 import jdk.internal.jline.internal.Log;
  12 
  13 import java.util.ArrayList;
  14 import java.util.Arrays;
  15 import java.util.Collection;
  16 import java.util.LinkedList;
  17 import java.util.List;
  18 
  19 import static jdk.internal.jline.internal.Preconditions.checkNotNull;
  20 
  21 /**
  22  * A {@link Completer} implementation that invokes a child completer using the appropriate <i>separator</i> argument.
  23  * This can be used instead of the individual completers having to know about argument parsing semantics.
  24  *
  25  * @author <a href="mailto:mwp1@cornell.edu">Marc Prud'hommeaux</a>
  26  * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
  27  * @since 2.3
  28  */
  29 public class ArgumentCompleter
  30     implements Completer
  31 {
  32     private final ArgumentDelimiter delimiter;
  33 
  34     private final List<Completer> completers = new ArrayList<Completer>();
  35 
  36     private boolean strict = true;
  37 
  38     /**
  39      * Create a new completer with the specified argument delimiter.


< prev index next >