org.crsh.cmdline.matcher
Class CommandMatch<C,D extends CommandDescriptor<C,B>,B extends TypeBinding>

java.lang.Object
  extended by org.crsh.cmdline.matcher.CommandMatch<C,D,B>
Direct Known Subclasses:
ClassMatch, MethodMatch

public abstract class CommandMatch<C,D extends CommandDescriptor<C,B>,B extends TypeBinding>
extends Object

Version:
$Revision$
Author:
Julien Viet

Field Summary
private  List<ArgumentMatch<B>> argumentMatches
          .
private  List<OptionMatch<B>> optionMatches
          .
private  String rest
          .
 
Constructor Summary
CommandMatch(List<OptionMatch<B>> optionMatches, List<ArgumentMatch<B>> argumentMatches, String rest)
           
 
Method Summary
protected abstract  Object doInvoke(InvocationContext context, C command, Map<ParameterDescriptor<?>,Object> values)
           
 List<ArgumentMatch<B>> getArgumentMatches()
           
abstract  D getDescriptor()
           
 List<OptionMatch<B>> getOptionMatches()
           
abstract  List<ParameterMatch<?,?>> getParameterMatches()
           
abstract  Set<ParameterDescriptor<?>> getParameters()
           
 String getRest()
           
 Object invoke(InvocationContext context, C command)
           
abstract  void printMan(Appendable writer)
           
abstract  void printUsage(Appendable writer)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

optionMatches

private final List<OptionMatch<B extends TypeBinding>> optionMatches
.


argumentMatches

private final List<ArgumentMatch<B extends TypeBinding>> argumentMatches
.


rest

private final String rest
.

Constructor Detail

CommandMatch

public CommandMatch(List<OptionMatch<B>> optionMatches,
                    List<ArgumentMatch<B>> argumentMatches,
                    String rest)
Method Detail

getDescriptor

public abstract D getDescriptor()

invoke

public final Object invoke(InvocationContext context,
                           C command)
                    throws CmdInvocationException,
                           CmdSyntaxException
Throws:
CmdInvocationException
CmdSyntaxException

doInvoke

protected abstract Object doInvoke(InvocationContext context,
                                   C command,
                                   Map<ParameterDescriptor<?>,Object> values)
                            throws CmdInvocationException,
                                   CmdSyntaxException
Throws:
CmdInvocationException
CmdSyntaxException

getParameters

public abstract Set<ParameterDescriptor<?>> getParameters()

getParameterMatches

public abstract List<ParameterMatch<?,?>> getParameterMatches()

printMan

public abstract void printMan(Appendable writer)
                       throws IOException
Throws:
IOException

printUsage

public abstract void printUsage(Appendable writer)
                         throws IOException
Throws:
IOException

getOptionMatches

public List<OptionMatch<B>> getOptionMatches()

getArgumentMatches

public List<ArgumentMatch<B>> getArgumentMatches()

getRest

public String getRest()


Copyright © 2012 eXo Platform SAS. All Rights Reserved.