本文整理汇总了Java中org.cubeengine.butler.alias.AliasConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java AliasConfiguration类的具体用法?Java AliasConfiguration怎么用?Java AliasConfiguration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AliasConfiguration类属于org.cubeengine.butler.alias包,在下文中一共展示了AliasConfiguration类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: fill
import org.cubeengine.butler.alias.AliasConfiguration; //导入依赖的package包/类
@Override
public void fill(ParametricCommandDescriptor descriptor, InvokableMethod origin)
{
Alias alias = origin.getMethod().getAnnotation(Alias.class);
if (alias != null)
{
List<AliasConfiguration> aliasList = new ArrayList<>();
for (String name : alias.value())
{
AliasConfiguration aliasConf = new AliasConfiguration(name, alias.parents());
aliasList.add(aliasConf);
}
descriptor.addAliases(aliasList);
}
}
示例2: addCommand
import org.cubeengine.butler.alias.AliasConfiguration; //导入依赖的package包/类
@Override
public boolean addCommand(CommandBase command)
{
CommandDescriptor descriptor = command.getDescriptor();
if (!(descriptor instanceof Dispatchable))
{
throw new IllegalArgumentException("The given command is not dispatchable");
}
// Remove command from old dispatcher and set this one
Dispatcher oldDispatcher = descriptor.getDispatcher();
if (oldDispatcher != null)
{
oldDispatcher.removeCommand(command);
}
((Dispatchable)descriptor).setDispatcher(this);
this.commands.put(descriptor.getName().toLowerCase(), command);
if (!(command instanceof AliasCommand))
{
for (AliasConfiguration alias : descriptor.getAliases())
{
if (alias.getDispatcher() == null)
{
this.addCommand(new AliasCommand(alias, command));
}
else
{
CommandBase aliasDispatcher = getManager().getCommand(alias.getDispatcher());
if (aliasDispatcher == null || !(aliasDispatcher instanceof Dispatcher))
{
throw new IllegalArgumentException("Cannot add alias to dispatcher! Command missing or is not a dispatcher.");
}
((Dispatcher)aliasDispatcher).addCommand(new AliasCommand(alias, command));
}
}
}
if (command instanceof ContainerCommand)
{
((ContainerCommand)command).registerSubCommands();
}
return true;
}
示例3: getAliases
import org.cubeengine.butler.alias.AliasConfiguration; //导入依赖的package包/类
@Override
public List<AliasConfiguration> getAliases()
{
return aliases;
}
示例4: addAliases
import org.cubeengine.butler.alias.AliasConfiguration; //导入依赖的package包/类
public void addAliases(List<AliasConfiguration> aliases)
{
this.aliases.addAll(aliases);
}
示例5: getAliases
import org.cubeengine.butler.alias.AliasConfiguration; //导入依赖的package包/类
/**
* Returns the aliases of the command under the same dispatcher
*
* @return the aliases
*/
List<AliasConfiguration> getAliases();