Kanzi  3.9.9
Kanzi Engine Java API
MessageArguments Class Reference

MessageArguments is the base class for arguments passed in messages. More...

Inherits NativeObject.

Inherited by ActivityConceptMetadata.ActivityInternalMessageArguments, ActivityConceptMetadata.ActivityMessageArguments, ActivityConceptMetadata.ActivityPrefabMessageArguments, ActivityConceptMetadata.StartActivationInternalMessageArguments, ActivityConceptMetadata.StatusChangedInternalMessageArguments, ActivityHostConceptMetadata.ActivationMessageArguments, ActivityHostConceptMetadata.RegisterActivityElementInternalMessageArguments, ActivityHostConceptMetadata.UnregisterActivityElementInternalMessageArguments, ButtonConceptMetadata.CanceledMessageArguments, ButtonConceptMetadata.ClickedMessageArguments, ButtonConceptMetadata.LongPressMessageArguments, ButtonConceptMetadata.PointerEnteredMessageArguments, ButtonConceptMetadata.PointerLeftMessageArguments, ButtonConceptMetadata.PressedMessageArguments, ButtonConceptMetadata.ToggledOffMessageArguments, ButtonConceptMetadata.ToggledOnMessageArguments, ButtonConceptMetadata.ToggleStateChangedMessageArguments, CommandMetadata.CommandMessageArguments, ExclusiveActivityHostConceptMetadata.ImplicitActivityChangeRequestMessageArguments, FocusManagerMetadata.InputOutsideOverlayMessageArguments, FocusManagerMetadata.MoveFocusMessageArguments, FocusManagerMetadata.PostFocusMessageArguments, FocusManagerMetadata.ScopeStateChangeMessageArguments, InputManipulatorMetadata.InputMessageArguments, InputManipulatorMetadata.KeyInputMessageArguments, KeyboardMetadata.KeyStateChangedMessageArguments, ListBoxConceptMetadata.ItemMessageArguments, ListBoxConceptMetadata.ItemSelectedMessageArguments, ListBoxScrollingConceptMetadata.ScrollMessageArguments, NodeComponentMetadata.NodeComponentMessageArguments, NodeComponentMetadata.NodeComponentSourceMessageArguments, NodeMetadata.NodeComponentMessageArguments, NodeMetadata.NodeComponentSourceMessageArguments, PageMetadata.ActivatedMessageArguments, PageMetadata.DeactivatedMessageArguments, PageMetadata.NavigateMessageArguments, PageMetadata.NavigationActivatedMessageArguments, PageMetadata.NavigationDeactivatedMessageArguments, PageMetadata.NavigationFinishedMessageArguments, PageMetadata.NavigationStartedMessageArguments, PageMetadata.RegisterToNavigationdMessageArguments, PageMetadata.UnregisterFromNavigationMessageArguments, PrefabViewConceptMetadata.AsynchronousLoadCompletedMessageArguments, PrefabViewConceptMetadata.LoadAsynchronouslyMessageArguments, RangeConceptMetadata.CommonMessageArguments, ScreenMetadata.ActivateThemeMessageArguments, ScrollViewConceptMetadata.ScrollDirectionMessageArguments, ScrollViewConceptMetadata.ScrollDownMessageArguments, ScrollViewConceptMetadata.ScrollEdgeMessageArguments, ScrollViewConceptMetadata.ScrollEndMessageArguments, ScrollViewConceptMetadata.ScrollHomeMessageArguments, ScrollViewConceptMetadata.ScrollLeftMessageArguments, ScrollViewConceptMetadata.ScrollMessageArguments, ScrollViewConceptMetadata.ScrollPageDownMessageArguments, ScrollViewConceptMetadata.ScrollPageMessageArguments, ScrollViewConceptMetadata.ScrollPageUpMessageArguments, ScrollViewConceptMetadata.ScrollRightMessageArguments, ScrollViewConceptMetadata.ScrollUpMessageArguments, ScrollViewConceptMetadata.SetScrollMessageArguments, ScrollViewConceptMetadata.SetScrollTargetMessageArguments, ScrollViewConceptMetadata.SnapRequestMessageArguments, ScrollViewConceptMetadata.ZoomedMessageArguments, StateManagerMetadata.StateManagerMessageArguments, TextBoxConceptMetadata.CursorPositionMessageArguments, TextBoxConceptMetadata.EditingStateChangedMessageArguments, TextBoxConceptMetadata.InputMethodActionMessageArguments, TextBoxConceptMetadata.InputMethodAvailableMessageArguments, TextBoxConceptMetadata.TextChangedMessageArguments, TextBoxConceptMetadata.TextCompositionStateMessageArguments, TextBoxConceptMetadata.TextContentMessageArguments, TextBoxConceptMetadata.TextInsertionMessageArguments, TextBoxConceptMetadata.TextRangeMessageArguments, TextBoxMetadata.CharacterRemovalMessageArguments, TextBoxMetadata.CursorPositionMessageArguments, TextBoxMetadata.DeleteSelectionMessageArguments, TextBoxMetadata.EditingStateChangedMessageArguments, TextBoxMetadata.InputMethodActionMessageArguments, TextBoxMetadata.InputMethodAvailableMessageArguments, TextBoxMetadata.ModifyEditingStateMessageArguments, TextBoxMetadata.ModifySelectionMessageArguments, TextBoxMetadata.MoveCursorMessageArguments, TextBoxMetadata.TextChangedMessageArguments, TextBoxMetadata.TextCompositionStateMessageArguments, TextBoxMetadata.TextContentMessageArguments, TextBoxMetadata.TextInsertionMessageArguments, TextBoxMetadata.TextRangeMessageArguments, TextInputConceptMetadata.CursorMovedMessageArguments, TextInputConceptMetadata.InputMethodActionMessageArguments, TextInputConceptMetadata.InputMethodAvailableChangedMessageArguments, TextInputConceptMetadata.InputMethodsDisconnectedMessageArguments, TextInputConceptMetadata.InputTypeChangedMessageArguments, TextInputConceptMetadata.ReadOnlyStateChangedMessageArguments, TextInputConceptMetadata.SelectionChangedMessageArguments, TextInputConceptMetadata.TextChangedMessageArguments, TextInputConceptMetadata.TextCompositionStateMessageArguments, and ToggleButtonGroupConceptMetadata.ToggleButtonGroupConceptMessageArguments.

