Top Description Fields Constructors Methods
org.glassfish.tyrus.core

pack-priv Class AnnotatedClassValidityChecker

extends Object
Class Inheritance
Imports
java.lang.reflect.Method, java.nio.ByteBuffer, java.util.List, .Map, jakarta.websocket.CloseReason, .Decoder, .DeploymentException, .Encoder, .EndpointConfig, .MessageHandler, org.glassfish.tyrus.core.l10n.LocalizationMessages

Used when processing a class annotated with @ServerEndpoint to check that it complies with specification.
Author
Stepan Kopriva

Field Summary

Modifier and TypeField and Description
private final Class<?>
private final ErrorCollector
private final List<Class<? extends Encoder>>
private final MessageHandlerManager

Constructor Summary

AccessConstructor and Description
public
AnnotatedClassValidityChecker(Class<?>
class for which this checker is constructed.
annotatedClass
,
List<Class<? extends Encoder>> encoders, List<Class<? extends Decoder>> decoders, ErrorCollector collector)

Construct the class validity checker.

Method Summary

Modifier and TypeMethod and Description
private boolean
checkEncoders(Class<?> requiredType)

public void
checkOnCloseParams(Method method, Map<Integer, Class<?>>
unknown params of the method.
params
)

Checks whether the params of method annotated with jakarta.websocket.OnClose comply with the specification.

public void
checkOnErrorParams(Method method, Map<Integer, Class<?>>
unknown params of the method.
params
)

Checks whether the params of method annotated with jakarta.websocket.OnError comply with the specification.

public void
checkOnMessageParams(Method method, MessageHandler handler)

Checks whether the params of the method annotated with jakarta.websocket.OnMessage comply with the specification.

private void
public void
checkOnOpenParams(Method method, Map<Integer, Class<?>>
to be checked.
params
)

Checks whether the params of method annotated with jakarta.websocket.OnOpen comply with the specification.

private String
getPrefix(String methodName)

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

annotatedClassback to summary
private final Class<?> annotatedClass
collectorback to summary
private final ErrorCollector collector
encodersback to summary
private final List<Class<? extends Encoder>> encoders
handlerManagerback to summary
private final MessageHandlerManager handlerManager

Constructor Detail

AnnotatedClassValidityCheckerback to summary
public AnnotatedClassValidityChecker(Class<?> annotatedClass, List<Class<? extends Encoder>> encoders, List<Class<? extends Decoder>> decoders, ErrorCollector collector)

Construct the class validity checker.

Parameters
annotatedClass:Class<?>

class for which this checker is constructed.

Method Detail

checkEncodersback to summary
private boolean checkEncoders(Class<?> requiredType)
checkOnCloseParamsback to summary
public void checkOnCloseParams(Method method, Map<Integer, Class<?>> params)

Checks whether the params of method annotated with jakarta.websocket.OnClose comply with the specification.

Parameters
params:Map<Integer, Class<?>>

unknown params of the method.

checkOnErrorParamsback to summary
public void checkOnErrorParams(Method method, Map<Integer, Class<?>> params)

Checks whether the params of method annotated with jakarta.websocket.OnError comply with the specification.

Parameters
params:Map<Integer, Class<?>>

unknown params of the method.

checkOnMessageParamsback to summary
public void checkOnMessageParams(Method method, MessageHandler handler)

Checks whether the params of the method annotated with jakarta.websocket.OnMessage comply with the specification.

Voluntary parameters of type jakarta.websocket.Session and parameters annotated with jakarta.websocket.server.PathParam are checked in advance in AnnotatedEndpoint.

checkOnMessageReturnTypeback to summary
private void checkOnMessageReturnType(Method method)
checkOnOpenParamsback to summary
public void checkOnOpenParams(Method method, Map<Integer, Class<?>> params)

Checks whether the params of method annotated with jakarta.websocket.OnOpen comply with the specification.

Voluntary parameters of type jakarta.websocket.Session and parameters annotated with jakarta.websocket.server.PathParam are checked in advance in AnnotatedEndpoint.

Parameters
params:Map<Integer, Class<?>>

to be checked.

getPrefixback to summary
private String getPrefix(String methodName)
logDeploymentExceptionback to summary
private void logDeploymentException(DeploymentException de)