Class RestApiModule
- java.lang.Object
-
- com.google.inject.AbstractModule
-
- com.google.gerrit.extensions.config.FactoryModule
-
- com.google.gerrit.extensions.restapi.RestApiModule
-
- All Implemented Interfaces:
com.google.inject.Module
- Direct Known Subclasses:
Module
,Module
,Module
,Module
,Module
,Module
,PluginRestApiModule
,RestCacheAdminModule
public abstract class RestApiModule extends FactoryModule
Guice DSL for bindingRestView
implementations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RestApiModule.ChildCollectionBinder<P extends RestResource>
static class
RestApiModule.CreateViewBinder<C extends RestResource>
static class
RestApiModule.DeleteViewBinder<C extends RestResource>
static class
RestApiModule.ModifyViewBinder<P extends RestResource>
static class
RestApiModule.ReadViewBinder<P extends RestResource>
static class
RestApiModule.RestCollectionViewBinder<C extends RestResource>
-
Field Summary
Fields Modifier and Type Field Description protected static String
CREATE
protected static String
DELETE
protected static String
DELETE_MISSING
protected static String
DELETE_ON_COLLECTION
protected static String
GET
protected static String
POST
protected static String
POST_ON_COLLECTION
protected static String
PUT
-
Constructor Summary
Constructors Constructor Description RestApiModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <P extends RestResource>
RestApiModule.ChildCollectionBinder<P>child(com.google.inject.TypeLiteral<RestView<P>> type, String name)
protected <R extends RestResource>
RestApiModule.CreateViewBinder<R>create(com.google.inject.TypeLiteral<RestView<R>> viewType)
protected <R extends RestResource>
RestApiModule.ModifyViewBinder<R>delete(com.google.inject.TypeLiteral<RestView<R>> viewType)
protected <R extends RestResource>
RestApiModule.ModifyViewBinder<R>delete(com.google.inject.TypeLiteral<RestView<R>> viewType, String name)
protected <R extends RestResource>
RestApiModule.DeleteViewBinder<R>deleteMissing(com.google.inject.TypeLiteral<RestView<R>> viewType)
protected <R extends RestResource>
RestApiModule.RestCollectionViewBinder<R>deleteOnCollection(com.google.inject.TypeLiteral<RestView<R>> viewType)
Creates a binder that allows to bind a REST view to handleDELETE
on the REST collection of the provided view type.protected <R extends RestResource>
RestApiModule.ReadViewBinder<R>get(com.google.inject.TypeLiteral<RestView<R>> viewType)
protected <R extends RestResource>
RestApiModule.ReadViewBinder<R>get(com.google.inject.TypeLiteral<RestView<R>> viewType, String name)
protected <R extends RestResource>
RestApiModule.ModifyViewBinder<R>post(com.google.inject.TypeLiteral<RestView<R>> viewType)
protected <R extends RestResource>
RestApiModule.ModifyViewBinder<R>post(com.google.inject.TypeLiteral<RestView<R>> viewType, String name)
protected <R extends RestResource>
RestApiModule.RestCollectionViewBinder<R>postOnCollection(com.google.inject.TypeLiteral<RestView<R>> viewType)
protected <R extends RestResource>
RestApiModule.ModifyViewBinder<R>put(com.google.inject.TypeLiteral<RestView<R>> viewType)
protected <R extends RestResource>
RestApiModule.ModifyViewBinder<R>put(com.google.inject.TypeLiteral<RestView<R>> viewType, String name)
-
Methods inherited from class com.google.gerrit.extensions.config.FactoryModule
factory
-
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindListener, bindListener, bindScope, configure, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
-
-
-
Field Detail
-
GET
protected static final String GET
- See Also:
- Constant Field Values
-
PUT
protected static final String PUT
- See Also:
- Constant Field Values
-
DELETE
protected static final String DELETE
- See Also:
- Constant Field Values
-
POST
protected static final String POST
- See Also:
- Constant Field Values
-
CREATE
protected static final String CREATE
- See Also:
- Constant Field Values
-
DELETE_MISSING
protected static final String DELETE_MISSING
- See Also:
- Constant Field Values
-
DELETE_ON_COLLECTION
protected static final String DELETE_ON_COLLECTION
- See Also:
- Constant Field Values
-
POST_ON_COLLECTION
protected static final String POST_ON_COLLECTION
- See Also:
- Constant Field Values
-
-
Method Detail
-
get
protected <R extends RestResource> RestApiModule.ReadViewBinder<R> get(com.google.inject.TypeLiteral<RestView<R>> viewType)
-
put
protected <R extends RestResource> RestApiModule.ModifyViewBinder<R> put(com.google.inject.TypeLiteral<RestView<R>> viewType)
-
post
protected <R extends RestResource> RestApiModule.ModifyViewBinder<R> post(com.google.inject.TypeLiteral<RestView<R>> viewType)
-
delete
protected <R extends RestResource> RestApiModule.ModifyViewBinder<R> delete(com.google.inject.TypeLiteral<RestView<R>> viewType)
-
postOnCollection
protected <R extends RestResource> RestApiModule.RestCollectionViewBinder<R> postOnCollection(com.google.inject.TypeLiteral<RestView<R>> viewType)
-
deleteOnCollection
protected <R extends RestResource> RestApiModule.RestCollectionViewBinder<R> deleteOnCollection(com.google.inject.TypeLiteral<RestView<R>> viewType)
Creates a binder that allows to bind a REST view to handleDELETE
on the REST collection of the provided view type.This binding is ignored if the provided view type belongs to a root collection.
- Parameters:
viewType
- the type of the resources in the REST collection on whichDELETE
should be handled- Returns:
- binder that allows to bind an implementation for the REST view that should handle
DELETE
on the REST collection of the provided view type
-
create
protected <R extends RestResource> RestApiModule.CreateViewBinder<R> create(com.google.inject.TypeLiteral<RestView<R>> viewType)
-
deleteMissing
protected <R extends RestResource> RestApiModule.DeleteViewBinder<R> deleteMissing(com.google.inject.TypeLiteral<RestView<R>> viewType)
-
get
protected <R extends RestResource> RestApiModule.ReadViewBinder<R> get(com.google.inject.TypeLiteral<RestView<R>> viewType, String name)
-
put
protected <R extends RestResource> RestApiModule.ModifyViewBinder<R> put(com.google.inject.TypeLiteral<RestView<R>> viewType, String name)
-
post
protected <R extends RestResource> RestApiModule.ModifyViewBinder<R> post(com.google.inject.TypeLiteral<RestView<R>> viewType, String name)
-
delete
protected <R extends RestResource> RestApiModule.ModifyViewBinder<R> delete(com.google.inject.TypeLiteral<RestView<R>> viewType, String name)
-
child
protected <P extends RestResource> RestApiModule.ChildCollectionBinder<P> child(com.google.inject.TypeLiteral<RestView<P>> type, String name)
-
-