Public Member Functions

 MessageArguments ()
 Constructs a new MessageArguments object. More...
 
TDataType getArgument (PropertyType< TDataType > propertyType)
 Returns the value of an argument. More...
 
TDataType getOptionalArgument (PropertyType< TDataType > propertyType)
 Returns the value of an argument, but does not use the default value if there are no inputs to the argument value. More...
 
TNodeType getSource ()
 Returns the source node for a message. More...
 
MessageArgumentsWrapper getWrapper ()
 Gets a wrapper for this MessageArguments. More...
 
boolean isHandled ()
 Returns whether the message is handled. More...
 
void setArgument (PropertyType< TDataType > propertyType, TDataType value)
 Sets the value of an argument. More...
 
void setArgument (PropertyType< Integer > propertyType, EnumType value)
 Sets the value of an integer argument using a constant from an enumeration. More...
 
void setHandled (boolean handled)
 Sets the handling status for a message. More...
 

Static Public Member Functions

static MessageArgumentsWrapper getWrapper (MessageArguments messageArguments)
 Gets a wrapper for a MessageArguments object. More...
 

Protected Member Functions

 MessageArguments (MessageArgumentsWrapper wrapper)
 Wraps a native message argument. More...
 
 MessageArguments (long nativeObject)
 Wraps a native message argument. More...
 

Detailed Description

MessageArguments is the base class for arguments passed in messages.

An instance of MessageArguments together with an instance of MessageType forms a Kanzi message. In Kanzi when you dispatch a message, you dispatch a message of certain type and arguments.

You can derive your own custom message arguments type from this class or an existing derivation of this class, where you can define the property types associated to your message and any convenience functions like getters and setters. Make sure to expose proper constructors from your class, see constructors of this class for more information.

Constructor & Destructor Documentation

Constructs a new MessageArguments object.

When deriving a custom message arguments class, you will typically call this constructor from your main constructor.

MessageArguments ( MessageArgumentsWrapper  wrapper)
protected

Wraps a native message argument.

This constructor is used by Kanzi when delivering a message to a handler in Java.

When deriving a custom message arguments class, you will need to expose a constructor of matching signature, where you must simply forward the received argument to this constructor.

Parameters
wrapperReference to native message argument.
MessageArguments ( long  nativeObject)
protected

Wraps a native message argument.

This constructor is used by Kanzi when delivering a message to a handler in Java.

When deriving a custom message arguments class, you will need to expose a constructor of matching signature, where you must simply forward the received argument to this constructor.

Parameters
nativeObjectReference to native message argument.

Member Function Documentation

TDataType getArgument ( PropertyType< TDataType >  propertyType)

Returns the value of an argument.

Parameters
propertyTypeThe PropertyType argument whose value to fetch.
<TDataType>Data type of the property, optional.
Returns
The value of the argument. If the argument is not present in this message arguments instance, returns the default value of the PropertyType.
TDataType getOptionalArgument ( PropertyType< TDataType >  propertyType)

Returns the value of an argument, but does not use the default value if there are no inputs to the argument value.

Parameters
propertyTypeThe PropertyType argument whose value to fetch.
<TDataType>Data type of the property, optional.
Returns
The value of the argument. If the argument is not present in this message arguments instance, returns null.
TNodeType getSource ( )

Returns the source node for a message.

Parameters
<TNodeType>The expected type of the node, optional.
Returns
The source node where the message was dispatched.
static MessageArgumentsWrapper getWrapper ( MessageArguments  messageArguments)
static

Gets a wrapper for a MessageArguments object.

Parameters
messageArgumentsThe MessageArguments object to wrap.
Returns
A MessageArgumentsWrapper pointing to a MessageArguments object.
MessageArgumentsWrapper getWrapper ( )

Gets a wrapper for this MessageArguments.

Returns
MessageArgumentsWrapper, or null for this MessageArguments.
boolean isHandled ( )

Returns whether the message is handled.

Returns
If the message is handled, true, otherwise false.
void setArgument ( PropertyType< TDataType >  propertyType,
TDataType  value 
)

Sets the value of an argument.

Parameters
propertyTypeThe PropertyType argument whose value to set.
valueThe value to set for the argument.
<TDataType>Data type of the property, optional.
void setArgument ( PropertyType< Integer >  propertyType,
EnumType  value 
)

Sets the value of an integer argument using a constant from an enumeration.

Parameters
propertyTypeThe property type identifying the property to set.
valueThe enumeration constant to get the integer value from.
See also
MessageArguments::setArgument(PropertyType, Object)
void setHandled ( boolean  handled)

Sets the handling status for a message.

Parameters
handledThe new handling status.