com.vaadin.flow.internal.nodefeature.

Class AbstractServerHandlers<T>

Type Parameters:

T - Component type for setComponent(T component)

All Implemented Interfaces:

Serializable

Direct Known Subclasses:

ClientCallableHandlers, PolymerServerEventHandlers

public abstract class AbstractServerHandlers<T> extends SerializableNodeList<String>

Abstract class for collecting Methods which are published as serverObject.<name> on the client side.

For internal use only. May be renamed or removed in a future release.

Since:

1.0

Author:

Vaadin Ltd

See Also:

  • Constructor Details

    • AbstractServerHandlers

      public AbstractServerHandlers(StateNode node)

      Creates a new meta information list for the given state node.

      Parameters:

      node - the state node this list belongs to

  • Method Details

    • ensureSupportedParameterTypes

      protected abstract void ensureSupportedParameterTypes(Method method)

      Validate parameter support for given method. Should validate parameter amount and parameter types.

      Parameters:

      method - Method to check parameters for

    • componentSet

      public void componentSet(T component)

      Called by ComponentMapping whenever a component instance has been set for the node.

      Parameters:

      component - the component instance which was set

    • getDisabledUpdateMode

      public DisabledUpdateMode getDisabledUpdateMode(String handler)

      Gets RPC control mode from the client side to the server side for disabled element.

      Parameters:

      handler - the handler name to get control mode

      Returns:

      the handler RPC control mode for disabled element

    • hasHandler

      public boolean hasHandler(String handler)

      Checks whether the handler is registered in this feature.

      Parameters:

      handler - the handler to check

      Returns:

      true if handler is registered in the feature

    • collectHandlerMethods

      protected void collectHandlerMethods(Class<?> classWithAnnotations)

      Collect methods annotated with the handler annotation for given class.

      Parameters:

      classWithAnnotations - Class to collect methods for

    • collectHandlerMethods

      protected void collectHandlerMethods(Class<?> clazz, Collection<Method> methods)

      Collect all Methods annotated with the handler annotation.

      Parameters:

      clazz - Class to check methods for

      methods - Collection to add methods to

    • addHandlerMethod

      protected void addHandlerMethod(Method method, Collection<Method> methods)

      Add a handler to the NodeList.

      Parameters:

      method - Method to verify and add

      methods - Collection to add method to

    • ensureSupportedReturnType

      protected void ensureSupportedReturnType(Method method)

      Validate return type support for given method.

      Parameters:

      method - method to check return type for

    • getHandlerAnnotationFqn

      protected abstract String getHandlerAnnotationFqn()

      Gets the annotation FQN which is used to mark methods as handlers.

      Returns:

      the handler marker annotation

    • getUpdateMode

      protected abstract DisabledUpdateMode getUpdateMode(Method method)

      Returns method's RPC communication mode from the client side to the server side when the element is disabled.

      Parameters:

      method - the method to get its update mode

      Returns:

      RPC communication mode for the method, not null