java.lang.Object
org.praxislive.core.protocols.ContainerProtocol
- All Implemented Interfaces:
Protocol
A container protocol that allows for calls to add / remove child components,
and connect / disconnect their ports.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.praxislive.core.Protocol
Protocol.Type<T extends Protocol>, Protocol.TypeProvider -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringName of the add-child control.static final ControlInfoInfo for the add-child control.static final ComponentInfoA component info for this protocol.static final StringName of the children control.static final ControlInfoInfo for the children control.static final StringName of the connect control.static final ControlInfoInfo for the connect control.static final StringName of the connections control.static final ControlInfoInfo for the connections control.static final StringName of the disconnect control.static final ControlInfoInfo for the disconnect control.static final StringName of the remove-child control.static final ControlInfoInfo for the remove-child control.static final StringName of the supported-types control.static final ControlInfoInfo for the (optional) supported-types control. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontrols()The names of the controls that a component advertising this protocol must provide.getControlInfo(String control) Query the ControlInfo for the provided control name on this protocol.The names of additional controls that a component advertising this protocol might provide.
-
Field Details
-
ADD_CHILD
Name of the add-child control.- See Also:
-
REMOVE_CHILD
Name of the remove-child control.- See Also:
-
CHILDREN
Name of the children control.- See Also:
-
CONNECT
Name of the connect control.- See Also:
-
DISCONNECT
Name of the disconnect control.- See Also:
-
CONNECTIONS
Name of the connections control.- See Also:
-
SUPPORTED_TYPES
Name of the supported-types control.- See Also:
-
ADD_CHILD_INFO
Info for the add-child control. It is a function control that accepts two arguments, the child name and the component type. It returns no arguments. It will respond with an error if the child cannot be added. -
REMOVE_CHILD_INFO
Info for the remove-child control. It is a function control that accepts one argument, the child name. It returns no arguments. -
CHILDREN_INFO
Info for the children control. It is a read-only property control that returns a PArray of child names. The response is equivalent toContainer.children(). -
CONNECT_INFO
Info for the connect control. It is a function control that accepts four arguments, the first component name, the first port name, the second component name, and the second port name. It returns no arguments. It will response with an error if the connection cannot be made. -
DISCONNECT_INFO
Info for the disconnect control. It is a function control that accepts four arguments, the first component name, the first port name, the second component name, and the second port name. It returns no arguments. -
CONNECTIONS_INFO
Info for the connections control. It is a read-only property that returns a PArray of PArray. Each internal PArray consists of four values, corresponding to the arguments passed to each call to connect. -
SUPPORTED_TYPES_INFO
Info for the (optional) supported-types control. It is a read-only property that returns a PArray consisting of all supportedComponentTypethat can be passed to add-child.A
SupportedTypesimplementation may be registered in the container'sLookupto facilitate implementation of this control by child containers. -
API_INFO
A component info for this protocol. Can be used withInfo.ComponentInfoBuilder.merge(org.praxislive.core.ComponentInfo).This does not contain info for optional controls (ie. supported-types) which must be added additionally if required.
-
-
Constructor Details
-
ContainerProtocol
public ContainerProtocol()
-
-
Method Details
-
controls
Description copied from interface:ProtocolThe names of the controls that a component advertising this protocol must provide. -
optionalControls
Description copied from interface:ProtocolThe names of additional controls that a component advertising this protocol might provide. These controls are optional. Any caller should check whether the component info contains the control, or otherwise prepare for the control not to be available.Implementation note : the protocol implementation should support querying the control info via
Protocol.getControlInfo(java.lang.String). The default implementation returns an empty stream.- Specified by:
optionalControlsin interfaceProtocol- Returns:
- stream of optional control names
-
getControlInfo
Description copied from interface:ProtocolQuery the ControlInfo for the provided control name on this protocol. The component implementing this protocol will generally use the control info provided here inside its component info. In exceptional circumstances, the component may extend or adapt the behaviour of the control, as long as it is fully compatible with this control info and the specification.- Specified by:
getControlInfoin interfaceProtocol- Parameters:
control- name of control- Returns:
- control info for named control
-