public Command<?> getCommand(String name) throws CommandException { return crash.getCommand(name); }
StringBuilder buffer = new StringBuilder(); for (Map.Entry<String, String> s : crash.getCommands()) { Command<?> cmd = crash.getCommand(s.getKey()); CommandDescriptor<?> desc = cmd.getDescriptor(); buffer.append("== ").append(desc.getName()).append("\n").append("\n");
public static PipeLineClosure resolveProperty(final InvocationContext context, final String property) { CRaSH crash = (CRaSH)context.getSession().get("crash"); if (crash != null) { try { Command<?> cmd = crash.getCommand(property); if (cmd != null) { return new PipeLineClosure(context, property, cmd); } else { return null; } } catch (CommandException e) { throw new InvokerInvocationException(e); } } else { return null; } }
StringBuilder buffer = new StringBuilder(); for (Map.Entry<String, String> s : crash.getCommands()) { Command<?> cmd = crash.getCommand(s.getKey()); CommandDescriptor<?> desc = cmd.getDescriptor(); buffer.append("== ").append(desc.getName()).append("\n").append("\n");
public static SafeCallable resolveMethodInvocation(final InvocationContext context, final String name, final Object args) { CRaSH crash = (CRaSH)context.getSession().get("crash"); if (crash != null) { final Command<?> cmd; try { cmd = crash.getCommand(name); } catch (CommandException ce) { throw new InvokerInvocationException(ce); } if (cmd != null) { return new SafeCallable() { @Override public Object call() { PipeLineClosure closure = new PipeLineClosure(context, name, cmd); return closure.call((Object[])args); } }; } } return null; } }
public Command<?> getCommand(String name) throws CommandException { return crash.getCommand(name); }
public Command<?> getCommand(String name) throws CommandException { return crash.getCommand(name); }
public CommandInvoker<Void, Chunk> create(CRaSHSession session) throws NoSuchCommandException { // LinkedList<CommandInvoker> pipes = new LinkedList<CommandInvoker>(); for (PipeLineFactory current = this;current != null;current = current.next) { CommandInvoker commandInvoker = null; if (current.name != null) { ShellCommand command = session.crash.getCommand(current.name); if (command != null) { commandInvoker = command.resolveInvoker(current.rest); } } if (commandInvoker == null) { throw new NoSuchCommandException(current.name); } pipes.add(commandInvoker); } // return new PipeLine(pipes.toArray(new CommandInvoker[pipes.size()])); }
public static PipeLineClosure resolveProperty(final InvocationContext context, final String property) { CRaSH crash = (CRaSH)context.getSession().get("crash"); if (crash != null) { try { Command<?> cmd = crash.getCommand(property); if (cmd != null) { return new PipeLineClosure(context, property, cmd); } else { return null; } } catch (CommandException e) { throw new InvokerInvocationException(e); } } else { return null; } }
public static PipeLineClosure resolveProperty(final InvocationContext context, final String property) { CRaSH crash = (CRaSH)context.getSession().get("crash"); if (crash != null) { try { Command<?> cmd = crash.getCommand(property); if (cmd != null) { return new PipeLineClosure(context, property, cmd); } else { return null; } } catch (CommandException e) { throw new InvokerInvocationException(e); } } else { return null; } }
public static SafeCallable resolveMethodInvocation(final InvocationContext context, final String name, final Object args) { CRaSH crash = (CRaSH)context.getSession().get("crash"); if (crash != null) { final Command<?> cmd; try { cmd = crash.getCommand(name); } catch (CommandException ce) { throw new InvokerInvocationException(ce); } if (cmd != null) { return new SafeCallable() { @Override public Object call() { PipeLineClosure closure = new PipeLineClosure(context, name, cmd); return closure.call((Object[])args); } }; } } return null; } }
public static SafeCallable resolveMethodInvocation(final InvocationContext context, final String name, final Object args) { CRaSH crash = (CRaSH)context.getSession().get("crash"); if (crash != null) { final Command<?> cmd; try { cmd = crash.getCommand(name); } catch (CommandException ce) { throw new InvokerInvocationException(ce); } if (cmd != null) { return new SafeCallable() { @Override public Object call() { PipeLineClosure closure = new PipeLineClosure(context, name, cmd); return closure.call((Object[])args); } }; } } return null; } }
CRaSH crash = new CRaSH(ctx); for (String s : ctx.listResourceId(ResourceKind.COMMAND)) { ShellCommand cmd = crash.getCommand(s); StringBuilder man = new StringBuilder(); if (cmd instanceof CRaSHCommand) {
if (crash != null) { try { ShellCommand cmd = crash.getCommand(property); if (cmd != null) { return new ClassDispatcher(cmd, this);
ShellCommand cmd; try { cmd = crash.getCommand(name);
@Override public final Object getProperty(String property) { if (context instanceof InvocationContext<?>) { CRaSH crash = (CRaSH)context.getSession().get("crash"); if (crash != null) { try { ShellCommand cmd = crash.getCommand(property); if (cmd != null) { return new ClassDispatcher(cmd, this); } } catch (NoSuchCommandException e) { throw new InvokerInvocationException(e); } } } // try { return super.getProperty(property); } catch (MissingPropertyException e) { return context.getSession().get(property); } }
@Override public final Object invokeMethod(String name, Object args) { // try { return super.invokeMethod(name, args); } catch (MissingMethodException e) { if (context instanceof InvocationContext) { InvocationContext ic = (InvocationContext)context; CRaSH crash = (CRaSH)context.getSession().get("crash"); if (crash != null) { ShellCommand cmd; try { cmd = crash.getCommand(name); } catch (NoSuchCommandException ce) { throw new InvokerInvocationException(ce); } if (cmd != null) { ClassDispatcher dispatcher = new ClassDispatcher(cmd, this); return dispatcher.dispatch("", CommandClosure.unwrapArgs(args)); } } } // throw e; } }
termPrefix = termPrefix.substring(pos); try { ShellCommand command = crash.getCommand(commandName); if (command != null) { completion = command.complete(new BaseRuntimeContext(this, crash.context.getAttributes()), termPrefix);