Class SharedCodeProtocol

java.lang.Object
org.praxislive.code.SharedCodeProtocol
All Implemented Interfaces:
Protocol

public class SharedCodeProtocol extends Object implements Protocol
Protocol for a container that provides shared code that can be used by code in child components. The shared-code property wraps a map of full class names to Java source code. The shared-code-add and shared-code-merge functions allow for updating the property with a partial map.
  • Field Details

    • SHARED_CODE

      public static final String SHARED_CODE
      Standard control ID for shared code property.
      See Also:
    • SHARED_CODE_ADD

      public static final String SHARED_CODE_ADD
      Standard control ID for shared code add function.
      See Also:
    • SHARED_CODE_MERGE

      public static final String SHARED_CODE_MERGE
      Standard control ID for shared code merge function.
      See Also:
    • SHARED_CODE_INFO

      public static final ControlInfo SHARED_CODE_INFO
      Control info for the shared code property control.
    • SHARED_CODE_ADD_INFO

      public static final ControlInfo SHARED_CODE_ADD_INFO
      Control info for the shared code add control. The input map is merged with the existing shared code using the rules of PMap.IF_ABSENT.
    • SHARED_CODE_MERGE_INFO

      public static final ControlInfo SHARED_CODE_MERGE_INFO
      Control info for the shared code merge control. The input map is merged with the existing shared code using the rules of PMap.REPLACE.
    • API_INFO

      public static final ComponentInfo API_INFO
  • Constructor Details

    • SharedCodeProtocol

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