Interface IntentDispatcher
Internal contract between the build-time-generated intent table and the
framework. Application code should neither implement nor call this --
declare intents with com.codename1.annotations.AppIntent and, if you need
to run one yourself, call Intents.invoke(String, Map).
A single implementation is generated by the Codename One Maven plugin from
the AppIntent and IntentEntity annotations in the project and installs
itself on Intents during startup. Every call it makes into application code
is a direct static invocation emitted at build time: there is no reflection,
which is what lets the whole mechanism survive the iOS translator's dead-code
elimination and Android's obfuscation.
-
Method Summary
Modifier and TypeMethodDescriptiondescribe()Every intent declared in this application.Runs one intent.queryEntities(String entityType, String kind, String argument) Answers an entity query on behalf of the platform, so the system can run its own picker before the handler is called.
-
Method Details
-
describe
List<IntentDeclaration> describe()Every intent declared in this application. -
invoke
Runs one intent. Parameter values arrive as the wire types --
Stringfor entities, which the generated code resolves through the entity'sBY_IDquery before calling the handler.Parameters
intentId: the declared intent idparams: parameter values keyed by name, never nullctx: the invocation context
Returns
the handler's result, or null when no intent has that id
-
queryEntities
Answers an entity query on behalf of the platform, so the system can run its own picker before the handler is called.
Parameters
entityType: the entity type idkind:byId,suggestedorsearchargument: the id forbyId, the search text forsearch, ignored forsuggested
Returns
the matching entities, empty when the type declares no such query
-