Class SerializableProtocol

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

public final class SerializableProtocol extends Object implements Protocol
Protocol to serialize all or part of a component tree. The protocol will usually be implemented by a root container.

The standard format is a hierarchical map. Annotation keys, including type, info and connections, are prefixed by %. Child keys are prefixed by @ and the values are maps. Property keys are not prefixed.

 
 %type core:container
 %info ...
 %custom-annotation foo
 property1 true
 @child1 {
   %type core:custom
   %info ...
   property1 42
 }
 @child2 {
   %type core:custom
   %info ...
 }
 %connections { {child1 in child2 out} {child2 ready child1 trigger} }
 
 
  • Field Details

    • SERIALIZE

      public static final String SERIALIZE
      Name of the serialize control.
      See Also:
    • OPTION_SUBTREE

      public static final String OPTION_SUBTREE
      Map key for the optional subtree configuration parameter. The value must be a ComponentAddress that is a sub-component of the component implementing this protocol. The returned data will be as if the subtree component is at the root.
      See Also:
    • SERIALIZE_INFO

      public static final ControlInfo SERIALIZE_INFO
      Control info for the serialize control. The control accepts an optional configuration map.

      Callers may use the configuration key OPTION_SUBTREE to filter the returned data.

      Implementations of this protocol should return an error if they do not recognise any provided configuration key or value.

    • 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

    • SerializableProtocol

      public SerializableProtocol()
  • 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