shelf_bind library

Classes

BaseResponseBinding
BasicHandlerParameterBinding
The most common sort of HandlerParameterBinding [...]
BindMode
Describes how the data (e. path parameters, form data) will be bound to the class. [...]
BodyHandlerParameterSource
A HandlerParameterSource that extracts the data from the requests body
BoundHandlerAdapter
a HandlerAdapter for shelf_bind. [...]
ComplexMapToObjectConverter
ComplexParameterTypeConverter
Converts the data for a handler parameter into another non simple class
ComplexRequestHandlerParam
ConstructorBasedMapToObjectConverter
A MapToObjectConverter that invokes a constructor (with default name of #build) of given class, mapping the names of constructor parameters, to request path parameters according to the associated TypeBinding
ContentType
Representation of a content type. An instance of ContentType is immutable.
ContentTypeBasedObjectConverter
CustomObjectParameterBinding
A HandlerParameterBinding that binds to a provided custom object using the associated CustomObjectFactory
HandlerBinding
A binding between an Dart Function and a shelf Handler [...]
HandlerParameterBinding
Describes how a single parameter of a handler function is populated. It includes (either explicitly or implicitly) where the data comes from (almost always from the Request or derived from the request) and any transformations that are applied to that data. [...]
HandlerParameterSource
Extracts the data for the handler parameter from Requests
HeaderHandlerParameterSource
A HandlerParameterSource that extracts the data from a single header field of the request
HeaderParam
IdentityMapToObjectConverter
JsonResponseBinding
JsonToObjectConverter
A MapToObjectConverter that invokes the #fromJson constructor of a given class
MapBasedParameterTypeConverter
A ComplexParameterTypeConverter that uses a Map as an intermediate representation of the object. It uses an associated mapDecoder to first convert the data from the source form (typically a String) into a Map then passes the map into the associated converter to turn it into an object of the target type
MapToObjectConverter
converts a Map into some other Class
MemberBinding
MultiPathHandlerParameterSource
A HandlerParameterSource that extracts the data from several path parameters
ParameterTypeConverter
Converts the data for a handler parameter into another type
PathHandlerParameterSource
A HandlerParameterSource that extracts the data from a single path parameter of the request
PathParam
An annotation that indicates that a handler parameter should be bound to a single request parameter. [...]
PathParams
An annotation that indicates that a complex handler parameter should be bound to one or more request parameters. [...]
RequestBody
An annotation that indicates that a handler parameter should be bound to the request body. Note that this annotation can often be omitted, as the default behaviour is for non basic types to be mapped to a JSON body. You should provide this annotation when you want to override this behaviour. [...]
RequestHandlerParam
RequestObjectParameterBinding
A special CustomObjectParameterBinding for the Request class
ResponseBinding
ResponseHeaders
Annotation to tweak default creating of responses
SetterBasedMapToObjectConverter
A MapToObjectConverter that invokes an empty constructor of the given class, mapping the names of property setters to request path parameters according to the associated TypeBinding
SimpleParameterTypeConverter
Converts the data for a handler parameter into another simple type
TypeBinding

Functions

bind(Function handler, { Map<Type, CustomObjectFactory> customObjects, bool validateParameters: false, bool validateReturn: false }) Handler
Bind properties (path parameters, body) of a Request to the parameters of a handler function. [...]
bindManually(Function handler, { List<HandlerParameterBinding> parameterBindings: const [], ResponseBinding responseBinding, Map<Type, CustomObjectFactory> customObjects, bool validateParameters: false, bool validateReturn: false }) Handler
Bind properties (path parameters, body) of a Request to the parameters of a handler function, by manually providing all the bindings. [...]
formMapDecoder(String str, { ContentType requestContentType }) Map
handlerAdapter({Map<Type, CustomObjectFactory> customObjects: const {}, bool validateParameters: false, bool validateReturn: false }) HandlerAdapter
Specify customObjects to support injection of arbitrary objects into your handler functions. When the binders encounter such parameters in your function it will call the factory you provide in customObjects instead of performing the normal binding process. [...]
identityMapDecoder(Map map, { ContentType requestContentType }) Map
jsonMapDecoder(String str, { ContentType requestContentType }) Map
requestContentTypeMapDecoder(String str, { ContentType requestContentType }) Map

Typedefs

CustomObjectFactory(Request request) → dynamic
ToMapDecoder(dynamic value, { ContentType requestContentType }) Map
decodes a value into a Map