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

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

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

Command.scope介绍

暂无

代码示例

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

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

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

public static String getScope(Class<?> action) {
  Command command = action.getAnnotation(Command.class);
  if (command != null) {
    return command.scope();
  }
  org.apache.felix.gogo.commands.Command command2 = action.getAnnotation(org.apache.felix.gogo.commands.Command.class);
  if (command2 != null) {
    return command2.scope();
  }
  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

Set<Option> options = new HashSet<>(optionsMap.keySet());
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.println(INTENSITY_BOLD + command.name() + INTENSITY_NORMAL);
    } else {
      out.println(command.scope() + ":" + INTENSITY_BOLD + command.name() + INTENSITY_NORMAL);
    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

out.print("\t");
  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

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

相关文章