forked from google/guice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4.0.xml
11673 lines (11044 loc) · 510 KB
/
4.0.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!-- Generated by the JDiff Javadoc doclet -->
<!-- (http://www.jdiff.org) -->
<!-- on Tue Apr 28 17:33:25 EDT 2015 -->
<api
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:noNamespaceSchemaLocation='api.xsd'
name="4.0"
jdversion="1.1.1">
<!-- Command line arguments = -doclet jdiff.JDiff -docletpath /usr/local/google/home/cgdecker/Projects/guice/lib/build/jdiff/jdiff.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/jdiff/xerces.jar -classpath /usr/local/google/home/cgdecker/Projects/guice/lib/aopalliance.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/guava-16.0.1.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/javax.inject.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/asm-5.0.3.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/bnd-0.0.384.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/cglib-3.1.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/commons-logging-1.0.4.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/easymock.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/felix-2.0.5.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/guava-testlib-16.0.1.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/jarjar-1.1.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/javax.inject-tck.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/jsr305.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/junit.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/munge.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/safesax.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/spring-beans.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/spring-core.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/dagger-adapter/lib/dagger-2.0.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/antlr-2.7.5h3.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/aopalliance.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/cglib-nodep-3.0.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/commons-collections.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/commons-io.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/commons-logging-1.0.4.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/db4o-6.4.14.8131-java5.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/dom4j-1.6.1.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/easymock.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/ejb3-persistence.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/hibernate-annotations.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/hibernate-entitymanager.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/hibernate-search.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/hibernate3.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/hsqldb.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/javassist.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/jaxen-1.1-beta-7.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/jboss-archive-browsing.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/jta.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/log4j-1.2.14.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/ognl-2.6.7.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/oro-2.0.8.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/servlet-api-2.5.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/persist/lib/xwork-2.0.4.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/ant-1.6.5.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/commons-fileupload-1.2.1.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/commons-io-1.3.2.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/commons-logging-1.0.4.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/core-3.1.1.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/freemarker-2.3.16.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/javassist.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/jetty-6.1.0.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/jetty-util-6.1.0.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/jsp-2.1.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/jsp-api-2.1.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/ognl-3.0.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/servlet-api-2.5.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/struts2-core-2.2.1.jar:/usr/local/google/home/cgdecker/Projects/guice/extensions/struts2/lib/xwork-core-2.2.1.jar:/usr/local/google/home/cgdecker/Projects/guice/build/classes -doclet jdiff.JDiff -docletpath /usr/local/google/home/cgdecker/Projects/guice/lib/build/jdiff/jdiff.jar:/usr/local/google/home/cgdecker/Projects/guice/lib/build/jdiff/xerces.jar -apidir build/docs/latest-api-diffs -apiname 4.0 -->
<package name="com.google.inject">
<!-- start class com.google.inject.AbstractModule -->
<class name="AbstractModule" extends="java.lang.Object"
abstract="true"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<implements name="com.google.inject.Module"/>
<constructor name="AbstractModule"
static="false" final="false" visibility="public"
deprecated="not deprecated">
</constructor>
<method name="configure"
abstract="false" native="false" synchronized="true"
static="false" final="true" visibility="public"
deprecated="not deprecated">
<param name="builder" type="com.google.inject.Binder"/>
</method>
<method name="configure"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<doc>
<![CDATA[Configures a {@link Binder} via the exposed methods.]]>
</doc>
</method>
<method name="binder" return="com.google.inject.Binder"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<doc>
<![CDATA[Gets direct access to the underlying {@code Binder}.]]>
</doc>
</method>
<method name="bindScope"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="scopeAnnotation" type="java.lang.Class<? extends java.lang.annotation.Annotation>"/>
<param name="scope" type="com.google.inject.Scope"/>
<doc>
<![CDATA[@see Binder#bindScope(Class, Scope)]]>
</doc>
</method>
<method name="bind" return="com.google.inject.binder.LinkedBindingBuilder<T>"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="key" type="com.google.inject.Key<T>"/>
<doc>
<![CDATA[@see Binder#bind(Key)]]>
</doc>
</method>
<method name="bind" return="com.google.inject.binder.AnnotatedBindingBuilder<T>"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="typeLiteral" type="com.google.inject.TypeLiteral<T>"/>
<doc>
<![CDATA[@see Binder#bind(TypeLiteral)]]>
</doc>
</method>
<method name="bind" return="com.google.inject.binder.AnnotatedBindingBuilder<T>"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="clazz" type="java.lang.Class<T>"/>
<doc>
<![CDATA[@see Binder#bind(Class)]]>
</doc>
</method>
<method name="bindConstant" return="com.google.inject.binder.AnnotatedConstantBindingBuilder"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<doc>
<![CDATA[@see Binder#bindConstant()]]>
</doc>
</method>
<method name="install"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="module" type="com.google.inject.Module"/>
<doc>
<![CDATA[@see Binder#install(Module)]]>
</doc>
</method>
<method name="addError"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="message" type="java.lang.String"/>
<param name="arguments" type="java.lang.Object[]"/>
<doc>
<![CDATA[@see Binder#addError(String, Object[])]]>
</doc>
</method>
<method name="addError"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="t" type="java.lang.Throwable"/>
<doc>
<![CDATA[@see Binder#addError(Throwable)]]>
</doc>
</method>
<method name="addError"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="message" type="com.google.inject.spi.Message"/>
<doc>
<![CDATA[@see Binder#addError(Message)
@since 2.0]]>
</doc>
</method>
<method name="requestInjection"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="instance" type="java.lang.Object"/>
<doc>
<![CDATA[@see Binder#requestInjection(Object)
@since 2.0]]>
</doc>
</method>
<method name="requestStaticInjection"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="types" type="java.lang.Class[]"/>
<doc>
<![CDATA[@see Binder#requestStaticInjection(Class[])]]>
</doc>
</method>
<method name="bindInterceptor"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="classMatcher" type="com.google.inject.matcher.Matcher<? super java.lang.Class<?>>"/>
<param name="methodMatcher" type="com.google.inject.matcher.Matcher<? super java.lang.reflect.Method>"/>
<param name="interceptors" type="org.aopalliance.intercept.MethodInterceptor[]"/>
<doc>
<![CDATA[@see Binder#bindInterceptor(com.google.inject.matcher.Matcher,
com.google.inject.matcher.Matcher,
org.aopalliance.intercept.MethodInterceptor[])]]>
</doc>
</method>
<method name="requireBinding"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="key" type="com.google.inject.Key<?>"/>
<doc>
<![CDATA[Adds a dependency from this module to {@code key}. When the injector is
created, Guice will report an error if {@code key} cannot be injected.
Note that this requirement may be satisfied by implicit binding, such as
a public no-arguments constructor.
@since 2.0]]>
</doc>
</method>
<method name="requireBinding"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="type" type="java.lang.Class<?>"/>
<doc>
<![CDATA[Adds a dependency from this module to {@code type}. When the injector is
created, Guice will report an error if {@code type} cannot be injected.
Note that this requirement may be satisfied by implicit binding, such as
a public no-arguments constructor.
@since 2.0]]>
</doc>
</method>
<method name="getProvider" return="com.google.inject.Provider<T>"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="key" type="com.google.inject.Key<T>"/>
<doc>
<![CDATA[@see Binder#getProvider(Key)
@since 2.0]]>
</doc>
</method>
<method name="getProvider" return="com.google.inject.Provider<T>"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="type" type="java.lang.Class<T>"/>
<doc>
<![CDATA[@see Binder#getProvider(Class)
@since 2.0]]>
</doc>
</method>
<method name="convertToTypes"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="typeMatcher" type="com.google.inject.matcher.Matcher<? super com.google.inject.TypeLiteral<?>>"/>
<param name="converter" type="com.google.inject.spi.TypeConverter"/>
<doc>
<![CDATA[@see Binder#convertToTypes
@since 2.0]]>
</doc>
</method>
<method name="currentStage" return="com.google.inject.Stage"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<doc>
<![CDATA[@see Binder#currentStage()
@since 2.0]]>
</doc>
</method>
<method name="getMembersInjector" return="com.google.inject.MembersInjector<T>"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="type" type="java.lang.Class<T>"/>
<doc>
<![CDATA[@see Binder#getMembersInjector(Class)
@since 2.0]]>
</doc>
</method>
<method name="getMembersInjector" return="com.google.inject.MembersInjector<T>"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="type" type="com.google.inject.TypeLiteral<T>"/>
<doc>
<![CDATA[@see Binder#getMembersInjector(TypeLiteral)
@since 2.0]]>
</doc>
</method>
<method name="bindListener"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="typeMatcher" type="com.google.inject.matcher.Matcher<? super com.google.inject.TypeLiteral<?>>"/>
<param name="listener" type="com.google.inject.spi.TypeListener"/>
<doc>
<![CDATA[@see Binder#bindListener(com.google.inject.matcher.Matcher,
com.google.inject.spi.TypeListener)
@since 2.0]]>
</doc>
</method>
<method name="bindListener"
abstract="false" native="false" synchronized="false"
static="false" final="false" visibility="protected"
deprecated="not deprecated">
<param name="bindingMatcher" type="com.google.inject.matcher.Matcher<? super com.google.inject.Binding<?>>"/>
<param name="listener" type="com.google.inject.spi.ProvisionListener[]"/>
<doc>
<![CDATA[@see Binder#bindListener(Matcher, ProvisionListener...)
@since 4.0]]>
</doc>
</method>
<doc>
<![CDATA[A support class for {@link Module}s which reduces repetition and results in
a more readable configuration. Simply extend this class, implement {@link
#configure()}, and call the inherited methods which mirror those found in
{@link Binder}. For example:
<pre>
public class MyModule extends AbstractModule {
protected void configure() {
bind(Service.class).to(ServiceImpl.class).in(Singleton.class);
bind(CreditCardPaymentService.class);
bind(PaymentService.class).to(CreditCardPaymentService.class);
bindConstant().annotatedWith(Names.named("port")).to(8080);
}
}
</pre>
@author [email protected] (Bob Lee)]]>
</doc>
</class>
<!-- end class com.google.inject.AbstractModule -->
<!-- start interface com.google.inject.Binder -->
<interface name="Binder" abstract="true"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<method name="bindInterceptor"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="classMatcher" type="com.google.inject.matcher.Matcher<? super java.lang.Class<?>>"/>
<param name="methodMatcher" type="com.google.inject.matcher.Matcher<? super java.lang.reflect.Method>"/>
<param name="interceptors" type="org.aopalliance.intercept.MethodInterceptor[]"/>
<doc>
<![CDATA[Binds method interceptor[s] to methods matched by class and method matchers. A method is
eligible for interception if:
<ul>
<li>Guice created the instance the method is on</li>
<li>Neither the enclosing type nor the method is final</li>
<li>And the method is package-private, protected, or public</li>
</ul>
@param classMatcher matches classes the interceptor should apply to. For
example: {@code only(Runnable.class)}.
@param methodMatcher matches methods the interceptor should apply to. For
example: {@code annotatedWith(Transactional.class)}.
@param interceptors to bind. The interceptors are called in the order they
are given.]]>
</doc>
</method>
<method name="bindScope"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="annotationType" type="java.lang.Class<? extends java.lang.annotation.Annotation>"/>
<param name="scope" type="com.google.inject.Scope"/>
<doc>
<![CDATA[Binds a scope to an annotation.]]>
</doc>
</method>
<method name="bind" return="com.google.inject.binder.LinkedBindingBuilder<T>"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="key" type="com.google.inject.Key<T>"/>
<doc>
<![CDATA[See the EDSL examples at {@link Binder}.]]>
</doc>
</method>
<method name="bind" return="com.google.inject.binder.AnnotatedBindingBuilder<T>"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="typeLiteral" type="com.google.inject.TypeLiteral<T>"/>
<doc>
<![CDATA[See the EDSL examples at {@link Binder}.]]>
</doc>
</method>
<method name="bind" return="com.google.inject.binder.AnnotatedBindingBuilder<T>"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="type" type="java.lang.Class<T>"/>
<doc>
<![CDATA[See the EDSL examples at {@link Binder}.]]>
</doc>
</method>
<method name="bindConstant" return="com.google.inject.binder.AnnotatedConstantBindingBuilder"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<doc>
<![CDATA[See the EDSL examples at {@link Binder}.]]>
</doc>
</method>
<method name="requestInjection"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="type" type="com.google.inject.TypeLiteral<T>"/>
<param name="instance" type="T"/>
<doc>
<![CDATA[Upon successful creation, the {@link Injector} will inject instance fields
and methods of the given object.
@param type of instance
@param instance for which members will be injected
@since 2.0]]>
</doc>
</method>
<method name="requestInjection"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="instance" type="java.lang.Object"/>
<doc>
<![CDATA[Upon successful creation, the {@link Injector} will inject instance fields
and methods of the given object.
@param instance for which members will be injected
@since 2.0]]>
</doc>
</method>
<method name="requestStaticInjection"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="types" type="java.lang.Class[]"/>
<doc>
<![CDATA[Upon successful creation, the {@link Injector} will inject static fields
and methods in the given classes.
@param types for which static members will be injected]]>
</doc>
</method>
<method name="install"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="module" type="com.google.inject.Module"/>
<doc>
<![CDATA[Uses the given module to configure more bindings.]]>
</doc>
</method>
<method name="currentStage" return="com.google.inject.Stage"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<doc>
<![CDATA[Gets the current stage.]]>
</doc>
</method>
<method name="addError"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="message" type="java.lang.String"/>
<param name="arguments" type="java.lang.Object[]"/>
<doc>
<![CDATA[Records an error message which will be presented to the user at a later
time. Unlike throwing an exception, this enable us to continue
configuring the Injector and discover more errors. Uses {@link
String#format(String, Object[])} to insert the arguments into the
message.]]>
</doc>
</method>
<method name="addError"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="t" type="java.lang.Throwable"/>
<doc>
<![CDATA[Records an exception, the full details of which will be logged, and the
message of which will be presented to the user at a later
time. If your Module calls something that you worry may fail, you should
catch the exception and pass it into this.]]>
</doc>
</method>
<method name="addError"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="message" type="com.google.inject.spi.Message"/>
<doc>
<![CDATA[Records an error message to be presented to the user at a later time.
@since 2.0]]>
</doc>
</method>
<method name="getProvider" return="com.google.inject.Provider<T>"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="key" type="com.google.inject.Key<T>"/>
<doc>
<![CDATA[Returns the provider used to obtain instances for the given injection key.
The returned provider will not be valid until the {@link Injector} has been
created. The provider will throw an {@code IllegalStateException} if you
try to use it beforehand.
@since 2.0]]>
</doc>
</method>
<method name="getProvider" return="com.google.inject.Provider<T>"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="dependency" type="com.google.inject.spi.Dependency<T>"/>
<doc>
<![CDATA[Returns the provider used to obtain instances for the given injection key.
The returned provider will be attached to the injection point and will
follow the nullability specified in the dependency.
Additionally, the returned provider will not be valid until the {@link Injector}
has been created. The provider will throw an {@code IllegalStateException} if you
try to use it beforehand.
@since 4.0]]>
</doc>
</method>
<method name="getProvider" return="com.google.inject.Provider<T>"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="type" type="java.lang.Class<T>"/>
<doc>
<![CDATA[Returns the provider used to obtain instances for the given injection type.
The returned provider will not be valid until the {@link Injector} has been
created. The provider will throw an {@code IllegalStateException} if you
try to use it beforehand.
@since 2.0]]>
</doc>
</method>
<method name="getMembersInjector" return="com.google.inject.MembersInjector<T>"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="typeLiteral" type="com.google.inject.TypeLiteral<T>"/>
<doc>
<![CDATA[Returns the members injector used to inject dependencies into methods and fields on instances
of the given type {@code T}. The returned members injector will not be valid until the main
{@link Injector} has been created. The members injector will throw an {@code
IllegalStateException} if you try to use it beforehand.
@param typeLiteral type to get members injector for
@since 2.0]]>
</doc>
</method>
<method name="getMembersInjector" return="com.google.inject.MembersInjector<T>"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="type" type="java.lang.Class<T>"/>
<doc>
<![CDATA[Returns the members injector used to inject dependencies into methods and fields on instances
of the given type {@code T}. The returned members injector will not be valid until the main
{@link Injector} has been created. The members injector will throw an {@code
IllegalStateException} if you try to use it beforehand.
@param type type to get members injector for
@since 2.0]]>
</doc>
</method>
<method name="convertToTypes"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="typeMatcher" type="com.google.inject.matcher.Matcher<? super com.google.inject.TypeLiteral<?>>"/>
<param name="converter" type="com.google.inject.spi.TypeConverter"/>
<doc>
<![CDATA[Binds a type converter. The injector will use the given converter to
convert string constants to matching types as needed.
@param typeMatcher matches types the converter can handle
@param converter converts values
@since 2.0]]>
</doc>
</method>
<method name="bindListener"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="typeMatcher" type="com.google.inject.matcher.Matcher<? super com.google.inject.TypeLiteral<?>>"/>
<param name="listener" type="com.google.inject.spi.TypeListener"/>
<doc>
<![CDATA[Registers a listener for injectable types. Guice will notify the listener when it encounters
injectable types matched by the given type matcher.
@param typeMatcher that matches injectable types the listener should be notified of
@param listener for injectable types matched by typeMatcher
@since 2.0]]>
</doc>
</method>
<method name="bindListener"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="bindingMatcher" type="com.google.inject.matcher.Matcher<? super com.google.inject.Binding<?>>"/>
<param name="listeners" type="com.google.inject.spi.ProvisionListener[]"/>
<doc>
<![CDATA[Registers listeners for provisioned objects. Guice will notify the
listeners just before and after the object is provisioned. Provisioned
objects that are also injectable (everything except objects provided
through Providers) can also be notified through TypeListeners registered in
{@link #bindListener}.
@param bindingMatcher that matches bindings of provisioned objects the listener
should be notified of
@param listeners for provisioned objects matched by bindingMatcher
@since 4.0]]>
</doc>
</method>
<method name="withSource" return="com.google.inject.Binder"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="source" type="java.lang.Object"/>
<doc>
<![CDATA[Returns a binder that uses {@code source} as the reference location for
configuration errors. This is typically a {@link StackTraceElement}
for {@code .java} source but it could any binding source, such as the
path to a {@code .properties} file.
@param source any object representing the source location and has a
concise {@link Object#toString() toString()} value
@return a binder that shares its configuration with this binder
@since 2.0]]>
</doc>
</method>
<method name="skipSources" return="com.google.inject.Binder"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="classesToSkip" type="java.lang.Class[]"/>
<doc>
<![CDATA[Returns a binder that skips {@code classesToSkip} when identify the
calling code. The caller's {@link StackTraceElement} is used to locate
the source of configuration errors.
@param classesToSkip library classes that create bindings on behalf of
their clients.
@return a binder that shares its configuration with this binder.
@since 2.0]]>
</doc>
</method>
<method name="newPrivateBinder" return="com.google.inject.PrivateBinder"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<doc>
<![CDATA[Creates a new private child environment for bindings and other configuration. The returned
binder can be used to add and configuration information in this environment. See {@link
PrivateModule} for details.
@return a binder that inherits configuration from this binder. Only exposed configuration on
the returned binder will be visible to this binder.
@since 2.0]]>
</doc>
</method>
<method name="requireExplicitBindings"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<doc>
<![CDATA[Instructs the Injector that bindings must be listed in a Module in order to
be injected. Classes that are not explicitly bound in a module cannot be
injected. Bindings created through a linked binding
(<code>bind(Foo.class).to(FooImpl.class)</code>) are allowed, but the
implicit binding (<code>FooImpl</code>) cannot be directly injected unless
it is also explicitly bound (<code>bind(FooImpl.class)</code>).
<p>
Tools can still retrieve bindings for implicit bindings (bindings created
through a linked binding) if explicit bindings are required, however
{@link Binding#getProvider} will fail.
<p>
By default, explicit bindings are not required.
<p>
If a parent injector requires explicit bindings, then all child injectors
(and private modules within that injector) also require explicit bindings.
If a parent does not require explicit bindings, a child injector or private
module may optionally declare itself as requiring explicit bindings. If it
does, the behavior is limited only to that child or any grandchildren. No
siblings of the child will require explicit bindings.
<p>
In the absence of an explicit binding for the target, linked bindings in
child injectors create a binding for the target in the parent. Since this
behavior can be surprising, it causes an error instead if explicit bindings
are required. To avoid this error, add an explicit binding for the target,
either in the child or the parent.
@since 3.0]]>
</doc>
</method>
<method name="disableCircularProxies"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<doc>
<![CDATA[Prevents Guice from constructing a {@link Proxy} when a circular dependency
is found. By default, circular proxies are not disabled.
<p>
If a parent injector disables circular proxies, then all child injectors
(and private modules within that injector) also disable circular proxies.
If a parent does not disable circular proxies, a child injector or private
module may optionally declare itself as disabling circular proxies. If it
does, the behavior is limited only to that child or any grandchildren. No
siblings of the child will disable circular proxies.
@since 3.0]]>
</doc>
</method>
<method name="requireAtInjectOnConstructors"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<doc>
<![CDATA[Requires that a {@literal @}{@link Inject} annotation exists on a constructor in order for
Guice to consider it an eligible injectable class. By default, Guice will inject classes that
have a no-args constructor if no {@literal @}{@link Inject} annotation exists on any
constructor.
<p>
If the class is bound using {@link LinkedBindingBuilder#toConstructor}, Guice will still inject
that constructor regardless of annotations.
@since 4.0]]>
</doc>
</method>
<method name="requireExactBindingAnnotations"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<doc>
<![CDATA[Requires that Guice finds an exactly matching binding annotation. This disables the
error-prone feature in Guice where it can substitute a binding for
<code>{@literal @}Named Foo</code> when attempting to inject
<code>{@literal @}Named("foo") Foo</code>.
@since 4.0]]>
</doc>
</method>
<method name="scanModulesForAnnotatedMethods"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="scanner" type="com.google.inject.spi.ModuleAnnotatedMethodScanner"/>
<doc>
<![CDATA[Adds a scanner that will look in all installed modules for annotations the scanner can parse,
and binds them like {@literal @}Provides methods. Scanners apply to all modules installed in
the injector. Scanners installed in child injectors or private modules do not impact modules in
siblings or parents, however scanners installed in parents do apply to all child injectors and
private modules.
@since 4.0]]>
</doc>
</method>
<doc>
<![CDATA[Collects configuration information (primarily <i>bindings</i>) which will be
used to create an {@link Injector}. Guice provides this object to your
application's {@link Module} implementors so they may each contribute
their own bindings and other registrations.
<h3>The Guice Binding EDSL</h3>
Guice uses an <i>embedded domain-specific language</i>, or EDSL, to help you
create bindings simply and readably. This approach is great for overall
usability, but it does come with a small cost: <b>it is difficult to
learn how to use the Binding EDSL by reading
method-level javadocs</b>. Instead, you should consult the series of
examples below. To save space, these examples omit the opening
{@code binder}, just as you will if your module extends
{@link AbstractModule}.
<pre>
bind(ServiceImpl.class);</pre>
This statement does essentially nothing; it "binds the {@code ServiceImpl}
class to itself" and does not change Guice's default behavior. You may still
want to use this if you prefer your {@link Module} class to serve as an
explicit <i>manifest</i> for the services it provides. Also, in rare cases,
Guice may be unable to validate a binding at injector creation time unless it
is given explicitly.
<pre>
bind(Service.class).to(ServiceImpl.class);</pre>
Specifies that a request for a {@code Service} instance with no binding
annotations should be treated as if it were a request for a
{@code ServiceImpl} instance. This <i>overrides</i> the function of any
{@link ImplementedBy @ImplementedBy} or {@link ProvidedBy @ProvidedBy}
annotations found on {@code Service}, since Guice will have already
"moved on" to {@code ServiceImpl} before it reaches the point when it starts
looking for these annotations.
<pre>
bind(Service.class).toProvider(ServiceProvider.class);</pre>
In this example, {@code ServiceProvider} must extend or implement
{@code Provider<Service>}. This binding specifies that Guice should resolve
an unannotated injection request for {@code Service} by first resolving an
instance of {@code ServiceProvider} in the regular way, then calling
{@link Provider#get get()} on the resulting Provider instance to obtain the
{@code Service} instance.
<p>The {@link Provider} you use here does not have to be a "factory"; that
is, a provider which always <i>creates</i> each instance it provides.
However, this is generally a good practice to follow. You can then use
Guice's concept of {@link Scope scopes} to guide when creation should happen
-- "letting Guice work for you".
<pre>
bind(Service.class).annotatedWith(Red.class).to(ServiceImpl.class);</pre>
Like the previous example, but only applies to injection requests that use
the binding annotation {@code @Red}. If your module also includes bindings
for particular <i>values</i> of the {@code @Red} annotation (see below),
then this binding will serve as a "catch-all" for any values of {@code @Red}
that have no exact match in the bindings.
<pre>
bind(ServiceImpl.class).in(Singleton.class);
// or, alternatively
bind(ServiceImpl.class).in(Scopes.SINGLETON);</pre>
Either of these statements places the {@code ServiceImpl} class into
singleton scope. Guice will create only one instance of {@code ServiceImpl}
and will reuse it for all injection requests of this type. Note that it is
still possible to bind another instance of {@code ServiceImpl} if the second
binding is qualified by an annotation as in the previous example. Guice is
not overly concerned with <i>preventing</i> you from creating multiple
instances of your "singletons", only with <i>enabling</i> your application to
share only one instance if that's all you tell Guice you need.
<p><b>Note:</b> a scope specified in this way <i>overrides</i> any scope that
was specified with an annotation on the {@code ServiceImpl} class.
<p>Besides {@link Singleton}/{@link Scopes#SINGLETON}, there are
servlet-specific scopes available in
{@code com.google.inject.servlet.ServletScopes}, and your Modules can
contribute their own custom scopes for use here as well.
<pre>
bind(new TypeLiteral<PaymentService<CreditCard>>() {})
.to(CreditCardPaymentService.class);</pre>
This admittedly odd construct is the way to bind a parameterized type. It
tells Guice how to honor an injection request for an element of type
{@code PaymentService<CreditCard>}. The class
{@code CreditCardPaymentService} must implement the
{@code PaymentService<CreditCard>} interface. Guice cannot currently bind or
inject a generic type, such as {@code Set<E>}; all type parameters must be
fully specified.
<pre>
bind(Service.class).toInstance(new ServiceImpl());
// or, alternatively
bind(Service.class).toInstance(SomeLegacyRegistry.getService());</pre>
In this example, your module itself, <i>not Guice</i>, takes responsibility
for obtaining a {@code ServiceImpl} instance, then asks Guice to always use
this single instance to fulfill all {@code Service} injection requests. When
the {@link Injector} is created, it will automatically perform field
and method injection for this instance, but any injectable constructor on
{@code ServiceImpl} is simply ignored. Note that using this approach results
in "eager loading" behavior that you can't control.
<pre>
bindConstant().annotatedWith(ServerHost.class).to(args[0]);</pre>
Sets up a constant binding. Constant injections must always be annotated.
When a constant binding's value is a string, it is eligile for conversion to
all primitive types, to {@link Enum#valueOf(Class, String) all enums}, and to
{@link Class#forName class literals}. Conversions for other types can be
configured using {@link #convertToTypes(Matcher, TypeConverter)
convertToTypes()}.
<pre>
{@literal @}Color("red") Color red; // A member variable (field)
. . .
red = MyModule.class.getDeclaredField("red").getAnnotation(Color.class);
bind(Service.class).annotatedWith(red).to(RedService.class);</pre>
If your binding annotation has parameters you can apply different bindings to
different specific values of your annotation. Getting your hands on the
right instance of the annotation is a bit of a pain -- one approach, shown
above, is to apply a prototype annotation to a field in your module class, so
that you can read this annotation instance and give it to Guice.
<pre>
bind(Service.class)
.annotatedWith(Names.named("blue"))
.to(BlueService.class);</pre>
Differentiating by names is a common enough use case that we provided a
standard annotation, {@link com.google.inject.name.Named @Named}. Because of
Guice's library support, binding by name is quite easier than in the
arbitrary binding annotation case we just saw. However, remember that these
names will live in a single flat namespace with all the other names used in
your application.
<pre>
Constructor<T> loneCtor = getLoneCtorFromServiceImplViaReflection();
bind(ServiceImpl.class)
.toConstructor(loneCtor);</pre>
In this example, we directly tell Guice which constructor to use in a concrete
class implementation. It means that we do not need to place {@literal @}Inject
on any of the constructors and that Guice treats the provided constructor as though
it were annotated so. It is useful for cases where you cannot modify existing
classes and is a bit simpler than using a {@link Provider}.
<p>The above list of examples is far from exhaustive. If you can think of
how the concepts of one example might coexist with the concepts from another,
you can most likely weave the two together. If the two concepts make no
sense with each other, you most likely won't be able to do it. In a few
cases Guice will let something bogus slip by, and will then inform you of
the problems at runtime, as soon as you try to create your Injector.
<p>The other methods of Binder such as {@link #bindScope},
{@link #bindInterceptor}, {@link #install}, {@link #requestStaticInjection},
{@link #addError} and {@link #currentStage} are not part of the Binding EDSL;
you can learn how to use these in the usual way, from the method
documentation.
@author [email protected] (Bob Lee)
@author [email protected] (Jesse Wilson)
@author [email protected] (Kevin Bourrillion)]]>
</doc>
</interface>
<!-- end interface com.google.inject.Binder -->
<!-- start interface com.google.inject.Binding -->
<interface name="Binding" abstract="true"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<implements name="com.google.inject.spi.Element"/>
<method name="getKey" return="com.google.inject.Key<T>"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<doc>
<![CDATA[Returns the key for this binding.]]>
</doc>
</method>
<method name="getProvider" return="com.google.inject.Provider<T>"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<doc>
<![CDATA[Returns the scoped provider guice uses to fulfill requests for this
binding.
@throws UnsupportedOperationException when invoked on a {@link Binding}
created via {@link com.google.inject.spi.Elements#getElements}. This
method is only supported on {@link Binding}s returned from an injector.]]>
</doc>
</method>
<method name="acceptTargetVisitor" return="V"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="visitor" type="com.google.inject.spi.BindingTargetVisitor<? super T, V>"/>
<doc>
<![CDATA[Accepts a target visitor. Invokes the visitor method specific to this binding's target.
@param visitor to call back on
@since 2.0]]>
</doc>
</method>
<method name="acceptScopingVisitor" return="V"
abstract="true" native="false" synchronized="false"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<param name="visitor" type="com.google.inject.spi.BindingScopingVisitor<V>"/>
<doc>
<![CDATA[Accepts a scoping visitor. Invokes the visitor method specific to this binding's scoping.
@param visitor to call back on
@since 2.0]]>
</doc>
</method>
<doc>
<![CDATA[A mapping from a key (type and optional annotation) to the strategy for getting instances of the
type. This interface is part of the introspection API and is intended primarily for use by
tools.
<p>Bindings are created in several ways:
<ul>
<li>Explicitly in a module, via {@code bind()} and {@code bindConstant()}
statements:
<pre>
bind(Service.class).annotatedWith(Red.class).to(ServiceImpl.class);
bindConstant().annotatedWith(ServerHost.class).to(args[0]);</pre></li>
<li>Implicitly by the Injector by following a type's {@link ImplementedBy
pointer} {@link ProvidedBy annotations} or by using its {@link Inject annotated} or
default constructor.</li>
<li>By converting a bound instance to a different type.</li>
<li>For {@link Provider providers}, by delegating to the binding for the provided type.</li>
</ul>
<p>They exist on both modules and on injectors, and their behaviour is different for each:
<ul>
<li><strong>Module bindings</strong> are incomplete and cannot be used to provide instances.
This is because the applicable scopes and interceptors may not be known until an injector
is created. From a tool's perspective, module bindings are like the injector's source
code. They can be inspected or rewritten, but this analysis must be done statically.</li>
<li><strong>Injector bindings</strong> are complete and valid and can be used to provide
instances. From a tools' perspective, injector bindings are like reflection for an
injector. They have full runtime information, including the complete graph of injections
necessary to satisfy a binding.</li>
</ul>
@param <T> the bound type. The injected is always assignable to this type.
@author [email protected] (Bob Lee)
@author [email protected] (Jesse Wilson)]]>
</doc>
</interface>
<!-- end interface com.google.inject.Binding -->
<!-- start class com.google.inject.BindingAnnotation -->
<class name="BindingAnnotation" abstract="true"
static="false" final="false" visibility="public"
deprecated="not deprecated">
<implements name="java.lang.annotation.Annotation"/>
<doc>
<![CDATA[Annotates annotations which are used for binding. Only one such annotation
may apply to a single injection point. You must also annotate binder
annotations with {@code @Retention(RUNTIME)}. For example:
<pre>