Source Code Cross Referenced for Binder.java in  » Inversion-of-Control » guice-1.0 » com » google » inject » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Inversion of Control » guice 1.0 » com.google.inject 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (C) 2007 Google Inc.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         * http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:
017:        package com.google.inject;
018:
019:        import com.google.inject.binder.AnnotatedBindingBuilder;
020:        import com.google.inject.binder.ConstantBindingBuilder;
021:        import com.google.inject.binder.LinkedBindingBuilder;
022:        import com.google.inject.binder.AnnotatedConstantBindingBuilder;
023:        import com.google.inject.matcher.Matcher;
024:        import java.lang.annotation.Annotation;
025:        import java.lang.reflect.Method;
026:        import org.aopalliance.intercept.MethodInterceptor;
027:
028:        /**
029:         * Collects configuration information (primarily <i>bindings</i>) which will be
030:         * used to create an {@link Injector}. Guice provides this object to your
031:         * application's {@link Module}s so they may each contribute
032:         * their own bindings.
033:         *
034:         * <p>The bindings contributed by {@code Module}s define how the {@code
035:         * Injector} resolves dependencies. A {@link Key} consisting of a type
036:         * and optional annotation uniquely identifies a binding within an {@code
037:         * Injector}.
038:         *
039:         * <p>You may bind from a key to:
040:         *
041:         * <ul>
042:         * <li>Another binding, which this binding's key is now "aliased to"
043:         * <li>Another binding, which references a {@link Provider} for this key
044:         * <li>A preconstructed instance
045:         * <li>A preconstructed instance which should be used as the {@link Provider}
046:         *   for this binding
047:         * </ul>
048:         *
049:         * <p>In addition, a binding may have an associated scope, such as
050:         * {@link Scopes#SINGLETON}, and singleton bindings may specify eager or lazy
051:         * initialization.
052:         *
053:         * <p>See the users' guide appendix, "How the Injector resolves injection
054:         * requests," to better understand binding resolution.
055:         *
056:         * <p>After an {@code Injector} has been created, its bindings may be
057:         * examined using methods like {@link Injector#getBinding(Key)}, but this
058:         * read-only {@link Binding} type is not used when <i>creating</i> the
059:         * bindings.
060:         */
061:        public interface Binder {
062:
063:            /**
064:             * Binds a method interceptor to methods matched by class and method
065:             * matchers.
066:             *
067:             * @param classMatcher matches classes the interceptor should apply to. For
068:             *     example: {@code only(Runnable.class)}.
069:             * @param methodMatcher matches methods the interceptor should apply to. For
070:             *     example: {@code annotatedWith(Transactional.class)}.
071:             * @param interceptors to bind
072:             */
073:            void bindInterceptor(Matcher<? super  Class<?>> classMatcher,
074:                    Matcher<? super  Method> methodMatcher,
075:                    MethodInterceptor... interceptors);
076:
077:            /**
078:             * Binds a scope to an annotation.
079:             */
080:            void bindScope(Class<? extends Annotation> annotationType,
081:                    Scope scope);
082:
083:            /**
084:             * Creates a binding to a key.
085:             */
086:            <T> LinkedBindingBuilder<T> bind(Key<T> key);
087:
088:            /**
089:             * Creates a binding to a type.
090:             */
091:            <T> AnnotatedBindingBuilder<T> bind(TypeLiteral<T> typeLiteral);
092:
093:            /**
094:             * Creates a binding to a type.
095:             */
096:            <T> AnnotatedBindingBuilder<T> bind(Class<T> type);
097:
098:            /**
099:             * Binds a constant value to an annotation.
100:             */
101:            AnnotatedConstantBindingBuilder bindConstant();
102:
103:            /**
104:             * Upon successful creation, the {@link Injector} will inject static fields
105:             * and methods in the given classes.
106:             *
107:             * @param types for which static members will be injected
108:             */
109:            void requestStaticInjection(Class<?>... types);
110:
111:            /**
112:             * Uses the given module to configure more bindings.
113:             */
114:            void install(Module module);
115:
116:            /**
117:             * Gets the current stage.
118:             */
119:            Stage currentStage();
120:
121:            /**
122:             * Records an error message which will be presented to the user at a later
123:             * time. Unlike throwing an exception, this enable us to continue
124:             * configuring the Injector and discover more errors. Uses {@link
125:             * String#format(String, Object[])} to insert the arguments into the
126:             * message.
127:             */
128:            void addError(String message, Object... arguments);
129:
130:            /**
131:             * Records an exception, the full details of which will be logged, and the
132:             * message of which will be presented to the user at a later
133:             * time. If your Module calls something that you worry may fail, you should
134:             * catch the exception and pass it into this.
135:             */
136:            void addError(Throwable t);
137:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.