Class ComponentInfo


public class ComponentInfo extends PMap.MapBasedValue
Information about the controls, ports, protocols and properties of a Component.
  • Field Details

    • TYPE_NAME

      public static final String TYPE_NAME
      Value type name.
      See Also:
    • KEY_CONTROLS

      public static final String KEY_CONTROLS
      Map key for the controls map.
      See Also:
    • KEY_PORTS

      public static final String KEY_PORTS
      Map key for the ports map.
      See Also:
    • KEY_PROTOCOLS

      public static final String KEY_PROTOCOLS
      Map key for the protocols list.
      See Also:
    • KEY_COMPONENT_TYPE

      public static final String KEY_COMPONENT_TYPE
      Optional key for storing the ComponentType of the Component in the properties map. value must be a valid component type.
      See Also:
    • KEY_DYNAMIC

      public static final String KEY_DYNAMIC
      Optional key marking the fact that the response from Component.getInfo() or ComponentProtocol may change during the lifetime of the component. Value must currently be a boolean.
      See Also:
    • KEY_DISPLAY_HINT

      public static final String KEY_DISPLAY_HINT
      Optional key for adding a hint how the component, and its children if a container, should be displayed. Value must be a map. The type key is mandatory. Other keys may be used to provide additional configuration.
      See Also:
    • KEY_EXPOSE

      public static final String KEY_EXPOSE
      Optional key for adding a default list of control IDs to give extra priority to exposing to the user. Value must be an array.

      It is up to any editor whether to use or ignore this property (eg. the PraxisLIVE graph editor will show exposed controls on the graph itself). If the editor supports overriding the default list of exposed controls, it should add the altered list under the same key in the ComponentProtocol.META property.

      See Also:
  • Method Details

    • protocols

      public List<String> protocols()
      The list of Protocols supported by the related component.
      Returns:
      list of protocols
    • hasProtocol

      public boolean hasProtocol(Class<? extends Protocol> protocol)
      Query whether the related component has the provided protocol.
      Parameters:
      protocol - protocol class
      Returns:
      true if component has protocol
    • controls

      public List<String> controls()
      The list of controls on the related component. To access the ControlInfo for a control, use controlInfo(java.lang.String).
      Returns:
      list of controls
    • controlInfo

      public ControlInfo controlInfo(String control)
      Access the ControlInfo for the given control.
      Parameters:
      control - name of control
      Returns:
      control info (or null if not in the list of controls)
    • ports

      public List<String> ports()
      The list of ports on the related component. To access the PortInfo for a port, use portInfo(java.lang.String).
      Returns:
      list of ports
    • portInfo

      public PortInfo portInfo(String port)
      Access the PortInfo for the given port.
      Parameters:
      port - name of port
      Returns:
      port info (or null if not in the list of ports)
    • properties

      public PMap properties()
      Access the map of properties. The map includes all the controls, ports and protocols, as well as any custom or optional properties.

      This method is equivalent to calling PMap.MapBasedValue.dataMap().

      Returns:
      property map
    • from

      public static Optional<ComponentInfo> from(Value arg)
      Coerce the provided Value into a ComponentInfo if possible.
      Parameters:
      arg - value of unknown type
      Returns:
      component info or empty optional
    • parse

      public static ComponentInfo parse(String string) throws ValueFormatException
      Parse the provided String into a ComponentInfo if possible.
      Parameters:
      string - text to parse
      Returns:
      component info
      Throws:
      ValueFormatException - if parsing fails
    • info

      public static ArgumentInfo info()
      Convenience method to create an ArgumentInfo for a ComponentInfo argument.
      Returns:
      argument info for ComponentInfo