Class NoopTranslator

java.lang.Object
gda.jython.translator.NoopTranslator
All Implemented Interfaces:
AliasedCommandProvider, Translator

public class NoopTranslator extends Object implements Translator
This translator performs no actions and returns the input unmodified. Therefore aliasing is not supported.
  • Constructor Details

    • NoopTranslator

      public NoopTranslator()
  • Method Details

    • getAliasedCommands

      public Collection<String> getAliasedCommands()
      Description copied from interface: AliasedCommandProvider
      Returns the list of alias in the GDA command server
      Specified by:
      getAliasedCommands in interface AliasedCommandProvider
      Returns:
      the aliased commands
    • getAliasedVarargCommands

      public Collection<String> getAliasedVarargCommands()
      Description copied from interface: AliasedCommandProvider
      Returns the list of variable argument alias in the GDA command server
      Specified by:
      getAliasedVarargCommands in interface AliasedCommandProvider
      Returns:
      the list of variable argument alias
    • hasAlias

      public boolean hasAlias(String command)
      Description copied from interface: AliasedCommandProvider
      Checks if the the given command is aliased (either vararg or not)
      Specified by:
      hasAlias in interface AliasedCommandProvider
      Parameters:
      command - the string to check
      Returns:
      whether the command is aliased or not
    • translate

      public String translate(String original_command)
      Description copied from interface: Translator
      Translate a command potentially containing GDA extended syntax into the Jython equivalent. Commands should be passed as one string rather than a line at a time as multiline constructs may need to be handled differently.
      Specified by:
      translate in interface Translator
      Parameters:
      original_command - The full command as entered, possibly using extended syntax
      Returns:
      Pure Jython equivalent of originalCommand. If original command contains other syntax errors, a best effort is made to preserve the errors after translation rather than fixing them.
    • addAliasedCommand

      public void addAliasedCommand(String commandName)
      Description copied from interface: Translator
      Adds a new aliased command.
      Specified by:
      addAliasedCommand in interface Translator
      Parameters:
      commandName -
    • addAliasedVarargCommand

      public void addAliasedVarargCommand(String commandName)
      Description copied from interface: Translator
      Adds a new variable argument aliased command.
      Specified by:
      addAliasedVarargCommand in interface Translator
      Parameters:
      commandName -
    • removeAlias

      public void removeAlias(String command)
      Description copied from interface: Translator
      Remove the given command from the held lists of aliases. This will remove the command from both vararg and non-vararg lists
      Specified by:
      removeAlias in interface Translator
      Parameters:
      command - to remove