diff options
Diffstat (limited to 'javadoc/javax/inject')
-rw-r--r-- | javadoc/javax/inject/Inject.html | 317 | ||||
-rw-r--r-- | javadoc/javax/inject/Named.html | 210 | ||||
-rw-r--r-- | javadoc/javax/inject/Provider.html | 234 | ||||
-rw-r--r-- | javadoc/javax/inject/Qualifier.html | 194 | ||||
-rw-r--r-- | javadoc/javax/inject/Scope.html | 215 | ||||
-rw-r--r-- | javadoc/javax/inject/Singleton.html | 169 | ||||
-rw-r--r-- | javadoc/javax/inject/package-frame.html | 51 | ||||
-rw-r--r-- | javadoc/javax/inject/package-summary.html | 332 | ||||
-rw-r--r-- | javadoc/javax/inject/package-tree.html | 150 |
9 files changed, 1872 insertions, 0 deletions
diff --git a/javadoc/javax/inject/Inject.html b/javadoc/javax/inject/Inject.html new file mode 100644 index 0000000..061999e --- /dev/null +++ b/javadoc/javax/inject/Inject.html @@ -0,0 +1,317 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.5.0_16) on Mon Oct 12 16:11:19 PDT 2009 --> +<TITLE> +Inject +</TITLE> + +<META NAME="keywords" CONTENT="javax.inject.Inject class"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="Inject"; +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV CLASS + <A HREF="../../javax/inject/Named.html" title="annotation in javax.inject"><B>NEXT CLASS</B></A></FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/Inject.html" target="_top"><B>FRAMES</B></A> + <A HREF="Inject.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: REQUIRED | OPTIONAL</FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: ELEMENT</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<!-- ======== START OF CLASS DATA ======== --> +<H2> +<FONT SIZE="-1"> +javax.inject</FONT> +<BR> +Annotation Type Inject</H2> +<HR> +<DL> +<DT><PRE><FONT SIZE="-1">@Target(value={METHOD,CONSTRUCTOR,FIELD}) +@Retention(value=RUNTIME) +@Documented +</FONT>public @interface <B>Inject</B></DL> +</PRE> + +<P> +Identifies injectable constructors, methods, and fields. May apply to static + as well as instance members. An injectable member may have any access + modifier (private, package-private, protected, public). Constructors are + injected first, followed by fields, and then methods. Fields and methods + in superclasses are injected before those in subclasses. Ordering of + injection among fields and among methods in the same class is not specified. + + <p>Injectable constructors are annotated with <code>@Inject</code> and accept + zero or more dependencies as arguments. <code>@Inject</code> can apply to at most + one constructor per class. + + <p><tt><blockquote style="padding-left: 2em; text-indent: -2em;">@Inject + <i>ConstructorModifiers<sub>opt</sub></i> + <i>SimpleTypeName</i>(<i>FormalParameterList<sub>opt</sub></i>) + <i>Throws<sub>opt</sub></i> + <i>ConstructorBody</i></blockquote></tt> + + <p><code>@Inject</code> is optional for public, no-argument constructors when no + other constructors are present. This enables injectors to invoke default + constructors. + + <p><tt><blockquote style="padding-left: 2em; text-indent: -2em;"> + @Inject<sub><i>opt</i></sub> + <i>Annotations<sub>opt</sub></i> + public + <i>SimpleTypeName</i>() + <i>Throws<sub>opt</sub></i> + <i>ConstructorBody</i></blockquote></tt> + + <p>Injectable fields: + <ul> + <li>are annotated with <code>@Inject</code>. + <li>are not final. + <li>may have any otherwise valid name.</li></ul> + + <p><tt><blockquote style="padding-left: 2em; text-indent: -2em;">@Inject + <i>FieldModifiers<sub>opt</sub></i> + <i>Type</i> + <i>VariableDeclarators</i>;</blockquote></tt> + + <p>Injectable methods: + <ul> + <li>are annotated with <code>@Inject</code>.</li> + <li>are not abstract.</li> + <li>do not declare type parameters of their own.</li> + <li>may return a result</li> + <li>may have any otherwise valid name.</li> + <li>accept zero or more dependencies as arguments.</li></ul> + + <p><tt><blockquote style="padding-left: 2em; text-indent: -2em;">@Inject + <i>MethodModifiers<sub>opt</sub></i> + <i>ResultType</i> + <i>Identifier</i>(<i>FormalParameterList<sub>opt</sub></i>) + <i>Throws<sub>opt</sub></i> + <i>MethodBody</i></blockquote></tt> + + <p>The injector ignores the result of an injected method, but + non-<code>void</code> return types are allowed to support use of the method in + other contexts (builder-style method chaining, for example). + + <p>Examples: + + <pre> + public class Car { + // Injectable constructor + @Inject public Car(Engine engine) { ... } + + // Injectable field + @Inject private Provider<Seat> seatProvider; + + // Injectable package-private method + @Inject void install(Windshield windshield, Trunk trunk) { ... } + }</pre> + + <p>A method annotated with <code>@Inject</code> that overrides another method + annotated with <code>@Inject</code> will only be injected once per injection + request per instance. A method with <i>no</i> <code>@Inject</code> annotation + that overrides a method annotated with <code>@Inject</code> will not be + injected. + + <p>Injection of members annotated with <code>@Inject</code> is required. While an + injectable member may use any accessibility modifier (including + <tt>private</tt>), platform or injector limitations (like security + restrictions or lack of reflection support) might preclude injection + of non-public members. + + <h3>Qualifiers</h3> + + <p>A <A HREF="../../javax/inject/Qualifier.html" title="annotation in javax.inject">qualifier</A> may annotate an injectable field + or parameter and, combined with the type, identify the implementation to + inject. Qualifiers are optional, and when used with <code>@Inject</code> in + injector-independent classes, no more than one qualifier should annotate a + single field or parameter. The qualifiers are bold in the following example: + + <pre> + public class Car { + @Inject private <b>@Leather</b> Provider<Seat> seatProvider; + + @Inject void install(<b>@Tinted</b> Windshield windshield, + <b>@Big</b> Trunk trunk) { ... } + }</pre> + + <p>If one injectable method overrides another, the overriding method's + parameters do not automatically inherit qualifiers from the overridden + method's parameters. + + <h3>Injectable Values</h3> + + <p>For a given type T and optional qualifier, an injector must be able to + inject a user-specified class that: + + <ol type="a"> + <li>is assignment compatible with T and</li> + <li>has an injectable constructor.</li> + </ol> + + <p>For example, the user might use external configuration to pick an + implementation of T. Beyond that, which values are injected depend upon the + injector implementation and its configuration. + + <h3>Circular Dependencies</h3> + + <p>Detecting and resolving circular dependencies is left as an exercise for + the injector implementation. Circular dependencies between two constructors + is an obvious problem, but you can also have a circular dependency between + injectable fields or methods: + + <pre> + class A { + @Inject B b; + } + class B { + @Inject A a; + }</pre> + + <p>When constructing an instance of <code>A</code>, a naive injector + implementation might go into an infinite loop constructing an instance of + <code>B</code> to set on <code>A</code>, a second instance of <code>A</code> to set on + <code>B</code>, a second instance of <code>B</code> to set on the second instance of + <code>A</code>, and so on. + + <p>A conservative injector might detect the circular dependency at build + time and generate an error, at which point the programmer could break the + circular dependency by injecting <A HREF="../../javax/inject/Provider.html" title="interface in javax.inject"><CODE>Provider<A></CODE></A> or <code>Provider<B></code> instead of <code>A</code> or <code>B</code> respectively. Calling <A HREF="../../javax/inject/Provider.html#get()"><CODE>get()</CODE></A> on the provider directly from the constructor or + method it was injected into defeats the provider's ability to break up + circular dependencies. In the case of method or field injection, scoping + one of the dependencies (using <A HREF="../../javax/inject/Singleton.html" title="annotation in javax.inject">singleton scope</A>, for + example) may also enable a valid circular relationship. +<P> + +<P> +<DL> +<DT><B>See Also:</B><DD><A HREF="../../javax/inject/Qualifier.html" title="annotation in javax.inject"><CODE>@Qualifier</CODE></A>, +<A HREF="../../javax/inject/Provider.html" title="interface in javax.inject"><CODE>Provider</CODE></A></DL> + +<P> + +<P> +<!-- ========= END OF CLASS DATA ========= --> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV CLASS + <A HREF="../../javax/inject/Named.html" title="annotation in javax.inject"><B>NEXT CLASS</B></A></FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/Inject.html" target="_top"><B>FRAMES</B></A> + <A HREF="Inject.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: REQUIRED | OPTIONAL</FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: ELEMENT</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> +<font size='-1'>Copyright (C) 2009 <a href='http://code.google.com/p/atinject/'>The JSR-330 Expert Group</a>. Licensed under the <a href='http://www.apache.org/licenses/LICENSE-2.0'>Apache License</a>, Version 2.0.</font> +</BODY> +</HTML> diff --git a/javadoc/javax/inject/Named.html b/javadoc/javax/inject/Named.html new file mode 100644 index 0000000..fdb018e --- /dev/null +++ b/javadoc/javax/inject/Named.html @@ -0,0 +1,210 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.5.0_16) on Mon Oct 12 16:11:19 PDT 2009 --> +<TITLE> +Named +</TITLE> + +<META NAME="keywords" CONTENT="javax.inject.Named class"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="Named"; +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../javax/inject/Inject.html" title="annotation in javax.inject"><B>PREV CLASS</B></A> + <A HREF="../../javax/inject/Provider.html" title="interface in javax.inject"><B>NEXT CLASS</B></A></FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/Named.html" target="_top"><B>FRAMES</B></A> + <A HREF="Named.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: REQUIRED | <A HREF="#annotation_type_optional_element_summary">OPTIONAL</A></FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: <A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<!-- ======== START OF CLASS DATA ======== --> +<H2> +<FONT SIZE="-1"> +javax.inject</FONT> +<BR> +Annotation Type Named</H2> +<HR> +<DL> +<DT><PRE><FONT SIZE="-1"><A HREF="../../javax/inject/Qualifier.html" title="annotation in javax.inject">@Qualifier</A> +@Documented +@Retention(value=RUNTIME) +</FONT>public @interface <B>Named</B></DL> +</PRE> + +<P> +String-based <A HREF="../../javax/inject/Qualifier.html" title="annotation in javax.inject">qualifier</A>. + + <p>Example usage: + + <pre> + public class Car { + @Inject <b>@Named("driver")</b> Seat driverSeat; + @Inject <b>@Named("passenger")</b> Seat passengerSeat; + ... + }</pre> +<P> + +<P> +<HR> + +<P> +<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== --> + +<A NAME="annotation_type_optional_element_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Optional Element Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> java.lang.String</CODE></FONT></TD> +<TD><CODE><B><A HREF="../../javax/inject/Named.html#value()">value</A></B></CODE> + +<BR> + The name.</TD> +</TR> +</TABLE> + +<P> +<A NAME="value()"><!-- --></A><H3> +value</H3> +<PRE> +public abstract java.lang.String <B>value</B></PRE> +<DL> +<DD>The name. +<P> +<DD><DL> +</DL> +</DD> +<DD><DL> +</DL> +<DL> +<DT><B>Default:</B><DD>""</DD> +</DL> +</DL> +<!-- ========= END OF CLASS DATA ========= --> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../javax/inject/Inject.html" title="annotation in javax.inject"><B>PREV CLASS</B></A> + <A HREF="../../javax/inject/Provider.html" title="interface in javax.inject"><B>NEXT CLASS</B></A></FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/Named.html" target="_top"><B>FRAMES</B></A> + <A HREF="Named.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: REQUIRED | <A HREF="#annotation_type_optional_element_summary">OPTIONAL</A></FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: <A HREF="#annotation_type_element_detail">ELEMENT</A></FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> +<font size='-1'>Copyright (C) 2009 <a href='http://code.google.com/p/atinject/'>The JSR-330 Expert Group</a>. Licensed under the <a href='http://www.apache.org/licenses/LICENSE-2.0'>Apache License</a>, Version 2.0.</font> +</BODY> +</HTML> diff --git a/javadoc/javax/inject/Provider.html b/javadoc/javax/inject/Provider.html new file mode 100644 index 0000000..12b3f40 --- /dev/null +++ b/javadoc/javax/inject/Provider.html @@ -0,0 +1,234 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.5.0_16) on Mon Oct 12 16:11:19 PDT 2009 --> +<TITLE> +Provider +</TITLE> + +<META NAME="keywords" CONTENT="javax.inject.Provider interface"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="Provider"; +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../javax/inject/Named.html" title="annotation in javax.inject"><B>PREV CLASS</B></A> + <A HREF="../../javax/inject/Qualifier.html" title="annotation in javax.inject"><B>NEXT CLASS</B></A></FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/Provider.html" target="_top"><B>FRAMES</B></A> + <A HREF="Provider.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<!-- ======== START OF CLASS DATA ======== --> +<H2> +<FONT SIZE="-1"> +javax.inject</FONT> +<BR> +Interface Provider<T></H2> +<HR> +<DL> +<DT><PRE>public interface <B>Provider<T></B></DL> +</PRE> + +<P> +Provides instances of <code>T</code>. Typically implemented by an injector. For + any type <code>T</code> that can be injected, you can also inject + <code>Provider<T></code>. Compared to injecting <code>T</code> directly, injecting + <code>Provider<T></code> enables: + + <ul> + <li>retrieving multiple instances.</li> + <li>lazy or optional retrieval of an instance.</li> + <li>breaking circular dependencies.</li> + <li>abstracting scope so you can look up an instance in a smaller scope + from an instance in a containing scope.</li> + </ul> + + <p>For example: + + <pre> + class Car { + @Inject Car(Provider<Seat> seatProvider) { + Seat driver = seatProvider.get(); + Seat passenger = seatProvider.get(); + ... + } + }</pre> +<P> + +<P> +<HR> + +<P> + +<!-- ========== METHOD SUMMARY =========== --> + +<A NAME="method_summary"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Method Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"> +<CODE> <A HREF="../../javax/inject/Provider.html" title="type parameter in Provider">T</A></CODE></FONT></TD> +<TD><CODE><B><A HREF="../../javax/inject/Provider.html#get()">get</A></B>()</CODE> + +<BR> + Provides a fully-constructed and injected instance of <code>T</code>.</TD> +</TR> +</TABLE> + +<P> + +<!-- ============ METHOD DETAIL ========== --> + +<A NAME="method_detail"><!-- --></A> +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"> +<B>Method Detail</B></FONT></TH> +</TR> +</TABLE> + +<A NAME="get()"><!-- --></A><H3> +get</H3> +<PRE> +<A HREF="../../javax/inject/Provider.html" title="type parameter in Provider">T</A> <B>get</B>()</PRE> +<DL> +<DD>Provides a fully-constructed and injected instance of <code>T</code>. +<P> +<DD><DL> + +<DT><B>Throws:</B> +<DD><CODE>java.lang.RuntimeException</CODE> - if the injector encounters an error while + providing an instance. For example, if an injectable member on + <code>T</code> throws an exception, the injector may wrap the exception + and throw it to the caller of <code>get()</code>. Callers should not try + to handle such exceptions as the behavior may vary across injector + implementations and even different configurations of the same injector.</DL> +</DD> +</DL> +<!-- ========= END OF CLASS DATA ========= --> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../javax/inject/Named.html" title="annotation in javax.inject"><B>PREV CLASS</B></A> + <A HREF="../../javax/inject/Qualifier.html" title="annotation in javax.inject"><B>NEXT CLASS</B></A></FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/Provider.html" target="_top"><B>FRAMES</B></A> + <A HREF="Provider.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> +<font size='-1'>Copyright (C) 2009 <a href='http://code.google.com/p/atinject/'>The JSR-330 Expert Group</a>. Licensed under the <a href='http://www.apache.org/licenses/LICENSE-2.0'>Apache License</a>, Version 2.0.</font> +</BODY> +</HTML> diff --git a/javadoc/javax/inject/Qualifier.html b/javadoc/javax/inject/Qualifier.html new file mode 100644 index 0000000..465959c --- /dev/null +++ b/javadoc/javax/inject/Qualifier.html @@ -0,0 +1,194 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.5.0_16) on Mon Oct 12 16:11:19 PDT 2009 --> +<TITLE> +Qualifier +</TITLE> + +<META NAME="keywords" CONTENT="javax.inject.Qualifier class"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="Qualifier"; +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../javax/inject/Provider.html" title="interface in javax.inject"><B>PREV CLASS</B></A> + <A HREF="../../javax/inject/Scope.html" title="annotation in javax.inject"><B>NEXT CLASS</B></A></FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/Qualifier.html" target="_top"><B>FRAMES</B></A> + <A HREF="Qualifier.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: REQUIRED | OPTIONAL</FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: ELEMENT</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<!-- ======== START OF CLASS DATA ======== --> +<H2> +<FONT SIZE="-1"> +javax.inject</FONT> +<BR> +Annotation Type Qualifier</H2> +<HR> +<DL> +<DT><PRE><FONT SIZE="-1">@Target(value=ANNOTATION_TYPE) +@Retention(value=RUNTIME) +@Documented +</FONT>public @interface <B>Qualifier</B></DL> +</PRE> + +<P> +Identifies qualifier annotations. Anyone can define a new qualifier. A + qualifier annotation: + + <ul> + <li>is annotated with <code>@Qualifier</code>, <code>@Retention(RUNTIME)</code>, + and typically <code>@Documented</code>.</li> + <li>can have attributes.</li> + <li>may be part of the public API, much like the dependency type, but + unlike implementation types which needn't be part of the public + API.</li> + <li>may have restricted usage if annotated with <code>@Target</code>. While + this specification covers applying qualifiers to fields and + parameters only, some injector configurations might use qualifier + annotations in other places (on methods or classes for example).</li> + </ul> + + <p>For example: + + <pre> + @java.lang.annotation.Documented + @java.lang.annotation.Retention(RUNTIME) + @javax.inject.Qualifier + public @interface Leather { + Color color() default Color.TAN; + public enum Color { RED, BLACK, TAN } + }</pre> +<P> + +<P> +<DL> +<DT><B>See Also:</B><DD><A HREF="../../javax/inject/Named.html" title="annotation in javax.inject"><CODE>@Named</CODE></A></DL> + +<P> + +<P> +<!-- ========= END OF CLASS DATA ========= --> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../javax/inject/Provider.html" title="interface in javax.inject"><B>PREV CLASS</B></A> + <A HREF="../../javax/inject/Scope.html" title="annotation in javax.inject"><B>NEXT CLASS</B></A></FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/Qualifier.html" target="_top"><B>FRAMES</B></A> + <A HREF="Qualifier.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: REQUIRED | OPTIONAL</FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: ELEMENT</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> +<font size='-1'>Copyright (C) 2009 <a href='http://code.google.com/p/atinject/'>The JSR-330 Expert Group</a>. Licensed under the <a href='http://www.apache.org/licenses/LICENSE-2.0'>Apache License</a>, Version 2.0.</font> +</BODY> +</HTML> diff --git a/javadoc/javax/inject/Scope.html b/javadoc/javax/inject/Scope.html new file mode 100644 index 0000000..4919bc8 --- /dev/null +++ b/javadoc/javax/inject/Scope.html @@ -0,0 +1,215 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.5.0_16) on Mon Oct 12 16:11:19 PDT 2009 --> +<TITLE> +Scope +</TITLE> + +<META NAME="keywords" CONTENT="javax.inject.Scope class"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="Scope"; +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../javax/inject/Qualifier.html" title="annotation in javax.inject"><B>PREV CLASS</B></A> + <A HREF="../../javax/inject/Singleton.html" title="annotation in javax.inject"><B>NEXT CLASS</B></A></FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/Scope.html" target="_top"><B>FRAMES</B></A> + <A HREF="Scope.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: REQUIRED | OPTIONAL</FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: ELEMENT</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<!-- ======== START OF CLASS DATA ======== --> +<H2> +<FONT SIZE="-1"> +javax.inject</FONT> +<BR> +Annotation Type Scope</H2> +<HR> +<DL> +<DT><PRE><FONT SIZE="-1">@Target(value=ANNOTATION_TYPE) +@Retention(value=RUNTIME) +@Documented +</FONT>public @interface <B>Scope</B></DL> +</PRE> + +<P> +Identifies scope annotations. A scope annotation applies to a class + containing an injectable constructor and governs how the injector reuses + instances of the type. By default, if no scope annotation is present, the + injector creates an instance (by injecting the type's constructor), uses + the instance for one injection, and then forgets it. If a scope annotation + is present, the injector may retain the instance for possible reuse in a + later injection. If multiple threads can access a scoped instance, its + implementation should be thread safe. The implementation of the scope + itself is left up to the injector. + + <p>In the following example, the scope annotation <code>@Singleton</code> ensures + that we only have one Log instance: + + <pre> + @Singleton + class Log { + void log(String message) { ... } + }</pre> + + <p>The injector generates an error if it encounters more than one scope + annotation on the same class or a scope annotation it doesn't support. + + <p>A scope annotation: + <ul> + <li>is annotated with <code>@Scope</code>, <code>@Retention(RUNTIME)</code>, + and typically <code>@Documented</code>.</li> + <li>should not have attributes.</li> + <li>is typically not <code>@Inherited</code>, so scoping is orthogonal to + implementation inheritance.</li> + <li>may have restricted usage if annotated with <code>@Target</code>. While + this specification covers applying scopes to classes only, some + injector configurations might use scope annotations + in other places (on factory method results for example).</li> + </ul> + + <p>For example: + + <pre> + @java.lang.annotation.Documented + @java.lang.annotation.Retention(RUNTIME) + @javax.inject.Scope + public @interface RequestScoped {}</pre> + + <p>Annotating scope annotations with <code>@Scope</code> helps the injector + detect the case where a programmer used the scope annotation on a class but + forgot to configure the scope in the injector. A conservative injector + would generate an error rather than not apply a scope. +<P> + +<P> +<DL> +<DT><B>See Also:</B><DD><A HREF="../../javax/inject/Singleton.html" title="annotation in javax.inject"><CODE>@Singleton</CODE></A></DL> + +<P> + +<P> +<!-- ========= END OF CLASS DATA ========= --> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../javax/inject/Qualifier.html" title="annotation in javax.inject"><B>PREV CLASS</B></A> + <A HREF="../../javax/inject/Singleton.html" title="annotation in javax.inject"><B>NEXT CLASS</B></A></FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/Scope.html" target="_top"><B>FRAMES</B></A> + <A HREF="Scope.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: REQUIRED | OPTIONAL</FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: ELEMENT</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> +<font size='-1'>Copyright (C) 2009 <a href='http://code.google.com/p/atinject/'>The JSR-330 Expert Group</a>. Licensed under the <a href='http://www.apache.org/licenses/LICENSE-2.0'>Apache License</a>, Version 2.0.</font> +</BODY> +</HTML> diff --git a/javadoc/javax/inject/Singleton.html b/javadoc/javax/inject/Singleton.html new file mode 100644 index 0000000..12f9ea6 --- /dev/null +++ b/javadoc/javax/inject/Singleton.html @@ -0,0 +1,169 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.5.0_16) on Mon Oct 12 16:11:19 PDT 2009 --> +<TITLE> +Singleton +</TITLE> + +<META NAME="keywords" CONTENT="javax.inject.Singleton class"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="Singleton"; +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../javax/inject/Scope.html" title="annotation in javax.inject"><B>PREV CLASS</B></A> + NEXT CLASS</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/Singleton.html" target="_top"><B>FRAMES</B></A> + <A HREF="Singleton.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: REQUIRED | OPTIONAL</FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: ELEMENT</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<!-- ======== START OF CLASS DATA ======== --> +<H2> +<FONT SIZE="-1"> +javax.inject</FONT> +<BR> +Annotation Type Singleton</H2> +<HR> +<DL> +<DT><PRE><FONT SIZE="-1"><A HREF="../../javax/inject/Scope.html" title="annotation in javax.inject">@Scope</A> +@Documented +@Retention(value=RUNTIME) +</FONT>public @interface <B>Singleton</B></DL> +</PRE> + +<P> +Identifies a type that the injector only instantiates once. Not inherited. +<P> + +<P> +<DL> +<DT><B>See Also:</B><DD><A HREF="../../javax/inject/Scope.html" title="annotation in javax.inject"><CODE>@Scope</CODE></A></DL> + +<P> + +<P> +<!-- ========= END OF CLASS DATA ========= --> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../javax/inject/Scope.html" title="annotation in javax.inject"><B>PREV CLASS</B></A> + NEXT CLASS</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/Singleton.html" target="_top"><B>FRAMES</B></A> + <A HREF="Singleton.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +<TR> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> + SUMMARY: REQUIRED | OPTIONAL</FONT></TD> +<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> +DETAIL: ELEMENT</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> +<font size='-1'>Copyright (C) 2009 <a href='http://code.google.com/p/atinject/'>The JSR-330 Expert Group</a>. Licensed under the <a href='http://www.apache.org/licenses/LICENSE-2.0'>Apache License</a>, Version 2.0.</font> +</BODY> +</HTML> diff --git a/javadoc/javax/inject/package-frame.html b/javadoc/javax/inject/package-frame.html new file mode 100644 index 0000000..bef990f --- /dev/null +++ b/javadoc/javax/inject/package-frame.html @@ -0,0 +1,51 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.5.0_16) on Mon Oct 12 16:11:19 PDT 2009 --> +<TITLE> +javax.inject +</TITLE> + +<META NAME="keywords" CONTENT="javax.inject package"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> + + +</HEAD> + +<BODY BGCOLOR="white"> +<FONT size="+1" CLASS="FrameTitleFont"> +<A HREF="../../javax/inject/package-summary.html" target="classFrame">javax.inject</A></FONT> +<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> +<TR> +<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> +Interfaces</FONT> +<FONT CLASS="FrameItemFont"> +<BR> +<A HREF="Provider.html" title="interface in javax.inject" target="classFrame"><I>Provider</I></A></FONT></TD> +</TR> +</TABLE> + + +<TABLE BORDER="0" WIDTH="100%" SUMMARY=""> +<TR> +<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont"> +Annotation Types</FONT> +<FONT CLASS="FrameItemFont"> +<BR> +<A HREF="Inject.html" title="annotation in javax.inject" target="classFrame">Inject</A> +<BR> +<A HREF="Named.html" title="annotation in javax.inject" target="classFrame">Named</A> +<BR> +<A HREF="Qualifier.html" title="annotation in javax.inject" target="classFrame">Qualifier</A> +<BR> +<A HREF="Scope.html" title="annotation in javax.inject" target="classFrame">Scope</A> +<BR> +<A HREF="Singleton.html" title="annotation in javax.inject" target="classFrame">Singleton</A></FONT></TD> +</TR> +</TABLE> + + +</BODY> +</HTML> diff --git a/javadoc/javax/inject/package-summary.html b/javadoc/javax/inject/package-summary.html new file mode 100644 index 0000000..a1dd828 --- /dev/null +++ b/javadoc/javax/inject/package-summary.html @@ -0,0 +1,332 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.5.0_16) on Mon Oct 12 16:11:20 PDT 2009 --> +<TITLE> +javax.inject +</TITLE> + +<META NAME="keywords" CONTENT="javax.inject package"> + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="javax.inject"; +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV PACKAGE + NEXT PACKAGE</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/package-summary.html" target="_top"><B>FRAMES</B></A> + <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<H2> +Package javax.inject +</H2> +This package specifies a means for obtaining objects in such a way as to + maximize reusability, testability and maintainability compared to + traditional approaches such as constructors, factories, and service + locators (e.g., JNDI). This process, known as <i>dependency + injection</i>, is beneficial to most nontrivial applications. +<P> +<B>See:</B> +<BR> + <A HREF="#package_description"><B>Description</B></A> +<P> + +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Interface Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD WIDTH="15%"><B><A HREF="../../javax/inject/Provider.html" title="interface in javax.inject">Provider<T></A></B></TD> +<TD>Provides instances of <code>T</code>.</TD> +</TR> +</TABLE> + + +<P> + +<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""> +<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"> +<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"> +<B>Annotation Types Summary</B></FONT></TH> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD WIDTH="15%"><B><A HREF="../../javax/inject/Inject.html" title="annotation in javax.inject">Inject</A></B></TD> +<TD>Identifies injectable constructors, methods, and fields.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD WIDTH="15%"><B><A HREF="../../javax/inject/Named.html" title="annotation in javax.inject">Named</A></B></TD> +<TD>String-based <A HREF="../../javax/inject/Qualifier.html" title="annotation in javax.inject">qualifier</A>.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD WIDTH="15%"><B><A HREF="../../javax/inject/Qualifier.html" title="annotation in javax.inject">Qualifier</A></B></TD> +<TD>Identifies qualifier annotations.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD WIDTH="15%"><B><A HREF="../../javax/inject/Scope.html" title="annotation in javax.inject">Scope</A></B></TD> +<TD>Identifies scope annotations.</TD> +</TR> +<TR BGCOLOR="white" CLASS="TableRowColor"> +<TD WIDTH="15%"><B><A HREF="../../javax/inject/Singleton.html" title="annotation in javax.inject">Singleton</A></B></TD> +<TD>Identifies a type that the injector only instantiates once.</TD> +</TR> +</TABLE> + + +<P> +<A NAME="package_description"><!-- --></A><H2> +Package javax.inject Description +</H2> + +<P> +This package specifies a means for obtaining objects in such a way as to + maximize reusability, testability and maintainability compared to + traditional approaches such as constructors, factories, and service + locators (e.g., JNDI). This process, known as <i>dependency + injection</i>, is beneficial to most nontrivial applications. + + <p>Many types depend on other types. For example, a <tt>Stopwatch</tt> might + depend on a <tt>TimeSource</tt>. The types on which a type depends are + known as its <i>dependencies</i>. The process of finding an instance of a + dependency to use at run time is known as <i>resolving</i> the dependency. + If no such instance can be found, the dependency is said to be + <i>unsatisfied</i>, and the application is broken. + + <p>In the absence of dependency injection, an object can resolve its + dependencies in a few ways. It can invoke a constructor, hard-wiring an + object directly to its dependency's implementation and life cycle: + + <pre> class Stopwatch { + final TimeSource timeSource; + Stopwatch () { + timeSource = <b>new AtomicClock(...)</b>; + } + void start() { ... } + long stop() { ... } + }</pre> + + <p>If more flexibility is needed, the object can call out to a factory or + service locator: + + <pre> class Stopwatch { + final TimeSource timeSource; + Stopwatch () { + timeSource = <b>DefaultTimeSource.getInstance()</b>; + } + void start() { ... } + long stop() { ... } + }</pre> + + <p>In deciding between these traditional approaches to dependency + resolution, a programmer must make trade-offs. Constructors are more + concise but restrictive. Factories decouple the client and implementation + to some extent but require boilerplate code. Service locators decouple even + further but reduce compile time type safety. All three approaches inhibit + unit testing. For example, if the programmer uses a factory, each test + against code that depends on the factory will have to mock out the factory + and remember to clean up after itself or else risk side effects: + + <pre> void testStopwatch() { + <b>TimeSource original = DefaultTimeSource.getInstance(); + DefaultTimeSource.setInstance(new MockTimeSource()); + try {</b> + // Now, we can actually test Stopwatch. + Stopwatch sw = new Stopwatch(); + ... + <b>} finally { + DefaultTimeSource.setInstance(original); + }</b> + }</pre> + + <p>In practice, supporting this ability to mock out a factory results in + even more boilerplate code. Tests that mock out and clean up after multiple + dependencies quickly get out of hand. To make matters worse, a programmer + must predict accurately how much flexibility will be needed in the future + or else suffer the consequences. If a programmer initially elects to use a + constructor but later decides that more flexibility is required, the + programmer must replace every call to the constructor. If the programmer + errs on the side of caution and write factories up front, it may result in + a lot of unnecessary boilerplate code, adding noise, complexity, and + error-proneness. + + <p><i>Dependency injection</i> addresses all of these issues. Instead of + the programmer calling a constructor or factory, a tool called a + <i>dependency injector</i> passes dependencies to objects: + + <pre> class Stopwatch { + final TimeSource timeSource; + <b>@Inject Stopwatch(TimeSource TimeSource)</b> { + this.TimeSource = TimeSource; + } + void start() { ... } + long stop() { ... } + }</pre> + + <p>The injector further passes dependencies to other dependencies until it + constructs the entire object graph. For example, suppose the programmer + asked an injector to create a <tt>StopwatchWidget</tt> instance: + + <pre> /** GUI for a Stopwatch */ + class StopwatchWidget { + @Inject StopwatchWidget(Stopwatch sw) { ... } + ... + }</pre> + + <p>The injector might: + <ol> + <li>Find a <tt>TimeSource</tt> + <li>Construct a <tt>Stopwatch</tt> with the <tt>TimeSource</tt> + <li>Construct a <tt>StopwatchWidget</tt> with the <tt>Stopwatch</tt> + </ol> + + <p>This leaves the programmer's code clean, flexible, and relatively free + of dependency-related infrastructure. + + <p>In unit tests, the programmer can now construct objects directly + (without an injector) and pass in mock dependencies. The programmer no + longer needs to set up and tear down factories or service locators in each + test. This greatly simplifies our unit test: + + <pre> void testStopwatch() { + Stopwatch sw = new Stopwatch(new MockTimeSource()); + ... + }</pre> + + <p>The total decrease in unit-test complexity is proportional to the + product of the number of unit tests and the number of dependencies. + + <p><b>This package provides dependency injection annotations that enable + portable classes</b>, but it leaves external dependency configuration up to + the injector implementation. Programmers annotate constructors, methods, + and fields to advertise their injectability (constructor injection is + demonstrated in the examples above). A dependency injector identifies a + class's dependencies by inspecting these annotations, and injects the + dependencies at run time. Moreover, the injector can verify that all + dependencies have been satisfied at <i>build time</i>. A service locator, + by contrast, cannot detect unsatisfied dependencies until run time. + + <p>Injector implementations can take many forms. An injector could + configure itself using XML, annotations, a DSL (domain-specific language), + or even plain Java code. An injector could rely on reflection or code + generation. An injector that uses compile-time code generation may not even + have its own run time representation. Other injectors may not be able to + generate code at all, neither at compile nor run time. A "container", for + some definition, can be an injector, but this package specification aims to + minimize restrictions on injector implementations. +<P> + +<P> +<DL> +<DT><B>See Also:</B><DD><A HREF="../../javax/inject/Inject.html" title="annotation in javax.inject"><CODE>@Inject</CODE></A></DL> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV PACKAGE + NEXT PACKAGE</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/package-summary.html" target="_top"><B>FRAMES</B></A> + <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> +<font size='-1'>Copyright (C) 2009 <a href='http://code.google.com/p/atinject/'>The JSR-330 Expert Group</a>. Licensed under the <a href='http://www.apache.org/licenses/LICENSE-2.0'>Apache License</a>, Version 2.0.</font> +</BODY> +</HTML> diff --git a/javadoc/javax/inject/package-tree.html b/javadoc/javax/inject/package-tree.html new file mode 100644 index 0000000..4c0e056 --- /dev/null +++ b/javadoc/javax/inject/package-tree.html @@ -0,0 +1,150 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<!--NewPage--> +<HTML> +<HEAD> +<!-- Generated by javadoc (build 1.5.0_16) on Mon Oct 12 16:11:20 PDT 2009 --> +<TITLE> +javax.inject Class Hierarchy +</TITLE> + + +<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"> + +<SCRIPT type="text/javascript"> +function windowTitle() +{ + parent.document.title="javax.inject Class Hierarchy"; +} +</SCRIPT> +<NOSCRIPT> +</NOSCRIPT> + +</HEAD> + +<BODY BGCOLOR="white" onload="windowTitle();"> + + +<!-- ========= START OF TOP NAVBAR ======= --> +<A NAME="navbar_top"><!-- --></A> +<A HREF="#skip-navbar_top" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_top_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/package-tree.html" target="_top"><B>FRAMES</B></A> + <A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_top"></A> +<!-- ========= END OF TOP NAVBAR ========= --> + +<HR> +<CENTER> +<H2> +Hierarchy For Package javax.inject +</H2> +</CENTER> +<H2> +Interface Hierarchy +</H2> +<UL> +<LI TYPE="circle">javax.inject.<A HREF="../../javax/inject/Provider.html" title="interface in javax.inject"><B>Provider</B></A><T></UL> +<H2> +Annotation Type Hierarchy +</H2> +<UL> +<LI TYPE="circle">javax.inject.<A HREF="../../javax/inject/Singleton.html" title="annotation in javax.inject"><B>Singleton</B></A> (implements java.lang.annotation.Annotation) +<LI TYPE="circle">javax.inject.<A HREF="../../javax/inject/Scope.html" title="annotation in javax.inject"><B>Scope</B></A> (implements java.lang.annotation.Annotation) +<LI TYPE="circle">javax.inject.<A HREF="../../javax/inject/Qualifier.html" title="annotation in javax.inject"><B>Qualifier</B></A> (implements java.lang.annotation.Annotation) +<LI TYPE="circle">javax.inject.<A HREF="../../javax/inject/Named.html" title="annotation in javax.inject"><B>Named</B></A> (implements java.lang.annotation.Annotation) +<LI TYPE="circle">javax.inject.<A HREF="../../javax/inject/Inject.html" title="annotation in javax.inject"><B>Inject</B></A> (implements java.lang.annotation.Annotation) +</UL> +<HR> + + +<!-- ======= START OF BOTTOM NAVBAR ====== --> +<A NAME="navbar_bottom"><!-- --></A> +<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A> +<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> +<TR> +<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> +<A NAME="navbar_bottom_firstrow"><!-- --></A> +<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> + <TR ALIGN="center" VALIGN="top"> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../javax/inject/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD> + <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> + <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> + </TR> +</TABLE> +</TD> +<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> +</EM> +</TD> +</TR> + +<TR> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + PREV + NEXT</FONT></TD> +<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> + <A HREF="../../index.html?javax/inject/package-tree.html" target="_top"><B>FRAMES</B></A> + <A HREF="package-tree.html" target="_top"><B>NO FRAMES</B></A> + <SCRIPT type="text/javascript"> + <!-- + if(window==top) { + document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>'); + } + //--> +</SCRIPT> +<NOSCRIPT> + <A HREF="../../allclasses-noframe.html"><B>All Classes</B></A> +</NOSCRIPT> + + +</FONT></TD> +</TR> +</TABLE> +<A NAME="skip-navbar_bottom"></A> +<!-- ======== END OF BOTTOM NAVBAR ======= --> + +<HR> +<font size='-1'>Copyright (C) 2009 <a href='http://code.google.com/p/atinject/'>The JSR-330 Expert Group</a>. Licensed under the <a href='http://www.apache.org/licenses/LICENSE-2.0'>Apache License</a>, Version 2.0.</font> +</BODY> +</HTML> |