Class AbstractOutput<T>

java.lang.Object
com.vaadin.flow.component.trigger.AbstractOutput<T>
Type Parameters:
T - the runtime type of the value produced
All Implemented Interfaces:
Output<T>, Serializable
Direct Known Subclasses:
JsOutput, PropertyOutput, SignalOutput

public abstract class AbstractOutput<T> extends Object implements Output<T>
Base class for Output implementations.

Subclasses identify themselves with a namespaced type id ("flow:property", "myapp:caret-offset", …) which must match a factory registered against window.Vaadin.Flow.triggers on the client side. Subclasses override buildClientConfig(com.vaadin.flow.component.trigger.internal.ConfigContext) when they need to ship configuration with the output.

See Also:
  • Constructor Details

    • AbstractOutput

      protected AbstractOutput(String typeId, Class<T> valueType)
      Creates a new output.
      Parameters:
      typeId - namespaced type id matching a client factory, not null
      valueType - runtime type of the produced value, not null
  • Method Details

    • getTypeId

      public final String getTypeId()
      The namespaced type id of this output.
      Returns:
      the type id, never null
    • getValueType

      public final Class<T> getValueType()
      The runtime type of the value this output produces.
      Returns:
      the value type, never null
    • buildClientConfig

      public tools.jackson.databind.node.ObjectNode buildClientConfig(ConfigContext context)
      Produces the JSON configuration this output sends to the client. Default is an empty object; override to add type-specific options.

      Subclasses encode element references by calling ConfigContext.referenceElement(com.vaadin.flow.dom.Element). Public so the internal framework can read the config without reflection; subclasses just override.

      Parameters:
      context - the resolver for referenced elements, not null
      Returns:
      a Jackson ObjectNode, never null