org.codegist.crest.annotate
Annotation Type Injector


@Retention(value=RUNTIME)
@Target(value={TYPE,METHOD,PARAMETER})
public @interface Injector

Optional method argument level annotation, sets the injector to use. If not specified, defaults to the parameter config default value.

Can be set at method level to default all method argument values if not specified at argument level.

Can be set at interface level to default all method argument values if not specified at method level.

Additionally, this annotation (with other parameter-specific annotation) can be used for any user class used as a method argument of a rest-binded interface, eg :

 @EndPoint("http://my-server")
 interface FooInterface {
    MyModel getModel(long id, MyBean arg);
 }
 @Injector(MyBeanInjector)
 class MyBean {}
 

For any call to FooInterface.getModel(long,MyBean), MyBean will get injected using MyBeanInjector class

Author:
Laurent Gilles (laurent.gilles@codegist.org)
See Also:
ParamConfig.DEFAULT_INJECTOR, ParamConfig.getInjector()

Required Element Summary
 Class<? extends Injector> value
           
 

Element Detail

value

public abstract Class<? extends Injector> value


Copyright © 2011. All Rights Reserved.