com.vaadin.flow.internal.nodefeature.
Class AbstractServerHandlers<T>
- java.lang.Object
-
- com.vaadin.flow.internal.nodefeature.NodeFeature
-
- com.vaadin.flow.internal.nodefeature.NodeList<T>
-
- com.vaadin.flow.internal.nodefeature.SerializableNodeList<String>
-
- com.vaadin.flow.internal.nodefeature.AbstractServerHandlers<T>
-
Type Parameters:
T
- Component type for setComponent(T component)All Implemented Interfaces:
Direct Known Subclasses:
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:
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.vaadin.flow.internal.nodefeature.NodeList
NodeList.SetView<T extends Serializable>
-
-
Constructor Summary
Constructors Constructor Description AbstractServerHandlers(StateNode node)
Creates a new meta information list for the given state node.
-
Method Summary
All Methods Modifier and Type Method Description protected void
addHandlerMethod(Method method, Collection<Method> methods)
Add a handler to the NodeList.
protected void
collectHandlerMethods(Class<?> classWithAnnotations)
Collect methods annotated with the handler annotation for given class.
protected void
collectHandlerMethods(Class<?> clazz, Collection<Method> methods)
Collect all Methods annotated with the handler annotation.
void
componentSet(T component)
Called by
ComponentMapping
whenever a component instance has been set for the node.protected abstract void
ensureSupportedParameterTypes(Method method)
Validate parameter support for given method.
protected void
ensureSupportedReturnType(Method method)
Validate return type support for given method.
DisabledUpdateMode
getDisabledUpdateMode(String handler)
Gets RPC control mode from the client side to the server side for disabled element.
protected abstract Class<? extends Annotation>
getHandlerAnnotation()
Deprecated.
ImplementgetHandlerAnnotationFqn()
insteadprotected String
getHandlerAnnotationFqn()
Gets the annotation FQN which is used to mark methods as handlers.
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.
boolean
hasHandler(String handler)
Checks whether the handler is registered in this feature.
-
Methods inherited from class com.vaadin.flow.internal.nodefeature.SerializableNodeList
add
-
Methods inherited from class com.vaadin.flow.internal.nodefeature.NodeList
add, addAll, clear, collectChanges, forEachChild, generateChangesFromEmpty, get, getChangeTracker, indexOf, isNodeValues, iterator, onDetach, remove, size
-
Methods inherited from class com.vaadin.flow.internal.nodefeature.NodeFeature
allowsChanges, attachPotentialChild, detatchPotentialChild, getNode, onAttach
-
-
-
-
Constructor Detail
-
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 Detail
-
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 modeReturns:
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 checkReturns:
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 formethods
- 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 addmethods
- 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
-
getHandlerAnnotation
@Deprecated protected abstract Class<? extends Annotation> getHandlerAnnotation()
Deprecated.ImplementgetHandlerAnnotationFqn()
insteadGets the annotation which is used to mark methods as handlers.
Returns:
the handler marker annotation
-
getHandlerAnnotationFqn
protected 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 modeReturns:
RPC communication mode for the method, not
null
-
-