public 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.
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.
Methods
Method details
describe
public abstract List<IntentDeclaration> describe()Every intent declared in this application.
invoke
public abstract IntentResult invoke(String intentId, Map<String, Object> params, IntentContext ctx)Runs one intent. Parameter values arrive as the wire types –
String
for entities, which the generated code resolves through the entity’s
BY_ID query before calling the handler.Parameters
intentIdString- the declared intent id
paramsMap<String, Object>- parameter values keyed by name, never null
ctxIntentContext- the invocation context
Returns
the handler’s result, or null when no intent has that id
queryEntities
public abstract List<AppEntity> 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.
Parameters
entityTypeString- the entity type id
kindStringbyId,suggestedorsearchargumentString- the id for
byId, the search text forsearch, ignored forsuggested
Returns
the matching entities, empty when the type declares no such query