KeyResolver
final class KeyResolver
Package: dev.joid.lib.input.key.resolver · Module: core · Source: KeyResolver.java
The registry of the key resolvers that turn the bindings of your application into keys for shortcuts.
Description
Section titled “Description”A Shortcut created from an object that is not a Key asks this registry which key it stands for.
In dev mode, a shortcut whose binding no resolver knows prints a warning when it is created, and fires once a resolver that knows it is registered.
Learn more
Section titled “Learn more”Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
void | register(IKeyResolver resolver) static | Adds a resolver, asked before every resolver registered earlier. |
void | unregister(IKeyResolver resolver) static | Removes a resolver; the shortcuts whose binding only it knew stop firing. |
boolean | supports(Object binding) static | If true, the binding is a Key or when a registered resolver supports it. |
Key | resolve(Object binding) static | Returns the key of a binding: a Key as it is, any other object through the first resolver that supports it. |
Method details
Section titled “Method details”register
Section titled “register”void register(IKeyResolver resolver) static
Adds a resolver, asked before every resolver registered earlier. Registering the same resolver again moves it to the front.
unregister
Section titled “unregister”void unregister(IKeyResolver resolver) static
Removes a resolver; the shortcuts whose binding only it knew stop firing.
supports
Section titled “supports”boolean supports(Object binding) static
If true, the binding is a Key or when a registered resolver supports it.
resolve
Section titled “resolve”Key resolve(Object binding) static
Throws:
IllegalArgumentException: No key resolver knows the binding … of type …, pass a Key or register an IKeyResolver with KeyResolver.register(…)
Returns the key of a binding: a Key as it is, any other object through the first resolver that supports it.
Throws an IllegalArgumentException when no resolver supports the binding.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
