org.apache.felix.gogo.commands.Command.name()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(4.1k)|赞(0)|评价(0)|浏览(157)

本文整理了Java中org.apache.felix.gogo.commands.Command.name()方法的一些代码示例,展示了Command.name()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Command.name()方法的具体详情如下:
包路径:org.apache.felix.gogo.commands.Command
类名称:Command
方法名:name

Command.name介绍

暂无

代码示例

代码示例来源:origin: apache/karaf

@Override
public String name() {
  return oldCommand.name();
}

代码示例来源:origin: apache/karaf

public static String getName(Class<?> action) {
    Command command = action.getAnnotation(Command.class);
    if (command != null) {
      return command.name();
    }
    org.apache.felix.gogo.commands.Command command2 = action.getAnnotation(org.apache.felix.gogo.commands.Command.class);
    if (command2 != null) {
      return command2.name();
    }
    return null;
  }
}

代码示例来源:origin: org.apache.felix.gogo/org.apache.felix.gogo.commands

public static ServiceRegistration export(BundleContext context, Class<? extends Action> actionClass)
{
  Command cmd = actionClass.getAnnotation(Command.class);
  if (cmd == null)
  {
    throw new IllegalArgumentException("Action class is not annotated with @Command");
  }
  Hashtable props = new Hashtable();
  props.put("osgi.command.scope", cmd.scope());
  props.put("osgi.command.function", cmd.name());
  SimpleCommand command = new SimpleCommand(actionClass);
  return context.registerService(Function.class.getName(), command, props);
}

代码示例来源:origin: org.apache.jclouds.cli/jclouds-cli-runner

protected void addCommand(Command cmd, Function function, CommandProcessorImpl commandProcessor) {
  try {
    commandProcessor.addCommand(cmd.scope(), function, cmd.name());
  } catch (Exception e) {
  }
}

代码示例来源:origin: org.apache.jclouds.cli/runner

protected void addCommand(Command cmd, Function function, CommandProcessorImpl commandProcessor) {
  try {
    commandProcessor.addCommand(cmd.scope(), function, cmd.name());
  } catch (Exception e) {
  }
}

代码示例来源:origin: org.jclouds.cli/runner

protected void addCommand(Command cmd, Function function, CommandProcessorImpl commandProcessor) {
  try {
    commandProcessor.addCommand(cmd.scope(), function, cmd.name());
  } catch (Exception e) {
  }
}

代码示例来源:origin: org.apache.felix.gogo/org.apache.felix.gogo.commands

if (command != null)
  syntax += command.scope() + ":" + command.name();

代码示例来源:origin: apache/karaf

options.add(HELP);
boolean globalScope = NameScoping.isGlobalScope(session, command.scope());
if (command != null && (command.description() != null || command.name() != null)) {
  out.println(INTENSITY_BOLD + "DESCRIPTION" + INTENSITY_NORMAL);
  out.print("        ");
  if (command.name() != null) {
    if (globalScope) {
      out.println(INTENSITY_BOLD + command.name() + INTENSITY_NORMAL);
    } else {
      out.println(command.scope() + ":" + INTENSITY_BOLD + command.name() + INTENSITY_NORMAL);
if (command != null) {
  if (globalScope) {
    syntax.append(command.name());
  } else {
    syntax.append(String.format("%s:%s", command.scope(), command.name()));

代码示例来源:origin: org.apache.felix.karaf.shell/org.apache.felix.karaf.shell.console

options = new HashSet<Option>(options);
options.add(HELP);
if (command != null && (command.description() != null || command.name() != null))
  if (command.name() != null) {
    out.println(Ansi.ansi().a(command.scope()).a(":").a(Ansi.Attribute.INTENSITY_BOLD).a(command.name()).a(Ansi.Attribute.RESET));
    out.println();
if (command != null)
  syntax.append(String.format("%s:%s", command.scope(), command.name()));

代码示例来源:origin: apache/karaf

+ "Error executing command "
  + command.scope() + ":" 
  + INTENSITY_BOLD + command.name() + INTENSITY_NORMAL
  + " undefined option "
  + INTENSITY_BOLD + param + INTENSITY_NORMAL
  + "Error executing command "
  + command.scope() + ":" 
  + INTENSITY_BOLD + command.name() + INTENSITY_NORMAL
  + " missing value for option "
  + INTENSITY_BOLD + param + INTENSITY_NORMAL
  + "Error executing command "
  + command.scope() + ":" 
  + INTENSITY_BOLD + command.name() + INTENSITY_NORMAL
  + ": too many arguments specified"
  + INTENSITY_BOLD + param + INTENSITY_NORMAL
+ "Error executing command "
+ command.scope() + ":" 
+ INTENSITY_BOLD + command.name() + INTENSITY_NORMAL
+ ": option "
+ INTENSITY_BOLD + option.name() + INTENSITY_NORMAL
+ "Error executing command "
+ command.scope() + ":" 
+ INTENSITY_BOLD + command.name() + INTENSITY_NORMAL
+ ": argument "
+ INTENSITY_BOLD + argument.name() + INTENSITY_NORMAL

相关文章