本文整理汇总了Java中org.cubeengine.butler.Dispatcher类的典型用法代码示例。如果您正苦于以下问题:Java Dispatcher类的具体用法?Java Dispatcher怎么用?Java Dispatcher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Dispatcher类属于org.cubeengine.butler包,在下文中一共展示了Dispatcher类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNames
import org.cubeengine.butler.Dispatcher; //导入依赖的package包/类
/**
* Returns the names of the given command and all its dispatchers
*
* @param descriptor the command
*
* @return the names
*/
public static Stack<String> getNames(CommandDescriptor descriptor)
{
Stack<String> commands = new Stack<>();
commands.push(descriptor.getName());
Dispatcher dispatcher = descriptor.getDispatcher();
while (dispatcher != null && dispatcher.getDescriptor() != null)
{
descriptor = dispatcher.getDescriptor();
if (descriptor.getName().isEmpty())
{
break;
}
dispatcher = descriptor.getDispatcher();
if (dispatcher != null)
{
commands.add(descriptor.getName());
}
}
return commands;
}
示例2: registerCommands
import org.cubeengine.butler.Dispatcher; //导入依赖的package包/类
@Override
public void registerCommands(CommandManager cm, I18n i18n)
{
super.registerCommands(cm, i18n);
((Dispatcher) cm.getCommand("eco")).addCommand(new EcoBankCommand(cm, this, i18n));
cm.getProviders().register(module, new VirtualAccountParser(this, i18n), BaseAccount.Virtual.class);
BankCommand bankCommand = new BankCommand(cm, this, i18n);
cm.addCommand(bankCommand);
bankCommand.addCommand(new BankManageCommand(cm, this, i18n));
}
示例3: getDispatcher
import org.cubeengine.butler.Dispatcher; //导入依赖的package包/类
@Override
public Dispatcher getDispatcher()
{
return this.dispatcher;
}
示例4: setDispatcher
import org.cubeengine.butler.Dispatcher; //导入依赖的package包/类
@Override
public void setDispatcher(Dispatcher dispatcher)
{
this.dispatcher = dispatcher;
}
示例5: ContainerCommandDescriptor
import org.cubeengine.butler.Dispatcher; //导入依赖的package包/类
public ContainerCommandDescriptor(Dispatcher dispatcher)
{
super(dispatcher);
}
示例6: build
import org.cubeengine.butler.Dispatcher; //导入依赖的package包/类
protected BasicParametricCommand build(Dispatcher dispatcher, ParametricCommandDescriptor descriptor)
{
descriptor.setOwner(dispatcher.getDescriptor().getOwner());
return new BasicParametricCommand(descriptor);
}
示例7: buildCommand
import org.cubeengine.butler.Dispatcher; //导入依赖的package包/类
@Override
public final CommandBase buildCommand(Dispatcher base, OriginT origin)
{
return isApplicable(origin) ? this.build(base, buildDescriptor(origin)) : null;
}
示例8: buildCommand
import org.cubeengine.butler.Dispatcher; //导入依赖的package包/类
/**
* Builds a new command
*
* @param base the base Dispatcher for the built command
* @param origin the origin of the command
* @return the command
*/
CommandBase buildCommand(Dispatcher base, OriginT origin);
示例9: build
import org.cubeengine.butler.Dispatcher; //导入依赖的package包/类
protected abstract CommandBase build(Dispatcher base, DescriptorT descriptor);