Package org.jline.shell
Interface LineExpander
-
- All Known Implementing Classes:
ConsoleLineExpander,DefaultLineExpander
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface LineExpanderExpands variables and other expressions in a command line before parsing.A
LineExpanderoperates on the full command line string (not per-word likeExpander). It is called after alias expansion and before pipeline parsing.The exact expansion syntax is controlled by the implementation. Users can provide their own
LineExpanderto support custom variable syntax, glob expansion, or other transformations.Example:
LineExpander expander = (line, session) -> line.replace("$HOME", "/home/user");- Since:
- 4.0
- See Also:
DefaultLineExpander,ShellBuilder.lineExpander(LineExpander)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.Stringexpand(java.lang.String line, CommandSession session)Expands variables and expressions in the given command line.
-
-
-
Method Detail
-
expand
java.lang.String expand(java.lang.String line, CommandSession session)Expands variables and expressions in the given command line.- Parameters:
line- the command line to expandsession- the current command session (for variable lookup)- Returns:
- the expanded command line
-
-