com.ibm.pdq.annotation
Annotation Type Handler


@Target(value=METHOD)
@Retention(value=RUNTIME)
public @interface Handler

Annotation through which handlers may be specified for an annotated method. Portions of pureQuery execution can be customized with user-provided handlers that implement one of the following interfaces: CallHandlerWithParameters, ParameterHandler, ResultHandler, and RowHandler. The different handlers modify different parts of the execution of the method. Handlers can be specified for annotated methods either by using the @Handler annotation, or by specifying the handlers as parameters to the annotated methods.

When a handler is specified by using the @Handler annotation, pureQuery creates a single instance of the handler that it uses every time the annotated method is invoked. Therefore, specifying handlers with the @Handler annotation is generally slightly faster than specifying them as method parameters, but any handler specified in this way must have a public no-argument constructor.


Optional Element Summary

Modifier and Type Optional Element and Description
 Class<? extends CallHandlerWithParameters> callHandlerWithParameters
          Annotation element through which a custom CallHandlerWithParameters implementation can be specified for an annotated method.
 Class<? extends ParameterHandler> parameterHandler
          Annotation element through which a custom ParameterHandler implementation can be specified for an annotated method.
 Class<? extends ResultHandler> resultHandler
          Annotation element through which a custom ResultHandler implementation can be specified for an annotated method.
 Class<? extends RowHandler> rowHandler
          Annotation element through which a custom RowHandler implementation can be specified for an annotated method.

 

callHandlerWithParameters

public abstract Class<? extends CallHandlerWithParameters> callHandlerWithParameters
Annotation element through which a custom CallHandlerWithParameters implementation can be specified for an annotated method. For more information about how to create a custom class that implements CallHandlerWithParameters and how to specify the class with the annotation, see CallHandlerWithParameters.
See Also:
CallHandlerWithParameters
Default:
com.ibm.pdq.runtime.handlers.CallHandlerWithParameters.class

parameterHandler

public abstract Class<? extends ParameterHandler> parameterHandler
Annotation element through which a custom ParameterHandler implementation can be specified for an annotated method. For more information about how to create a custom class that implements ParameterHandler and how to specify the class with the annotation, see ParameterHandler.
See Also:
ParameterHandler
Default:
com.ibm.pdq.runtime.handlers.ParameterHandler.class

resultHandler

public abstract Class<? extends ResultHandler> resultHandler
Annotation element through which a custom ResultHandler implementation can be specified for an annotated method. For more information about how to create a custom class that implements ResultHandler and how to specify the class with the annotation, see ResultHandler.
See Also:
ResultHandler
Default:
com.ibm.pdq.runtime.handlers.ResultHandler.class

rowHandler

public abstract Class<? extends RowHandler> rowHandler
Annotation element through which a custom RowHandler implementation can be specified for an annotated method. For more information about how to create a custom class that implements RowHandler and how to specify the class with the annotation, see RowHandler.
See Also:
RowHandler
Default:
com.ibm.pdq.runtime.handlers.RowHandler.class