Package org.apache.juneau.console
Class HandlerRef
java.lang.Object
org.apache.juneau.console.HandlerRef
A reference to a client-side handler: a registered name or an opt-in inline body.
Names use the ns.name grammar and are registered on the page with JuneauViews.handlers.register.
The juneau.* namespace is reserved for the built-ins (see builtin(String)).
Example:
HandlerRef
- Since:
- 10.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerRefA built-in handler.booleaninthashCode()static HandlerRefAn inline handler body, compiled on the client asfunction(target, event).booleanisInline()Returns whether this is an inline body.name()Returns the handler name.static HandlerRefA registered handler name.toJson()Returns the contract JSON form.toString()
-
Method Details
-
named
A registered handler name.- Parameters:
name- The name, e.g.orders.refresh. Ajuneau.-prefixed name is accepted only when it names a built-in.- Returns:
- A new reference.
- Throws:
IllegalArgumentException- If the name is malformed or uses the reserved namespace.
-
builtin
A built-in handler.- Parameters:
name- The built-in name without prefix, e.g.refresh.- Returns:
- A reference to
juneau.<name>. - Throws:
IllegalArgumentException- If the name is not a built-in.
-
inline
An inline handler body, compiled on the client asfunction(target, event). NeedsPageSpec.allowInlineHandlers(true).- Parameters:
body- The function body.- Returns:
- A new reference.
- Throws:
IllegalArgumentException- If the body is blank.
-
name
Returns the handler name.- Returns:
- The name, or
null for an inline reference.
-
isInline
Returns whether this is an inline body.- Returns:
true if inline.
-
toJson
Returns the contract JSON form.- Returns:
- The name string, or
{"inline": body}.
-
equals
-
hashCode
-
toString
-