Class ControlInfo


public final class ControlInfo extends PMap.MapBasedValue
Information on the type, inputs, outputs and properties of a Control.
  • Field Details

  • Method Details

    • controlType

      public ControlInfo.Type controlType()
      The type of the control.
      Returns:
      control type
    • properties

      public PMap properties()
      Access the map of properties. The map includes the type, inputs, outputs and defaults, as well as any custom or optional properties.

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

      Returns:
      property map
    • defaults

      public List<Value> defaults()
      The list of default values. May be empty if not a property or not specified.
      Returns:
      list of default values
    • inputs

      public List<ArgumentInfo> inputs()
      The list of input ArgumentInfo.
      Returns:
      input argument info
    • outputs

      public List<ArgumentInfo> outputs()
      The list of output ArgumentInfo.
      Returns:
      output argument info
    • createFunctionInfo

      public static ControlInfo createFunctionInfo(List<ArgumentInfo> inputs, List<ArgumentInfo> outputs, PMap properties)
      Create ControlInfo for a function control.
      Parameters:
      inputs - list of input info
      outputs - list of output info
      properties - additional properties (may be null)
      Returns:
      control info
    • createActionInfo

      public static ControlInfo createActionInfo(PMap properties)
      Create ControlInfo for an action control.
      Parameters:
      properties - additional properties (may be null)
      Returns:
      control info
    • createPropertyInfo

      public static ControlInfo createPropertyInfo(ArgumentInfo argument, Value def, PMap properties)
      Create ControlInfo for a property control.
      Parameters:
      argument - property value info
      def - default value
      properties - additional properties (may be null)
      Returns:
      control info
    • createPropertyInfo

      public static ControlInfo createPropertyInfo(List<ArgumentInfo> arguments, List<Value> defaults, PMap properties)
    • createReadOnlyPropertyInfo

      public static ControlInfo createReadOnlyPropertyInfo(ArgumentInfo argument, PMap properties)
      Create ControlInfo for a read-only property control.
      Parameters:
      argument - property value info
      properties - additional properties (may be null)
      Returns:
      control info
    • createReadOnlyPropertyInfo

      public static ControlInfo createReadOnlyPropertyInfo(List<ArgumentInfo> arguments, PMap properties)
    • from

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

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