org.apache.hive.cli.beeline
Class AbstractCommandHandler

java.lang.Object
  extended by org.apache.hive.cli.beeline.AbstractCommandHandler
Direct Known Subclasses:
ReflectiveCommandHandler

public abstract class AbstractCommandHandler
extends Object

An abstract implementation of CommandHandler.


Constructor Summary
AbstractCommandHandler(BeeLine beeLine, String[] names, String helpText, jline.Completor[] completors)
           
 
Method Summary
 boolean execute(String line)
          Execute the specified command.
 String getHelpText()
           
 String getName()
           
 String[] getNames()
           
 jline.Completor[] getParameterCompletors()
          Returns the completors that can handle parameters.
 String matches(String line)
          Check to see if the specified string can be dispatched to this command.
 void setParameterCompletors(jline.Completor[] parameterCompletors)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCommandHandler

public AbstractCommandHandler(BeeLine beeLine,
                              String[] names,
                              String helpText,
                              jline.Completor[] completors)
Method Detail

getHelpText

public String getHelpText()
Returns:
the short help description for this command.

getName

public String getName()
Returns:
the name of the command

getNames

public String[] getNames()
Returns:
all the possible names of this command.

matches

public String matches(String line)
Check to see if the specified string can be dispatched to this command.

Parameters:
line - the command line to check.
Returns:
the command string that matches, or null if it no match

setParameterCompletors

public void setParameterCompletors(jline.Completor[] parameterCompletors)

getParameterCompletors

public jline.Completor[] getParameterCompletors()
Returns the completors that can handle parameters.


execute

public boolean execute(String line)
Execute the specified command.

Parameters:
line - the full command line to execute.


Copyright © 2013 The Apache Software Foundation