java.lang.Object
org.praxislive.core.Watch
Utilities related to Watch controls. A Watch control is a
ControlInfo.Type.Function control for accessing data of a component.
It is similar to a read-only property, but designed for data that should only
be calculated on demand, perhaps asynchronously.
Watch controls have a watch attribute in their info, with a map value
of information about the available data. The map should include the mime type
of the returned data. The response value type of the control will usually be
for textual mime types and
invalid reference
PString
for binary mime
types. Specifically defined private mime types may specify other value types.
invalid reference
PBytes
Watch controls may accept an optional query argument as a map of attributes for the requested data (eg. size).
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic ControlInfoCreate info for a simple Watch function that accepts no query argument, and returns data with the provided mime type wrapped in the provided response type.static booleanisWatch(ControlInfo info) Check whether a control info reflects a Watch control.
-
Field Details
-
WATCH_KEY
The key under which the Watch information is stored in the control info.- See Also:
-
MIME_KEY
The key for the mime type inside the Watch information.- See Also:
-
RELATED_PORT_KEY
Optional Watch information key for relating a Watch to a port. The value, if present, should be the ID of a port on the component.- See Also:
-
-
Method Details
-
info
Create info for a simple Watch function that accepts no query argument, and returns data with the provided mime type wrapped in the provided response type.- Parameters:
mimeType- mime type of responseresponseType- value type of response- Returns:
- watch control info
-
isWatch
Check whether a control info reflects a Watch control.- Parameters:
info- control info- Returns:
- true if a Watch control
-