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 aWidgetby name.The Reference class is a type of
Bindingthat 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 booleanequals(java.lang.Object o)inthashCode()java.lang.Stringname()Returns the name of the referenced widget.java.lang.StringtoString()
-
-
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-