Binder
The Binder notifies NeoLoad which conditions are applicable to the Encoder, Decoder, and Namer. It is reloaded each time a JAR file is declared and removed.
The Binder must be:
- a public class
- without a constructor or with the default public constructor
Binder's conditions are predicates to determine whether or not the action should be triggered given an input value. Actions that can be triggered are Encoder, Decoder, or Namer.
Predicates are based on the Java object com.google.common.base.Predicate.
List of supported predicates are accessible from class com.neotys.extensions.codec.predicates.MorePredicates:
- hasHTTPContentType: returns a predicate that evaluates to 'true' if the Entity is an HTTPEntity whose content type is of the given content type.
- isHTTPEntity: returns a predicate that evaluates to 'true' if the Entity is an HTTPEntity.
- isWebSocketEntity: returns a predicate that evaluates to 'true' if the Entity is a WebSocketEntity.
- isRequestEntity: returns a predicate that evaluates to 'true' if the Entity is a request Entity independently from the network protocol.
- isResponseEntity: returns a predicate that evaluates to 'true' if the Entity is a response Entity independently from the network protocol.
- hasChannelResponseHTTPHeader: returns a predicate that evaluates to 'true' if a HTTP header from the channel response is equal to a given value.
- urlContains: returns a predicate that evaluates to "true" when the URL contains the given string, and "false" otherwise. As a result, predicate urlContains can link an HTTP entity (either request or response) to a specific Encoder/Decoder according to the URL of the HTTP request.
Home