Package org.jline.reader
Class Reference
- java.lang.Object
-
- org.jline.reader.Reference
-
- All Implemented Interfaces:
Binding
public class Reference extends java.lang.Object implements Binding
A reference to aWidget
by name.The Reference class is a type of
Binding
that refers to a widget by its name rather than directly holding the widget implementation. When a key sequence bound to a Reference is pressed, the LineReader will look up the referenced widget by name and execute it.This indirection allows for more flexible key bindings, as it enables binding keys to widgets that might be defined or redefined after the key binding is established. It also allows multiple key sequences to reference the same widget without duplicating the widget implementation.
References are particularly useful in configuration files where widgets are referred to by name rather than by direct object references.
- See Also:
Widget
,Binding
,LineReader.callWidget(String)
-
-
Constructor Summary
Constructors Constructor Description Reference(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
int
hashCode()
java.lang.String
name()
Returns the name of the referenced widget.java.lang.String
toString()
-
-
-
Method Detail
-
name
public java.lang.String name()
Returns the name of the referenced widget.- Returns:
- the widget name
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-