Class ComponentProtocol

java.lang.Object
org.praxislive.core.protocols.ComponentProtocol
All Implemented Interfaces:
Protocol

public final class ComponentProtocol extends Object implements Protocol
Basic component protocol, providing access to the component info, and optional support for attaching metadata.
  • Field Details

    • INFO

      public static final String INFO
      Name of the info control.
      See Also:
    • META

      public static final String META
      Name of the meta control.
      See Also:
    • META_MERGE

      public static final String META_MERGE
      Name of the meta-merge control.
      See Also:
    • INFO_INFO

      public static final ControlInfo INFO_INFO
      Control info for the info control. A read-only property that returns the component info. The response to calling this control should be the same as calling Component.getInfo().
    • META_INFO

      public static final ControlInfo META_INFO
      Control info for the meta property. This property allows for arbitrary metadata to be attached to a component. Implementations of this property may only allow the value to be set when the existing value is empty or the current value is empty. The meta-merge control should be used to update an existing meta map - see META_MERGE_INFO.
    • META_MERGE_INFO

      public static final ControlInfo META_MERGE_INFO
      Control info for the meta-merge control. This control accepts a map to merge into the existing meta map, and returns the full resulting value.

      The merge is done according to the specification of PMap.REPLACE.

    • API_INFO

      public static final ComponentInfo API_INFO
      A component info for this protocol. Can be used with Info.ComponentInfoBuilder.merge(org.praxislive.core.ComponentInfo).
  • Constructor Details

    • ComponentProtocol

      public ComponentProtocol()
  • Method Details

    • controls

      public Stream<String> controls()
      Description copied from interface: Protocol
      The names of the controls that a component advertising this protocol must provide.
      Specified by:
      controls in interface Protocol
      Returns:
      stream of control names
    • getControlInfo

      public ControlInfo getControlInfo(String control)
      Description copied from interface: Protocol
      Query 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:
      getControlInfo in interface Protocol
      Parameters:
      control - name of control
      Returns:
      control info for named control