Class LambdaRestMounter
- java.lang.Object
-
- org.wicketstuff.rest.lambda.mounter.LambdaRestMounter
-
public class LambdaRestMounter extends Object
REST resource mounter. The resources are built using the provided functions/consumers.- Author:
- andrea
- See Also:
SimpleLambdaResource,TextOutputLambdaResource
-
-
Constructor Summary
Constructors Constructor Description LambdaRestMounter(WebApplication application)Constructor for the mounter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)Mount aSimpleLambdaResourceto the given path and for HTTP method DELETE.voiddelete(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)Mount aTextOutputLambdaResourceto the given path and for HTTP method DELETE.voidget(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)Mount aSimpleLambdaResourceto the given path and for HTTP method GET.voidget(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)Mount aTextOutputLambdaResourceto the given path and for HTTP method GET.voidhead(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)Mount aSimpleLambdaResourceto the given path and for HTTP method HEAD.voidhead(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)Mount aTextOutputLambdaResourceto the given path and for HTTP method HEAD.ResourceMappermountRestResource(org.wicketstuff.restutils.http.HttpMethod httpMethod, String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)Mount aSimpleLambdaResourceto the given path and for the given http methodResourceMappermountRestResource(org.wicketstuff.restutils.http.HttpMethod httpMethod, String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)Mount aTextOutputLambdaResourceto the given path and for the given http methodprotected ResourceMappermountRestResource(org.wicketstuff.restutils.http.HttpMethod httpMethod, String path, IResource resource)Mount rest resource.voidoptions(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)Mount aSimpleLambdaResourceto the given path and for HTTP method OPTIONS.voidoptions(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)Mount aTextOutputLambdaResourceto the given path and for HTTP method OPTIONS.voidpatch(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)Mount aSimpleLambdaResourceto the given path and for HTTP method PATCH.voidpatch(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)Mount aTextOutputLambdaResourceto the given path and for HTTP method PATCH.voidpost(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)Mount aSimpleLambdaResourceto the given path and for HTTP method POST.voidpost(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)Mount aTextOutputLambdaResourceto the given path and for HTTP method POST.voidput(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)Mount aSimpleLambdaResourceto the given path and for HTTP method PUT.voidput(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)Mount aTextOutputLambdaResourceto the given path and for HTTP method PUT.voidtrace(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)Mount aSimpleLambdaResourceto the given path and for HTTP method TRACE.voidtrace(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)Mount aTextOutputLambdaResourceto the given path and for HTTP method TRACE.
-
-
-
Constructor Detail
-
LambdaRestMounter
public LambdaRestMounter(WebApplication application)
Constructor for the mounter.- Parameters:
application- The web application we are using.
-
-
Method Detail
-
post
public void post(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)
Mount aTextOutputLambdaResourceto the given path and for HTTP method POST.- Parameters:
path- the mounting pathrespondFunction- the respond functionoutputFunction- the output function
-
post
public void post(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
Mount aSimpleLambdaResourceto the given path and for HTTP method POST.- Parameters:
path- the mounting pathrespondConsumer- the respond consumer
-
get
public void get(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)
Mount aTextOutputLambdaResourceto the given path and for HTTP method GET.- Parameters:
path- the mounting pathrespondFunction- the respond functionoutputFunction- the output function
-
get
public void get(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
Mount aSimpleLambdaResourceto the given path and for HTTP method GET.- Parameters:
path- the mounting pathrespondConsumer- the respond consumer
-
put
public void put(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
Mount aSimpleLambdaResourceto the given path and for HTTP method PUT.- Parameters:
path- the mounting pathrespondConsumer- the respond consumer
-
put
public void put(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)
Mount aTextOutputLambdaResourceto the given path and for HTTP method PUT.- Parameters:
path- the mounting pathrespondFunction- the respond functionoutputFunction- the output function
-
delete
public void delete(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
Mount aSimpleLambdaResourceto the given path and for HTTP method DELETE.- Parameters:
path- the mounting pathrespondConsumer- the respond consumer
-
delete
public void delete(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)
Mount aTextOutputLambdaResourceto the given path and for HTTP method DELETE.- Parameters:
path- the mounting pathrespondFunction- the respond functionoutputFunction- the output function
-
options
public void options(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
Mount aSimpleLambdaResourceto the given path and for HTTP method OPTIONS.- Parameters:
path- the mounting pathrespondConsumer- the respond consumer
-
options
public void options(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)
Mount aTextOutputLambdaResourceto the given path and for HTTP method OPTIONS.- Parameters:
path- the mounting pathrespondFunction- the respond functionoutputFunction- the output function
-
patch
public void patch(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
Mount aSimpleLambdaResourceto the given path and for HTTP method PATCH.- Parameters:
path- the mounting pathrespondConsumer- the respond consumer
-
patch
public void patch(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)
Mount aTextOutputLambdaResourceto the given path and for HTTP method PATCH.- Parameters:
path- the mounting pathrespondFunction- the respond functionoutputFunction- the output function
-
head
public void head(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
Mount aSimpleLambdaResourceto the given path and for HTTP method HEAD.- Parameters:
path- the mounting pathrespondConsumer- the respond consumer
-
head
public void head(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)
Mount aTextOutputLambdaResourceto the given path and for HTTP method HEAD.- Parameters:
path- the mounting pathrespondFunction- the respond functionoutputFunction- the output function
-
trace
public void trace(String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
Mount aSimpleLambdaResourceto the given path and for HTTP method TRACE.- Parameters:
path- the mounting pathrespondConsumer- the respond consumer
-
trace
public void trace(String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)
Mount aTextOutputLambdaResourceto the given path and for HTTP method TRACE.- Parameters:
path- the mounting pathrespondFunction- the respond functionoutputFunction- the output function
-
mountRestResource
public ResourceMapper mountRestResource(org.wicketstuff.restutils.http.HttpMethod httpMethod, String path, Function<org.wicketstuff.restutils.wicket.AttributesWrapper,Object> respondFunction, Function<Object,String> outputFunction)
Mount aTextOutputLambdaResourceto the given path and for the given http method- Parameters:
httpMethod- the http methodpath- the mounting pathrespondFunction- the respond functionoutputFunction- the output function- Returns:
- the resource mapper
-
mountRestResource
public ResourceMapper mountRestResource(org.wicketstuff.restutils.http.HttpMethod httpMethod, String path, Consumer<org.wicketstuff.restutils.wicket.AttributesWrapper> respondConsumer)
Mount aSimpleLambdaResourceto the given path and for the given http method- Parameters:
httpMethod- the http methodpath- the mounting pathrespondConsumer- the respond consumer- Returns:
- the resource mapper
-
mountRestResource
protected ResourceMapper mountRestResource(org.wicketstuff.restutils.http.HttpMethod httpMethod, String path, IResource resource)
Mount rest resource.- Parameters:
httpMethod- the http methodpath- the mounting pathresource- the resource- Returns:
- the resource mapper
-
-