[webbeans-commits] Webbeans SVN: r1142 - in ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test: unit/implementation and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-21 09:40:59 -0500 (Wed, 21 Jan 2009)
New Revision: 1142
Added:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/implementation/EnterpriseBeanProxyTest.java
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/implementation/Mouse.java
Modified:
ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockEjbDescriptor.java
Log:
WBRI-109
Modified: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockEjbDescriptor.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockEjbDescriptor.java 2009-01-21 08:30:25 UTC (rev 1141)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/mock/MockEjbDescriptor.java 2009-01-21 14:40:59 UTC (rev 1142)
@@ -6,6 +6,7 @@
import java.util.HashSet;
import java.util.List;
+import javax.ejb.Local;
import javax.ejb.MessageDriven;
import javax.ejb.Remove;
import javax.ejb.Singleton;
@@ -34,21 +35,24 @@
this.localInterfaces = new ArrayList<BusinessInterfaceDescriptor<?>>();
for (final Class<?> clazz : type.getInterfaces())
{
- localInterfaces.add(new BusinessInterfaceDescriptor<Object>()
+ if (clazz.isAnnotationPresent(Local.class))
{
-
- @SuppressWarnings("unchecked")
- public Class<Object> getInterface()
+ localInterfaces.add(new BusinessInterfaceDescriptor<Object>()
{
- return (Class<Object>) clazz;
- }
-
- public String getJndiName()
- {
- return clazz.getSimpleName() + "/local";
- }
-
- });
+
+ @SuppressWarnings("unchecked")
+ public Class<Object> getInterface()
+ {
+ return (Class<Object>) clazz;
+ }
+
+ public String getJndiName()
+ {
+ return clazz.getSimpleName() + "/local";
+ }
+
+ });
+ }
}
// cope with EJB 3.1 style no-interface views
if (localInterfaces.size() == 0)
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/implementation/EnterpriseBeanProxyTest.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/implementation/EnterpriseBeanProxyTest.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/implementation/EnterpriseBeanProxyTest.java 2009-01-21 14:40:59 UTC (rev 1142)
@@ -0,0 +1,33 @@
+package org.jboss.webbeans.test.unit.implementation;
+
+import javassist.util.proxy.ProxyObject;
+
+import org.jboss.webbeans.tck.AbstractTest;
+import org.testng.annotations.Test;
+
+public class EnterpriseBeanProxyTest extends AbstractTest
+{
+
+ /**
+ * <a href="https://jira.jboss.org/jira/browse/WBRI-109">WBRI-109</a>
+ */
+ @Test
+ public void testNoInterfaceView() throws Exception
+ {
+ deployBeans(Mouse.class);
+ new RunInDependentContext()
+ {
+
+ @Override
+ protected void execute() throws Exception
+ {
+ Object mouse = manager.getInstanceByType(Mouse.class);
+ assert mouse instanceof ProxyObject;
+ assert mouse instanceof Mouse;
+ }
+
+ }.run();
+
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/implementation/EnterpriseBeanProxyTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/implementation/Mouse.java
===================================================================
--- ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/implementation/Mouse.java (rev 0)
+++ ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/implementation/Mouse.java 2009-01-21 14:40:59 UTC (rev 1142)
@@ -0,0 +1,9 @@
+package org.jboss.webbeans.test.unit.implementation;
+
+import javax.ejb.Stateless;
+
+@Stateless
+public class Mouse
+{
+
+}
Property changes on: ri/trunk/webbeans-ri/src/test/java/org/jboss/webbeans/test/unit/implementation/Mouse.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
16 years, 8 months
[webbeans-commits] Webbeans SVN: r1141 - doc/trunk/reference/ko-KR.
by webbeans-commits@lists.jboss.org
Author: eukim
Date: 2009-01-21 03:30:25 -0500 (Wed, 21 Jan 2009)
New Revision: 1141
Modified:
doc/trunk/reference/ko-KR/scopescontexts.po
Log:
updated
Modified: doc/trunk/reference/ko-KR/scopescontexts.po
===================================================================
--- doc/trunk/reference/ko-KR/scopescontexts.po 2009-01-21 08:21:49 UTC (rev 1140)
+++ doc/trunk/reference/ko-KR/scopescontexts.po 2009-01-21 08:30:25 UTC (rev 1141)
@@ -8,7 +8,7 @@
"Project-Id-Version: scopescontexts\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-01-06 11:30+0000\n"
-"PO-Revision-Date: 2009-01-21 17:14+1000\n"
+"PO-Revision-Date: 2009-01-21 18:14+1000\n"
"Last-Translator: Eunju Kim <eukim(a)redhat.com>\n"
"Language-Team: Korean <ko(a)li.org>\n"
"MIME-Version: 1.0\n"
@@ -395,13 +395,13 @@
"This Web Bean is able to control its own lifecycle through use of the "
"<literal>Conversation</literal> API. But some other Web Beans have a "
"lifecycle which depends completely upon another object."
-msgstr ""
+msgstr "Web Bean은 <literal>Conversation</literal> API를 사용하여 수명 주기를 제어할 수 있습니다. 하지만 일부 다른 Web Beans는 다른 객체에 완전히 의존하는 수명 주기를 갖습니다. "
#. Tag: title
#: scopescontexts.xml:173
#, no-c-format
msgid "Conversation propagation"
-msgstr ""
+msgstr "컨버세이션 보급 "
#. Tag: para
#: scopescontexts.xml:175
@@ -410,11 +410,12 @@
"The conversation context automatically propagates with any JSF faces request "
"(JSF form submission). It does not automatically propagate with non-faces "
"requests, for example, navigation via a link."
-msgstr ""
+msgstr "컨버세이션 컨텍스트는 JSF faces 요청 (JSF 양식 제출)과 함께 자동으로 보급됩니다. 예를 들어, 링크를 통한 네비게이션과 같이 이는 non-faces 요청과 함께 자동으로 보급되지 않습니다. "
#. Tag: para
#: scopescontexts.xml:179
#, no-c-format
+#, fuzzy
msgid ""
"We can force the conversation to propagate with a non-faces request by "
"including the unique identifier of the conversation as a request parameter. "
@@ -422,7 +423,7 @@
"<literal>cid</literal> for this use. The unique identifier of the "
"conversation may be obtained from the <literal>Conversation</literal> "
"object, which has the Web Beans name <literal>conversation</literal>."
-msgstr ""
+msgstr "요청 매개 변수로서 컨버세이션의 고유 식별자를 포함하여 컨버세이션이 non-faces 요청과 함께 보급되도록 강제할 수 있습니다. Web Beans 사양은 "
#. Tag: para
#: scopescontexts.xml:186
16 years, 8 months
[webbeans-commits] Webbeans SVN: r1140 - doc/trunk/reference/it-IT.
by webbeans-commits@lists.jboss.org
Author: nico.ben
Date: 2009-01-21 03:21:49 -0500 (Wed, 21 Jan 2009)
New Revision: 1140
Modified:
doc/trunk/reference/it-IT/intro.po
Log:
Update italian translation
Modified: doc/trunk/reference/it-IT/intro.po
===================================================================
--- doc/trunk/reference/it-IT/intro.po 2009-01-21 07:34:52 UTC (rev 1139)
+++ doc/trunk/reference/it-IT/intro.po 2009-01-21 08:21:49 UTC (rev 1140)
@@ -244,7 +244,7 @@
#: intro.xml:113
#, no-c-format
msgid "For a given thread in a Web Beans application, there may be an <emphasis>active context</emphasis> associated with the scope of the Web Bean. This context may be unique to the thread (for example, if the Web Bean is request scoped), or it may be shared with certain other threads (for example, if the Web Bean is session scoped) or even all other threads (if it is application scoped)."
-msgstr "Per un dato thread in un'applicazione Web Beans, ci può essere un <emphasis>contesto attivo</emphasis> associato allo scope del Web Bean. Questo contesto può essere univoco nel thread (per esempio, se il Web Bean è con scope di richesta), o può essere condiviso con alcuni altri thread (per esempio, se il Web Bean è con scope di sessione) od anche tutti gli altri thread (se è scope di applicazione). "
+msgstr "Per un dato thread in un'applicazione Web Beans, ci può essere un <emphasis>contesto attivo</emphasis> associato allo scope del Web Bean. Questo contesto può essere univoco nel thread (per esempio, se il Web Bean è con scope di richiesta), o può essere condiviso con alcuni altri thread (per esempio, se il Web Bean è con scope di sessione) od anche tutti gli altri thread (se è scope di applicazione). "
#. Tag: para
#: intro.xml:119
16 years, 8 months
[webbeans-commits] Webbeans SVN: r1139 - doc/trunk/reference/ko-KR.
by webbeans-commits@lists.jboss.org
Author: eukim
Date: 2009-01-21 02:34:52 -0500 (Wed, 21 Jan 2009)
New Revision: 1139
Modified:
doc/trunk/reference/ko-KR/scopescontexts.po
Log:
updated
Modified: doc/trunk/reference/ko-KR/scopescontexts.po
===================================================================
--- doc/trunk/reference/ko-KR/scopescontexts.po 2009-01-21 03:50:53 UTC (rev 1138)
+++ doc/trunk/reference/ko-KR/scopescontexts.po 2009-01-21 07:34:52 UTC (rev 1139)
@@ -8,7 +8,7 @@
"Project-Id-Version: scopescontexts\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-01-06 11:30+0000\n"
-"PO-Revision-Date: 2009-01-20 15:43+1000\n"
+"PO-Revision-Date: 2009-01-21 17:14+1000\n"
"Last-Translator: Eunju Kim <eukim(a)redhat.com>\n"
"Language-Team: Korean <ko(a)li.org>\n"
"MIME-Version: 1.0\n"
@@ -17,6 +17,7 @@
"X-Generator: KBabel 1.11.4\n"
"Plural-Forms: nplurals=2; plural=(n!=1);\n\n"
"\n"
+"\n"
#. Tag: title
#: scopescontexts.xml:4
@@ -51,7 +52,7 @@
#: scopescontexts.xml:20
#, no-c-format
msgid "Which injected references refer to any instance of a Web Bean with that scope"
-msgstr ""
+msgstr "삽입된 어떤 참조가 범위와 함께 Web Bean 인스턴스를 참조하는 지 "
#. Tag: para
#: scopescontexts.xml:25
@@ -63,7 +64,7 @@
"<literal>CurrentUser</literal>. This instance will be automatically created "
"the first time a <literal>CurrentUser</literal> is needed in that session, "
"and automatically destroyed when the session ends."
-msgstr ""
+msgstr "예를 들어, Web Bean 세션 범위가 있을 경우, <literal>CurrentUser</literal>, 동일한 <literal>HttpSession</literal> 컨텍스트에서 호출되는 모든 Web Beans는 동일한 <literal>CurrentUser</literal> 인스턴스를 확인하게 됩니다. 이러한 인스턴스는 세션에서 <literal>CurrentUser</literal>가 처음으로 필요할 때 자동으로 생성되고 세션이 끝나면 자동으로 삭제됩니다. "
#. Tag: title
#: scopescontexts.xml:32
@@ -77,7 +78,7 @@
msgid ""
"Web Beans features an <emphasis>extensible context model</emphasis>. It is "
"possible to define new scopes by creating a new scope type annotation:"
-msgstr ""
+msgstr "Web Beans는 <emphasis>extensible context model</emphasis>을 특징으로 합니다. 새로운 범위 유형 어노테이션을 생성하여 새로운 범위를 정의할 수 있습니다: "
#. Tag: programlisting
#: scopescontexts.xml:37
@@ -101,7 +102,7 @@
"useful, we will also need to define a <literal>Context</literal> object that "
"implements the scope! Implementing a <literal>Context</literal> is usually a "
"very technical task, intended for framework development only."
-msgstr ""
+msgstr "물론 이는 이러한 작업 중 쉬운 부분입니다. 이러한 범위 유형을 유용하게 하려면, 범위를 구현하는 <literal>Context</literal> 객체를 정의해야 합니다! <literal>Context</literal> 구현은 아주 기술적인 작업으로, 프레임워크 개발 만을 목적으로 합니다. "
#. Tag: para
#: scopescontexts.xml:44
@@ -109,7 +110,7 @@
msgid ""
"We can apply a scope type annotation to a Web Bean implementation class to "
"specify the scope of the Web Bean:"
-msgstr ""
+msgstr "Web Bean 범위를 지정하기 위해 Web Bean 구현 클래스에 범위 유형 어노테이션을 적용할 수 있습니다: "
#. Tag: programlisting
#: scopescontexts.xml:47
@@ -125,7 +126,7 @@
#: scopescontexts.xml:58
#, no-c-format
msgid "Usually, you'll use one of Web Beans' built-in scopes."
-msgstr ""
+msgstr "주로, Web Beans의 내장된 범위 중 하나를 사용하게 됩니다. "
#. Tag: title
#: scopescontexts.xml:63
@@ -175,43 +176,43 @@
msgid ""
"any servlet request has access to active request, session and application "
"scopes, and, additionally"
-msgstr ""
+msgstr "servlet 요청은 활성 요청, 세션 및 애플리케이션 범위에 액세스합니다 "
#. Tag: para
#: scopescontexts.xml:90
#, no-c-format
msgid "any JSF request has access to an active conversation scope."
-msgstr ""
+msgstr "JSF 요청은 활성 컨버세이션 범위에 액세스합니다. "
#. Tag: para
#: scopescontexts.xml:94
#, no-c-format
msgid "The request and application scopes are also active:"
-msgstr ""
+msgstr "요청 및 애플리케이션 범위도 활성화되어 있습니다: "
#. Tag: para
#: scopescontexts.xml:98
#, no-c-format
msgid "during invocations of EJB remote methods,"
-msgstr ""
+msgstr "EJB 원격 방식의 호출시 "
#. Tag: para
#: scopescontexts.xml:101
#, no-c-format
msgid "during EJB timeouts,"
-msgstr ""
+msgstr "EJB 시간 초과시 "
#. Tag: para
#: scopescontexts.xml:104
#, no-c-format
msgid "during message delivery to a message-driven bean, and"
-msgstr ""
+msgstr "메세지 구동 빈에 메세지 전달시 "
#. Tag: para
#: scopescontexts.xml:107
#, no-c-format
msgid "during web service invocations."
-msgstr ""
+msgstr "웹 서비스 호출시 "
#. Tag: para
#: scopescontexts.xml:111
@@ -220,7 +221,7 @@
"If the application tries to invoke a Web Bean with a scope that does not "
"have an active context, a <literal>ContextNotActiveException</literal> is "
"thrown by the Web Bean manager at runtime."
-msgstr ""
+msgstr "애플리케이션이 활성 컨텍스트가 없는 범위와 함께 Web Bean을 호출하고자할 경우, 런타임시 <literal>ContextNotActiveException</literal>은 Web Bean 관리자에 의해 넘기게 됩니다. "
#. Tag: para
#: scopescontexts.xml:115
@@ -229,13 +230,13 @@
"Three of the four built-in scopes should be extremely familiar to every Java "
"EE developer, so let's not waste time discussing them here. One of the "
"scopes, however, is new."
-msgstr ""
+msgstr "네 개의 내장된 범위 중 세 개는 모든 Java EE 개발자에게 익숙하므로, 여기서 다루지 않겠습니다. 하지만 이 중 하나의 범위 새로운 것입니다. "
#. Tag: title
#: scopescontexts.xml:122
#, no-c-format
msgid "The conversation scope"
-msgstr ""
+msgstr "컨버세이션 범위 "
#. Tag: para
#: scopescontexts.xml:124
@@ -245,13 +246,13 @@
"in that it holds state associated with a user of the system, and spans "
"multiple requests to the server. However, unlike the session scope, the "
"conversation scope:"
-msgstr ""
+msgstr "Web Beans 컨버세이션 범위는 시스템 사용자와 관련된 상태를 보유하고 있는 전통 세션 범위와 유사하며, 서버에 여러 가지 요청을 보냅니다. 하지만, 세션 범위와 다르게 컨버세이션 범위는 다음과 같은 사항을 갖습니다: "
#. Tag: para
#: scopescontexts.xml:130
#, no-c-format
msgid "is demarcated explicitly by the application, and"
-msgstr ""
+msgstr "애플리케이션에 의해 명시적으로 경계를 정합니다 "
#. Tag: para
#: scopescontexts.xml:133
@@ -259,7 +260,7 @@
msgid ""
"holds state associated with a particular web browser tab in a JSF "
"application."
-msgstr ""
+msgstr "JSF 애플리케이션에 있는 특정 웹 브라우저 탭과 관련한 상태를 유지합니다. "
#. Tag: para
#: scopescontexts.xml:138
@@ -279,13 +280,13 @@
"conversations are destroyed at the end of the request. If a conversation "
"should hold state across multiple requests, it must be explicitly promoted "
"to a <emphasis>long-running conversation</emphasis>."
-msgstr ""
+msgstr "컨버세이션 컨텍스트는 JSF 요청 시 활성화되어 있습니다. 하지만 대부분의 컨버세이션은 요청 마지막에 삭제됩니다. 컨버세이션이 여러 가지 요청을 통해 상태를 유지해야 할 경우, <emphasis>장기 실행 컨버세이션</emphasis>으로 요청되어야 합니다. "
#. Tag: title
#: scopescontexts.xml:149
#, no-c-format
msgid "Conversation demarcation"
-msgstr ""
+msgstr "컨버세이션 경계 설정 "
#. Tag: para
#: scopescontexts.xml:151
@@ -294,7 +295,7 @@
"Web Beans provides a built-in Web Bean for controlling the lifecyle of "
"conversations in a JSF application. This Web Bean may be obtained by "
"injection:"
-msgstr ""
+msgstr "Web Beans는 JSF 애플리케이션에 있는 컨버세이션 수명 주기를 제어하기 위한 내장된 Web Bean을 제공합니다. 이러한 Web Bean은 삽입에 의해 획득될 수 있습니다: "
#. Tag: programlisting
#: scopescontexts.xml:154
@@ -311,7 +312,7 @@
"application code. To schedule the current long-running conversation context "
"for destruction at the end of the current request, call <literal>end()</"
"literal>."
-msgstr ""
+msgstr "장기 실행 컨버세이션으로의 최근 요청과 관련된 컨버세이션을 활성화하려면, 애플리케이션 코드에서 <literal>begin()</literal> 방식을 호출합니다. 현재 요청의 마지막에 삭제를 위해 장기 실행 컨버세이션 컨텍스트를 스케줄하려면 <literal>end()</literal>를 호출합니다. "
#. Tag: para
#: scopescontexts.xml:161
@@ -319,7 +320,7 @@
msgid ""
"In the following example, a conversation-scoped Web Bean controls the "
"conversation with which it is associated:"
-msgstr ""
+msgstr "다음의 예에서, 컨버세이션 범위 Web Bean은 관련 된 컨버세이션을 제어합니다: "
#. Tag: programlisting
#: scopescontexts.xml:164
@@ -454,7 +455,7 @@
#: scopescontexts.xml:200
#, no-c-format
msgid "Conversation timeout"
-msgstr ""
+msgstr "컨버세이션 시간 초과 "
#. Tag: para
#: scopescontexts.xml:202
16 years, 8 months
[webbeans-commits] Webbeans SVN: r1138 - doc/trunk/reference/ko-KR.
by webbeans-commits@lists.jboss.org
Author: eukim
Date: 2009-01-20 22:50:53 -0500 (Tue, 20 Jan 2009)
New Revision: 1138
Modified:
doc/trunk/reference/ko-KR/ri.po
Log:
updated
Modified: doc/trunk/reference/ko-KR/ri.po
===================================================================
--- doc/trunk/reference/ko-KR/ri.po 2009-01-21 02:45:12 UTC (rev 1137)
+++ doc/trunk/reference/ko-KR/ri.po 2009-01-21 03:50:53 UTC (rev 1138)
@@ -8,7 +8,7 @@
"Project-Id-Version: ri\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-01-18 16:31+0000\n"
-"PO-Revision-Date: 2009-01-21 02:28+1000\n"
+"PO-Revision-Date: 2009-01-21 13:50+1000\n"
"Last-Translator: Eunju Kim <eukim(a)redhat.com>\n"
"Language-Team: Korean <ko(a)li.org>\n"
"MIME-Version: 1.0\n"
@@ -19,6 +19,8 @@
"\n"
"\n"
"\n"
+"\n"
+"\n"
#. Tag: title
#: ri.xml:4
@@ -736,7 +738,7 @@
"constructor injection to initialize the game with a random number. And of "
"course, we need to tell the player when they've won, so we give feedback "
"with a <literal>FacesMessage</literal>."
-msgstr ""
+msgstr "<literal>@Named</literal> 어노테이션이 사용되므로 JSF 페이지에서 EL을 통해 bean을 사용할 수 있음을 인지하실 것입니다. 마지막으로 생성자 삽입을 사용하여 임의의 숫자로 게임을 초기화합니다. 물론, 게임 플레이어에게 언제 게임에어 이겼는지를 알려주어야 하므로, <literal>FacesMessage</literal>로 피드백을 제공합니다. "
#. Tag: programlisting
#: ri.xml:328
@@ -940,7 +942,7 @@
#: ri.xml:332
#, no-c-format
msgid "The translator example"
-msgstr "번역 예제 "
+msgstr "번역 예제 "
#. Tag: para
#: ri.xml:334
@@ -956,7 +958,7 @@
msgid ""
"The translator example is built as an ear, and contains EJBs. As a result, "
"it's structure is more complex than the numberguess example."
-msgstr ""
+msgstr "번역 예제는 ear로 작성되며, EJB가 들어있게 됩니다. 따라서, 문장 구조가 numberguess 예보다 훨씬 복잡합니다. "
#. Tag: para
#: ri.xml:345
@@ -973,7 +975,7 @@
"First, let's take a look at the ear aggregator, which is located in "
"<literal>webbeans-translator-ear</literal> module. Maven automatically "
"generates the <literal>application.xml</literal> for us:"
-msgstr ""
+msgstr "먼저, <literal>webbeans-translator-ear</literal> 모듈에 있는 ear aggregator를 살펴봅시다. Maven은 자동으로 <literal>application.xml</literal>을 생성합니다: "
#. Tag: programlisting
#: ri.xml:357
@@ -1015,6 +1017,9 @@
"localhost:8080/webbeans-translator\">http://localhost:8080/webbeans-"
"translator</ulink>)."
msgstr ""
+"url (<ulink url=\"http://"
+"localhost:8080/webbeans-translator\">http://localhost:8080/webbeans-"
+"translator</ulink>)을 제공하는 컨텍스트 경로를 설정합니다. "
#. Tag: para
#: ri.xml:365
@@ -1077,7 +1082,7 @@
"Next, lets look at the war. Just as in the numberguess example, we have a "
"<literal>faces-config.xml</literal> (to enabled Facelets) and a <literal>web."
"xml</literal> (to enable JSF) in <literal>WebContent/WEB-INF</literal>."
-msgstr ""
+msgstr "다음으로, war를 살펴봅시다. numberguess 예제와 같이, <literal>WebContent/WEB-INF</literal>에 있는 <literal>faces-config.xml</literal> (Facelets를 활성화) 및 <literal>web.xml</literal> (JSF를 활성화)을 갖습니다. "
#. Tag: para
#: ri.xml:380
@@ -1086,7 +1091,7 @@
"More intersting is the facelet used to translate text. Just as in the "
"numberguess example we have a template, which surrounds the form (ommitted "
"here for brevity):"
-msgstr ""
+msgstr "텍스트를 번역하데 facelet이 사용됩니다. numberguess 예제에서와 같이 양식으로된 템플릿이 있습니다 (간결하게 하기 위해 여기서는 생략됨): "
#. Tag: programlisting
#: ri.xml:386
@@ -1154,7 +1159,7 @@
msgid ""
"The user can enter some text in the lefthand textarea, and hit the translate "
"button to see the result to the right."
-msgstr ""
+msgstr "사용자는 왼쪽 텍스트 부분에 텍스트를 입력할 수 있으며, 번역하기 버튼을 누르면 오른쪽에 번역 결과가 나타나게 됩니다. "
#. Tag: para
#: ri.xml:393
@@ -1164,7 +1169,7 @@
"literal>. In <literal>src/main/resources/META-INF</literal> there is just an "
"empty <literal>web-beans.xml</literal>, used to mark the archive as "
"containing Web Beans."
-msgstr ""
+msgstr "마지막으로, ejb 모듈인 <literal>webbeans-translator-ejb</literal>를 살펴봅시다. <literal>src/main/resources/META-INF</literal>에는 Web Beans가 들어 있는 것으로 아카이브를 표시하기 위해 사용되는 빈 <literal>web-beans.xml</literal>이 있습니다. "
#. Tag: para
#: ri.xml:401
@@ -1177,6 +1182,9 @@
"quite familiar with what a Web Bean looks like by now, so we'll just "
"highlight the most interesting bits here."
msgstr ""
+"가장 흥미로운 코드 부분은 마지막을 위해 남겨두겠습니다! 프로젝트에는 두 개의 단순한 beans인 <literal>SentenceParser</literal> 및 <literal>TextTranslator</"
+"literal>와 두 개의 엔터프라이즈 beans인 <literal>TranslatorControllerBean</"
+"literal> 및 <literal>SentenceTranslator</literal>가 있습니다. 이제 Web Bean에 관해 보다 많이 알고 계실 것이므로, 가장 중요한 부분만 여기서 다루겠습니다. "
#. Tag: para
#: ri.xml:411
@@ -1185,7 +1193,7 @@
"Both <literal>SentenceParser</literal> and <literal>TextTranslator</literal> "
"are dependent beans, and <literal>TextTranslator</literal> uses constructor "
"initialization:"
-msgstr ""
+msgstr "<literal>SentenceParser</literal> 및 <literal>TextTranslator</literal>는 beans에 의존하며, <literal>TextTranslator</literal>는 생성자 초기화를 사용합니다: "
#. Tag: programlisting
#: ri.xml:417
@@ -1220,7 +1228,7 @@
"<literal>TextTranslator</literal> is a stateless bean (with a local business "
"interface), where the magic happens - of course, we couldn't develop a full "
"translator, but we gave it a good go!"
-msgstr ""
+msgstr "<literal>TextTranslator</literal>는 무상태 세션빈으로 (로컬 비지니스 인터페이스와 함께), 완전한 번역기를 개발할 수는 없지만, 잘 작동하고 있습니다! "
#. Tag: para
#: ri.xml:425
@@ -1229,7 +1237,7 @@
"Finally, there is UI orientated controller, that collects the text from the "
"user, and dispatches it to the translator. This is a request scoped, named, "
"stateful session bean, which injects the translator."
-msgstr ""
+msgstr "마지막으로, UI 기반 제어기가 있어, 이는 사용자로 부터 텍스트를 수집하여 번역기에 이를 보냅니다. 이는 요청 범위, 이름, 상태 유지 세션빈으로 번역기에 삽입되어 있습니다. "
#. Tag: programlisting
#: ri.xml:431
@@ -1255,13 +1263,13 @@
#: ri.xml:433
#, no-c-format
msgid "The bean also has getters and setters for all the fields on the page."
-msgstr ""
+msgstr "bean은 페이지에 있는 모든 영역에 대해 getter 및 setter를 갖습니다. "
#. Tag: para
#: ri.xml:437
#, no-c-format
msgid "As this is a stateful session bean, we have to have a remove method:"
-msgstr ""
+msgstr "이는 상태 유지 세션 빈이므로, 제거 방식을 갖고 있어야 합니다: "
#. Tag: programlisting
#: ri.xml:441
@@ -1285,7 +1293,7 @@
msgid ""
"The Web Beans manager will call the remove method for you when the bean is "
"destroyed; in this case at the end of the request."
-msgstr ""
+msgstr "Web Beans 관리자는 bean이 삭제될 때 제거 방식을 호출하게 됩니다; 이러한 경우 요청 마지막에 호출하게 됩니다. "
#. Tag: para
#: ri.xml:449
@@ -1296,6 +1304,9 @@
"WebBeans/Development\">http://www.seamframework.org/WebBeans/Development</"
"ulink>."
msgstr ""
+"이제 Web Beans RI 예제의 짧은 여정을 마칩니다. RI에 관한 보다 자세한 내용은 <ulink url=\"http://www.seamframework.org/"
+"WebBeans/Development\">http://www.seamframework.org/WebBeans/Development</"
+"ulink>에서 살펴보시기 바랍니다. "
#. Tag: para
#: ri.xml:455
@@ -1303,5 +1314,5 @@
msgid ""
"We need help in all areas - bug fixing, writing new features, writing "
"examples and translating this reference guide."
-msgstr ""
+msgstr "버그 수정, 새로운 기능 작성, 예세 작성, 참조 가이드 번역과 같이 모든 영역에서 도움이 필요합니다. "
16 years, 8 months
[webbeans-commits] Webbeans SVN: r1137 - doc/trunk/reference/zh-TW.
by webbeans-commits@lists.jboss.org
Author: tchuang
Date: 2009-01-20 21:45:12 -0500 (Tue, 20 Jan 2009)
New Revision: 1137
Modified:
doc/trunk/reference/zh-TW/intro.po
Log:
Translation updated
Modified: doc/trunk/reference/zh-TW/intro.po
===================================================================
--- doc/trunk/reference/zh-TW/intro.po 2009-01-21 02:07:34 UTC (rev 1136)
+++ doc/trunk/reference/zh-TW/intro.po 2009-01-21 02:45:12 UTC (rev 1137)
@@ -8,7 +8,7 @@
"Project-Id-Version: intro\n"
"Report-Msgid-Bugs-To: http://bugs.kde.org\n"
"POT-Creation-Date: 2009-01-06 11:30+0000\n"
-"PO-Revision-Date: 2009-01-20 17:26+1000\n"
+"PO-Revision-Date: 2009-01-21 12:44+1000\n"
"Last-Translator: Terry Chuang <tchuang(a)redhat.com>\n"
"Language-Team: Traditional Chinese <zh(a)li.org>\n"
"MIME-Version: 1.0\n"
@@ -607,7 +607,7 @@
"We would enable the deployment type <literal>@Mock</literal> in our testing "
"environment, to indicate that <literal>MockSentenceTranslator</literal> and "
"any other Web Bean annotated <literal>@Mock</literal> should be used."
-msgstr ""
+msgstr "我們將在測試環境中啟用 <literal>@Mock</literal> 這個 deployment type 來表示 <literal>MockSentenceTranslator</literal> 以及任何其它被標記為 <literal>@Mock</literal> 的 Web Bean 都應該被使用。"
#. Tag: para
#: intro.xml:240
@@ -632,7 +632,7 @@
"accommodating arbitrary scopes. However, certain important scopes are built-"
"in to the specification, and provided by the Web Bean manager. A scope is "
"represented by an annotation type."
-msgstr ""
+msgstr "<emphasis>Scope</emphasis> 定義了 Web Bean instance 的生命週期以及可見度。Web Bean 的 context model 可延伸、並能包容任意的 scope。不過,有些重要的特定 scope 則會被內建在 Web Bean 規格中,並透過 Web Bean 管理員來提供。Scope 是以一個標記類型來表示的。"
#. Tag: para
#: intro.xml:254
@@ -850,7 +850,7 @@
#: intro.xml:341
#, no-c-format
msgid "it is not a parameterized type, and"
-msgstr ""
+msgstr "它不是個被參數化的類型,並且"
#. Tag: para
#: intro.xml:344
@@ -858,13 +858,13 @@
msgid ""
"it has a constructor with no parameters, or a constructor annotated "
"<literal>@Initializer</literal>."
-msgstr ""
+msgstr "它有個無參數的 constructor,或一個標記為 <literal>@Initializer</literal> 的 constructor。"
#. Tag: para
#: intro.xml:349
#, no-c-format
msgid "Thus, almost every JavaBean is a simple Web Bean."
-msgstr ""
+msgstr "因此,幾乎所有 JavaBean 都屬於基本的 Web Bean。"
#. Tag: para
#: intro.xml:351
@@ -873,25 +873,24 @@
"Every interface implemented directly or indirectly by a simple Web Bean is "
"an API type of the simple Web Bean. The class and its superclasses are also "
"API types."
-msgstr ""
+msgstr "基本 Web Bean 所直接或間接實做的所有介面都屬於基本 Web Bean 的 API 類型。Class 和它的 superclass 也都屬於 API 類型。"
#. Tag: title
#: intro.xml:358
#, no-c-format
msgid "Enterprise Web Beans"
-msgstr ""
+msgstr "企業級的 Web Bean"
#. Tag: para
#: intro.xml:360
#, no-c-format
-#, fuzzy
msgid ""
"The specification says that all EJB 3-style session and singleton beans are "
"<emphasis>enterprise</emphasis> Web Beans. Message driven beans are not Web "
"Beans — since they are not intended to be injected into other "
"objects — but they can take advantage of most of the functionality of Web "
"Beans, including dependency injection and interceptors."
-msgstr "依賴注入"
+msgstr "Web Bean 的規格顯示了所有 EJB 3 類型的 session 和 singleton 的 bean 都屬於<emphasis>企業級</emphasis>的 Web Bean。訊息導向的 bean 則不屬於 Web Bean — 因為它們不會被注入其它的物件中 — 不過它們能夠有效利用 Web Bean 大部分的功能,這包括依賴注入(dependency injection)以及攔截器(interceptor)。"
#. Tag: para
#: intro.xml:366
@@ -902,7 +901,7 @@
"superinterfaces, is an API type of the enterprise Web Bean. If the EJB bean "
"has a bean class local view, the bean class, and every one of its "
"superclasses, is also an API type."
-msgstr ""
+msgstr "所有沒有 wildcard 類型參數或是類型變數的企業級 Web Bean 的本地介面以及它所有的 superinterface 都屬於企業級 Web Bean 的 API 類型。若 EJB bean 有個 bean class local view 的話,那麼這個 bean class 以及它所有的 superclass 也都會是個 API 類型。"
#. Tag: para
#: intro.xml:372
@@ -913,7 +912,7 @@
"manager calls this method to destroy the stateful session bean instance at "
"the end of its lifecycle. This method is called the <emphasis>destructor</"
"emphasis> method of the enterprise Web Bean."
-msgstr ""
+msgstr "有狀態的 session bean 應宣告一個無參數的 remove method 或是一個標記為 <literal>@Destructor</literal> 的 remove method。Web Bean 管理員會調用這個 method 來在它的生命週期結束時刪除有狀態的 session bean instance。這個 method 亦稱為企業級 Web Bean 的 <emphasis>destructor</emphasis> method。"
#. Tag: programlisting
#: intro.xml:378
@@ -946,19 +945,19 @@
"So when should we use an enterprise Web Bean instead of a simple Web Bean? "
"Well, whenever we need the advanced enterprise services offered by EJB, such "
"as:"
-msgstr ""
+msgstr "所以我們該何時使用企業級的 Web Bean 何時使用基本 Web Bean 呢?每當我們需要 EJB 所提供的進階企業級服務時,例如:"
#. Tag: para
#: intro.xml:387
#, no-c-format
msgid "method-level transaction management and security,"
-msgstr ""
+msgstr "method 層級的交易管理與安全性、"
#. Tag: para
#: intro.xml:390
#, no-c-format
msgid "concurrency management,"
-msgstr ""
+msgstr "並行管理(concurrency management)、"
#. Tag: para
#: intro.xml:393
@@ -966,19 +965,19 @@
msgid ""
"instance-level passivation for stateful session beans and instance-pooling "
"for stateless session beans,"
-msgstr ""
+msgstr "有狀態的 session bean 的 instance 層級的 passivation 以及無狀態 session bean 的類別儲備(instance-pooling)、"
#. Tag: para
#: intro.xml:397
#, no-c-format
msgid "remote and web service invocation, and"
-msgstr ""
+msgstr "遠端和網站服務調用,以及"
#. Tag: para
#: intro.xml:400
#, no-c-format
msgid "timers and asynchronous methods,"
-msgstr ""
+msgstr "計時器與非同步的 method,"
#. Tag: para
#: intro.xml:404
@@ -986,7 +985,7 @@
msgid ""
"we should use an enterprise Web Bean. When we don't need any of these "
"things, a simple Web Bean will serve just fine."
-msgstr ""
+msgstr "當需要以上服務時我們便應使用企業級的 Web Bean。當我們不需要任何的這些服務時,使用基本的 Web Bean 即可。"
#. Tag: para
#: intro.xml:407
@@ -996,7 +995,7 @@
"available for concurrent access. Therefore, the concurrency management "
"provided by EJB 3.1 is especially useful. Most session and application "
"scoped Web Beans should be EJBs."
-msgstr ""
+msgstr "許多 Web Bean(包括任何 session 或 application scoped 的 Web Bean)都能被並行存取(concurrent access)。因此,EJB 3.1 所提供的並行管理(concurrency management)特別地有幫助。大部分的 session 和 application scoped 的 Web Bean 都應屬於 EJB。"
#. Tag: para
#: intro.xml:412
@@ -1007,7 +1006,7 @@
"by the EJB <literal>@Stateless</literal>/<literal>@Stateful</literal>/"
"<literal>@Singleton</literal> model, with its support for passivation and "
"instance pooling."
-msgstr ""
+msgstr "持有重量級資源之參照或持有許多內部狀態的 Web Bean 皆可受益于支援 passivation 和類別儲備的 EJB <literal>@Stateless</literal>/<literal>@Stateful</literal>/<literal>@Singleton</literal> 模型所定義並由進階 container 所管理的生命週期。"
#. Tag: para
#: intro.xml:417
@@ -1016,7 +1015,7 @@
"Finally, it's usually obvious when method-level transaction management, "
"method-level security, timers, remote methods or asynchronous methods are "
"needed."
-msgstr ""
+msgstr "最後,一般來講,何時需要使用到 method 層級的交易性管理、method 層級的安全性、計時器、遠端 method 或是非同步的 method 其實都是非常顯而易見的。"
#. Tag: para
#: intro.xml:420
@@ -1025,7 +1024,7 @@
"It's usually easy to start with simple Web Bean, and then turn it into an "
"EJB, just by adding an annotation: <literal>@Stateless</literal>, "
"<literal>@Stateful</literal> or <literal>@Singleton</literal>."
-msgstr ""
+msgstr "通常從基本的 Web Bean 開始會較容易,然後只要再透過附加一個 <literal>@Stateless</literal>、<literal>@Stateful</literal> 或是 <literal>@Singleton</literal> 標記來將它轉換為一個 EJB 即可。"
#. Tag: title
#: intro.xml:427
@@ -1042,7 +1041,7 @@
"in the current context. A producer method lets the application take full "
"control of the instantiation process, instead of leaving instantiation to "
"the Web Bean manager. For example:"
-msgstr ""
+msgstr "<emphasis>producer method</emphasis> 是個當目前 context 中沒有 instance 時會被 Web Bean 管理員調用來取得 Web Bean instance 的一個 method。Producer method 能讓應用程式完全掌控例示(instantiation)的程序,而不是留給 Web Bean 管理員去進行。例如:"
#. Tag: programlisting
#: intro.xml:435
@@ -1074,7 +1073,7 @@
#: intro.xml:437
#, no-c-format
msgid "The result of a producer method is injected just like any other Web Bean."
-msgstr ""
+msgstr "producer method 的結果會和其它任何 Web Bean 一樣地被注入。"
#. Tag: programlisting
#: intro.xml:439
@@ -1089,7 +1088,7 @@
"The method return type and all interfaces it extends/implements directly or "
"indirectly are API types of the producer method. If the return type is a "
"class, all superclasses are also API types."
-msgstr ""
+msgstr "method 的回傳類型以及它所直接或間接延伸/實做的介面皆為 producer method 的 API 類型。若回傳的類型是個 class 的話,那麼所有的 superclass 也都會是 API 類型。"
#. Tag: para
#: intro.xml:445
16 years, 8 months
[webbeans-commits] Webbeans SVN: r1136 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector and 1 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-20 21:07:34 -0500 (Tue, 20 Jan 2009)
New Revision: 1136
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/FarmHouse.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java
Log:
realization support for observer methods
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-01-21 01:06:31 UTC (rev 1135)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-01-21 02:07:34 UTC (rev 1136)
@@ -121,6 +121,7 @@
{
createRealizedProducerMethods(bean, annotatedClass);
createRealizedProducerFields(bean, annotatedClass);
+ createRealizedObserverMethods(bean, annotatedClass);
}
log.info("Web Bean: " + bean);
@@ -179,12 +180,22 @@
private void createObserverMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
{
- for (AnnotatedMethod<?> observerMethod : annotatedClass.getDeclaredMethodsWithAnnotatedParameters(Observes.class))
+ for (AnnotatedMethod<?> method : annotatedClass.getDeclaredMethodsWithAnnotatedParameters(Observes.class))
{
- ObserverImpl<?> observer = ObserverImpl.of(observerMethod, declaringBean, manager);
- manager.addObserver(observer);
+ createObserverMethod(declaringBean, method);
}
}
+
+ private void createRealizedObserverMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> realizingClass)
+ {
+ createObserverMethods(declaringBean, realizingClass.getSuperclass());
+ }
+
+ private void createObserverMethod(AbstractClassBean<?> declaringBean, AnnotatedMethod<?> method)
+ {
+ ObserverImpl<?> observer = ObserverImpl.of(method, declaringBean, manager);
+ manager.addObserver(observer);
+ }
private void createFacades(Set<AnnotatedItem<?, ?>> injectionPoints)
{
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java 2009-01-21 02:07:34 UTC (rev 1136)
@@ -0,0 +1,35 @@
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+public class WrappedAnnotatedParameter<T> extends ForwardingAnnotatedParameter<T>
+{
+
+ public static <T> WrappedAnnotatedParameter<T> of(AnnotatedParameter<T> parameter, Set<Annotation> extraAnnotations)
+ {
+ return new WrappedAnnotatedParameter<T>(parameter, extraAnnotations);
+ }
+
+ private final AnnotatedParameter<T> delegate;
+ private AnnotationStore annotationStore;
+
+ public WrappedAnnotatedParameter(AnnotatedParameter<T> parameter, Set<Annotation> extraAnnotations)
+ {
+ this.delegate = parameter;
+ this.annotationStore = AnnotationStore.wrap(parameter.getAnnotationStore(), extraAnnotations, extraAnnotations);
+ }
+
+ @Override
+ protected AnnotatedParameter<T> delegate()
+ {
+ return delegate;
+ }
+
+ @Override
+ public AnnotationStore getAnnotationStore()
+ {
+ return annotationStore;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/FarmHouse.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/FarmHouse.java 2009-01-21 01:06:31 UTC (rev 1135)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/FarmHouse.java 2009-01-21 02:07:34 UTC (rev 1136)
@@ -1,5 +1,8 @@
package org.jboss.webbeans.tck.unit.inheritance.realization;
+import javax.webbeans.Realizes;
+
+@Smelly @Realizes
class FarmHouse extends AbstractFarmHouse
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java 2009-01-21 01:06:31 UTC (rev 1135)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java 2009-01-21 02:07:34 UTC (rev 1136)
@@ -137,11 +137,12 @@
assert false;
}
- @Test(groups="broken") @SpecAssertion(section="4.1")
+ @Test @SpecAssertion(section="4.1")
public void testObserverMethodInheritedAndHasSameBindings()
{
deployBeans(FarmHouse.class);
assert manager.resolveObservers(new Cow(), new AnnotationLiteral<Tame>(){}).size() == 1;
+ assert manager.resolveObservers(new Cow(), SMELLY_LITERAL).size() == 0;
}
}
16 years, 8 months
[webbeans-commits] Webbeans SVN: r1135 - ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap and 4 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-20 20:06:31 -0500 (Tue, 20 Jan 2009)
New Revision: 1135
Added:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java
Removed:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotationStore.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedAnnotation.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMember.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMember.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedType.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/MergedStereotypes.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java
Log:
More specialization support
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -39,7 +39,7 @@
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.injection.InjectionPointImpl;
import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.introspector.jlr.AnnotationStore.AnnotationMap;
+import org.jboss.webbeans.introspector.AnnotationStore.AnnotationMap;
import org.jboss.webbeans.literal.CurrentLiteral;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -9,6 +9,7 @@
import java.util.Set;
import javax.webbeans.BindingType;
+import javax.webbeans.DeploymentType;
import javax.webbeans.Fires;
import javax.webbeans.Initializer;
import javax.webbeans.Observes;
@@ -33,6 +34,8 @@
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.WrappedAnnotatedField;
+import org.jboss.webbeans.introspector.WrappedAnnotatedMethod;
import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
import org.jboss.webbeans.jsf.JSFApiAbstraction;
import org.jboss.webbeans.log.LogProvider;
@@ -109,45 +112,72 @@
manager.getResolver().addInjectionPoints(bean.getAnnotatedInjectionPoints());
- registerProducerMethods(bean, annotatedClass, EMPTY_BINDINGS);
- registerProducerFields(bean, annotatedClass, EMPTY_BINDINGS);
- registerObserverMethods(bean, annotatedClass);
- registerFacades(bean.getAnnotatedInjectionPoints());
+ createProducerMethods(bean, annotatedClass);
+ createProducerFields(bean, annotatedClass);
+ createObserverMethods(bean, annotatedClass);
+ createFacades(bean.getAnnotatedInjectionPoints());
if (annotatedClass.isAnnotationPresent(Realizes.class))
{
- Set<Annotation> extraAnnotations = new HashSet<Annotation>();
- extraAnnotations.addAll(annotatedClass.getDeclaredMetaAnnotations(BindingType.class));
- registerProducerMethods(bean, annotatedClass.getSuperclass(), extraAnnotations);
- registerProducerFields(bean, annotatedClass.getSuperclass(), extraAnnotations);
+ createRealizedProducerMethods(bean, annotatedClass);
+ createRealizedProducerFields(bean, annotatedClass);
}
log.info("Web Bean: " + bean);
}
- private void registerProducerMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass, Set<Annotation> extraAnnotations)
+ private void createProducerMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
{
for (AnnotatedMethod<?> method : annotatedClass.getDeclaredAnnotatedMethods(Produces.class))
{
- ProducerMethodBean<?> bean = ProducerMethodBean.of(method.wrap(extraAnnotations), declaringBean, manager);
- beans.add(bean);
- manager.getResolver().addInjectionPoints(bean.getAnnotatedInjectionPoints());
- registerFacades(bean.getAnnotatedInjectionPoints());
- log.info("Web Bean: " + bean);
+ createProducerMethod(declaringBean, method);
+
}
}
- private void registerProducerFields(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass, Set<Annotation> extraAnnotations)
+ private void createProducerMethod(AbstractClassBean<?> declaringBean, AnnotatedMethod<?> annotatedMethod)
{
+ ProducerMethodBean<?> bean = ProducerMethodBean.of(annotatedMethod, declaringBean, manager);
+ beans.add(bean);
+ manager.getResolver().addInjectionPoints(bean.getAnnotatedInjectionPoints());
+ createFacades(bean.getAnnotatedInjectionPoints());
+ log.info("Web Bean: " + bean);
+ }
+
+ private void createRealizedProducerMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> realizingClass)
+ {
+ AnnotatedClass<?> realizedClass = realizingClass.getSuperclass();
+ for (AnnotatedMethod<?> realizedMethod : realizedClass.getDeclaredAnnotatedMethods(Produces.class))
+ {
+ createProducerMethod(declaringBean, realizeProducerMethod(realizedMethod, realizingClass));
+ }
+ }
+
+ private void createRealizedProducerFields(AbstractClassBean<?> declaringBean, AnnotatedClass<?> realizingClass)
+ {
+ AnnotatedClass<?> realizedClass = realizingClass.getSuperclass();
+ for (final AnnotatedField<?> realizedField : realizedClass.getDeclaredAnnotatedFields(Produces.class))
+ {
+ createProducerField(declaringBean, realizeProducerField(realizedField, realizingClass));
+ }
+ }
+
+ private void createProducerField(AbstractClassBean<?> declaringBean, AnnotatedField<?> field)
+ {
+ ProducerFieldBean<?> bean = ProducerFieldBean.of(field, declaringBean, manager);
+ beans.add(bean);
+ log.info("Web Bean: " + bean);
+ }
+
+ private void createProducerFields(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
+ {
for (AnnotatedField<?> field : annotatedClass.getDeclaredAnnotatedFields(Produces.class))
{
- ProducerFieldBean<?> bean = ProducerFieldBean.of(field.wrap(extraAnnotations), declaringBean, manager);
- beans.add(bean);
- log.info("Web Bean: " + bean);
+ createProducerField(declaringBean, field);
}
}
- private void registerObserverMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
+ private void createObserverMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
{
for (AnnotatedMethod<?> observerMethod : annotatedClass.getDeclaredMethodsWithAnnotatedParameters(Observes.class))
{
@@ -156,22 +186,22 @@
}
}
- private void registerFacades(Set<AnnotatedItem<?, ?>> injectionPoints)
+ private void createFacades(Set<AnnotatedItem<?, ?>> injectionPoints)
{
for (AnnotatedItem<?, ?> injectionPoint : injectionPoints)
{
if (injectionPoint.isAnnotationPresent(Fires.class))
{
- registerEvent(injectionPoint);
+ createEvent(injectionPoint);
}
if (injectionPoint.isAnnotationPresent(Obtains.class))
{
- registerInstance(injectionPoint);
+ createInstance(injectionPoint);
}
}
}
- private void registerEvent(AnnotatedItem<?, ?> injectionPoint)
+ private void createEvent(AnnotatedItem<?, ?> injectionPoint)
{
// TODO Fix this!
@SuppressWarnings("unchecked")
@@ -180,7 +210,7 @@
log.info("Web Bean: " + bean);
}
- private void registerInstance(AnnotatedItem<?, ?> injectionPoint)
+ private void createInstance(AnnotatedItem<?, ?> injectionPoint)
{
// TODO FIx this
@SuppressWarnings("unchecked")
@@ -223,4 +253,73 @@
return false;
}
}
+
+ private static <T> AnnotatedMethod<T> realizeProducerMethod(final AnnotatedMethod<T> method, final AnnotatedClass<?> realizingClass)
+ {
+ return new WrappedAnnotatedMethod<T>(method, realizingClass.getMetaAnnotations(BindingType.class))
+ {
+
+ @Override
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ if (metaAnnotationType.equals(DeploymentType.class))
+ {
+ return realizingClass.getMetaAnnotations(DeploymentType.class);
+ }
+ else
+ {
+ return super.getMetaAnnotations(metaAnnotationType);
+ }
+ }
+
+ @Override
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ if (metaAnnotationType.equals(DeploymentType.class))
+ {
+ return realizingClass.getDeclaredMetaAnnotations(DeploymentType.class);
+ }
+ else
+ {
+ return super.getDeclaredMetaAnnotations(metaAnnotationType);
+ }
+ }
+
+ };
+ }
+
+ private static <T> AnnotatedField<T> realizeProducerField(final AnnotatedField<T> field, final AnnotatedClass<?> realizingClass)
+ {
+ return new WrappedAnnotatedField<T>(field, realizingClass.getMetaAnnotations(BindingType.class))
+ {
+
+ @Override
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ if (metaAnnotationType.equals(DeploymentType.class))
+ {
+ return realizingClass.getMetaAnnotations(DeploymentType.class);
+ }
+ else
+ {
+ return super.getMetaAnnotations(metaAnnotationType);
+ }
+ }
+
+ @Override
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ if (metaAnnotationType.equals(DeploymentType.class))
+ {
+ return realizingClass.getDeclaredMetaAnnotations(DeploymentType.class);
+ }
+ else
+ {
+ return super.getDeclaredMetaAnnotations(metaAnnotationType);
+ }
+ }
+
+ };
+ }
+
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedAnnotation.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedAnnotation.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedAnnotation.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -43,6 +43,4 @@
*/
public Set<AnnotatedMethod<?>> getAnnotatedMembers(Class<? extends Annotation> annotationType);
- public AnnotatedAnnotation<T> wrap(Set<Annotation> annotations);
-
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -151,7 +151,5 @@
public boolean isNonStaticMemberClass();
public boolean isParameterizedType();
-
- public AnnotatedClass<T> wrap(Set<Annotation> annotations);
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -20,7 +20,6 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.util.List;
-import java.util.Set;
import org.jboss.webbeans.ManagerImpl;
@@ -65,7 +64,5 @@
* @return An abstraction of the declaring class
*/
public AnnotatedType<T> getDeclaringClass();
-
- public AnnotatedConstructor<T> wrap(Set<Annotation> annotations);
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -17,9 +17,7 @@
package org.jboss.webbeans.introspector;
-import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
-import java.util.Set;
import javax.webbeans.manager.Manager;
@@ -99,6 +97,4 @@
public boolean isTransient();
- public AnnotatedField<T> wrap(Set<Annotation> annotations);
-
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -184,6 +184,6 @@
*/
public String getName();
- public AnnotatedItem<T, S> wrap(Set<Annotation> annotations);
+ public AnnotationStore getAnnotationStore();
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMember.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMember.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMember.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -16,9 +16,7 @@
*/
package org.jboss.webbeans.introspector;
-import java.lang.annotation.Annotation;
import java.lang.reflect.Member;
-import java.util.Set;
/**
* AnnotedMember provides enhanced access to an annotated member
*
@@ -30,6 +28,4 @@
public S getMember();
- public AnnotatedMember<T, S> wrap(Set<Annotation> annotations);
-
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -130,7 +130,5 @@
public boolean isEquivalent(Method method);
public Method getAnnotatedMethod();
-
- public AnnotatedMethod<T> wrap(Set<Annotation> annotations);
}
Copied: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java (from rev 1134, ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotationStore.java)
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -0,0 +1,315 @@
+package org.jboss.webbeans.introspector;
+
+import static org.jboss.webbeans.introspector.AnnotatedItem.MAPPED_METAANNOTATIONS;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.webbeans.BindingType;
+
+import org.jboss.webbeans.literal.CurrentLiteral;
+import org.jboss.webbeans.util.Strings;
+
+import com.google.common.collect.ForwardingMap;
+
+public class AnnotationStore
+{
+
+ // The array of default binding types
+ private static final Annotation[] DEFAULT_BINDING_ARRAY = { new CurrentLiteral() };
+ // The set of default binding types
+ private static final Set<Annotation> DEFAULT_BINDING = new HashSet<Annotation>(Arrays.asList(DEFAULT_BINDING_ARRAY));
+
+ private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
+
+ /**
+ * Represents a mapping from a annotation type to an annotation
+ * implementation
+ */
+ public static class AnnotationMap extends ForwardingMap<Class<? extends Annotation>, Annotation>
+ {
+ private final Map<Class<? extends Annotation>, Annotation> delegate;
+
+ public AnnotationMap()
+ {
+ delegate = new HashMap<Class<? extends Annotation>, Annotation>();
+ }
+
+ @Override
+ protected Map<Class<? extends Annotation>, Annotation> delegate()
+ {
+ return delegate;
+ }
+
+ /**
+ * Gets a string representation of the Map
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ return Strings.mapToString("AnnotationMap (annotation type -> annotation): ", delegate);
+ }
+
+ }
+
+ /**
+ * Represents a mapping from a annotation (meta-annotation) to a set of
+ * annotations
+ *
+ */
+ private static class MetaAnnotationMap extends ForwardingMap<Class<? extends Annotation>, Set<Annotation>>
+ {
+ private final Map<Class<? extends Annotation>, Set<Annotation>> delegate;
+
+ public MetaAnnotationMap()
+ {
+ delegate = new HashMap<Class<? extends Annotation>, Set<Annotation>>();
+ }
+
+ @Override
+ protected Map<Class<? extends Annotation>, Set<Annotation>> delegate()
+ {
+ return delegate;
+ }
+
+ /**
+ * Gets the set of annotations matching the given annotation type
+ *
+ * @param key The meta-annotation to match
+ * @returns The set of matching annotations containing this
+ * meta-annotation
+ */
+ @Override
+ public Set<Annotation> get(Object key)
+ {
+ Set<Annotation> annotations = super.get(key);
+ return annotations != null ? annotations : new HashSet<Annotation>();
+ }
+
+ /**
+ * Adds an annotation under the meta-annotation type key
+ *
+ * @param key The meta-annotation type
+ * @param value The annotation
+ */
+ public void put(Class<? extends Annotation> key, Annotation value)
+ {
+ Set<Annotation> annotations = super.get(key);
+ if (annotations == null)
+ {
+ annotations = new HashSet<Annotation>();
+ super.put(key, annotations);
+ }
+ annotations.add(value);
+ }
+
+ /**
+ * Gets a string representation of the Map
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ return Strings.mapToString("MetaAnnotationMap (annotation type -> annotation set: ", delegate);
+ }
+
+ }
+
+ /**
+ * Builds the annotation map (annotation type -> annotation)
+ *
+ * @param annotations The array of annotations to map
+ * @return The annotation map
+ */
+ protected static AnnotationMap buildAnnotationMap(Annotation[] annotations)
+ {
+ AnnotationMap annotationMap = new AnnotationMap();
+ for (Annotation annotation : annotations)
+ {
+ annotationMap.put(annotation.annotationType(), annotation);
+ }
+ return annotationMap;
+ }
+
+ /**
+ * Builds the annotation map (annotation type -> annotation)
+ *
+ * @param annotations The array of annotations to map
+ * @return The annotation map
+ */
+ protected static AnnotationMap buildAnnotationMap(Iterable<Annotation> annotations)
+ {
+ AnnotationMap annotationMap = new AnnotationMap();
+ for (Annotation annotation : annotations)
+ {
+ annotationMap.put(annotation.annotationType(), annotation);
+ }
+ return annotationMap;
+ }
+
+ /**
+ * Build an AnnotatedItemHelper from a class
+ *
+ * @param annotatedElement
+ * @return
+ */
+ public static AnnotationStore of(AnnotatedElement annotatedElement)
+ {
+ return new AnnotationStore(buildAnnotationMap(annotatedElement.getAnnotations()), buildAnnotationMap(annotatedElement.getDeclaredAnnotations()));
+ }
+
+ public static AnnotationStore of(Annotation[] annotations, Annotation[] declaredAnnotations)
+ {
+ return new AnnotationStore(buildAnnotationMap(annotations), buildAnnotationMap(declaredAnnotations));
+ }
+
+ public static AnnotationStore wrap(AnnotationStore annotationStore, Set<Annotation> annotations, Set<Annotation> declaredAnnotations)
+ {
+ AnnotationMap annotationMap = new AnnotationMap();
+ annotationMap.putAll(buildAnnotationMap(annotations));
+ annotationMap.putAll(annotationStore.getAnnotationMap());
+
+ AnnotationMap declaredAnnotationMap = new AnnotationMap();
+ declaredAnnotationMap.putAll(buildAnnotationMap(declaredAnnotations));
+ declaredAnnotationMap.putAll(annotationStore.getDeclaredAnnotationMap());
+
+ return new AnnotationStore(annotationMap, declaredAnnotationMap);
+ }
+
+ // The annotation map (annotation type -> annotation) of the item
+ private final AnnotationMap annotationMap;
+ // The meta-annotation map (annotation type -> set of annotations containing
+ // meta-annotation) of the item
+ private final MetaAnnotationMap metaAnnotationMap;
+ // The set of all annotations on the item
+ private final Set<Annotation> annotationSet;
+
+ // The annotation map (annotation type -> annotation) of the item
+ private final AnnotationMap declaredAnnotationMap;
+ // The meta-annotation map (annotation type -> set of annotations containing
+ // meta-annotation) of the item
+ private final MetaAnnotationMap declaredMetaAnnotationMap;
+ // The set of all annotations on the item
+ private final Set<Annotation> declaredAnnotationSet;
+
+ /**
+ * Constructor
+ *
+ * Also builds the meta-annotation map. Throws a NullPointerException if
+ * trying to register a null map
+ *
+ * @param annotationMap A map of annotation to register
+ *
+ */
+ protected AnnotationStore(AnnotationMap annotationMap, AnnotationMap declaredAnnotationMap)
+ {
+ if (annotationMap == null)
+ {
+ throw new NullPointerException("annotationMap cannot be null");
+ }
+ this.annotationMap = annotationMap;
+ this.annotationSet = new HashSet<Annotation>();
+ this.metaAnnotationMap = new MetaAnnotationMap();
+ for (Annotation annotation : annotationMap.values())
+ {
+ for (Annotation metaAnnotation : annotation.annotationType().getAnnotations())
+ {
+ // Only map meta-annotations we are interested in
+ if (MAPPED_METAANNOTATIONS.contains(metaAnnotation.annotationType()))
+ {
+ metaAnnotationMap.put(metaAnnotation.annotationType(), annotation);
+ }
+ }
+ annotationSet.add(annotation);
+ }
+
+ if (declaredAnnotationMap == null)
+ {
+ throw new NullPointerException("declaredAnnotationMap cannot be null");
+ }
+ this.declaredAnnotationMap = declaredAnnotationMap;
+ this.declaredAnnotationSet = new HashSet<Annotation>();
+ this.declaredMetaAnnotationMap = new MetaAnnotationMap();
+ for (Annotation annotation : declaredAnnotationMap.values())
+ {
+ for (Annotation metaAnnotation : annotation.annotationType().getAnnotations())
+ {
+ // Only map meta-annotations we are interested in
+ if (MAPPED_METAANNOTATIONS.contains(metaAnnotation.annotationType()))
+ {
+ declaredMetaAnnotationMap.put(metaAnnotation.annotationType(), annotation);
+ }
+ }
+ declaredAnnotationSet.add(annotation);
+ }
+ }
+
+ public Set<Annotation> getAnnotations()
+ {
+ return Collections.unmodifiableSet(annotationSet);
+ }
+
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return Collections.unmodifiableSet(metaAnnotationMap.get(metaAnnotationType));
+ }
+
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return Collections.unmodifiableSet(declaredMetaAnnotationMap.get(metaAnnotationType));
+ }
+
+ public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getMetaAnnotations(metaAnnotationType).toArray(EMPTY_ANNOTATION_ARRAY);
+ }
+
+ @Deprecated
+ public Set<Annotation> getBindingTypes()
+ {
+ if (getMetaAnnotations(BindingType.class).size() > 0)
+ {
+ return Collections.unmodifiableSet(getMetaAnnotations(BindingType.class));
+ }
+ else
+ {
+ return Collections.unmodifiableSet(DEFAULT_BINDING);
+ }
+ }
+
+ @Deprecated
+ public Annotation[] getBindingTypesAsArray()
+ {
+ return getBindingTypes().toArray(EMPTY_ANNOTATION_ARRAY);
+ }
+
+ public <A extends Annotation> A getAnnotation(Class<? extends A> annotationType)
+ {
+ return annotationType.cast(annotationMap.get(annotationType));
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return annotationMap.containsKey(annotationType);
+ }
+
+ AnnotationMap getAnnotationMap()
+ {
+ return annotationMap;
+ }
+
+ AnnotationMap getDeclaredAnnotationMap()
+ {
+ return declaredAnnotationMap;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -45,15 +45,15 @@
*/
public <A extends Annotation> A getAnnotation(Class<? extends A> annotationType)
{
- return delegate().getAnnotation(annotationType);
+ return getAnnotationStore().getAnnotation(annotationType);
}
/**
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
- public <A extends Annotation> Set<A> getAnnotations()
+ public Set<Annotation> getAnnotations()
{
- return delegate().getAnnotations();
+ return getAnnotationStore().getAnnotations();
}
/**
@@ -61,7 +61,7 @@
*/
public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
{
- return delegate().getMetaAnnotations(metaAnnotationType);
+ return getAnnotationStore().getMetaAnnotations(metaAnnotationType);
}
/**
@@ -69,23 +69,25 @@
*/
public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
{
- return delegate().getMetaAnnotationsAsArray(metaAnnotationType);
+ return getAnnotationStore().getMetaAnnotationsAsArray(metaAnnotationType);
}
/**
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
+ @Deprecated
public Set<Annotation> getBindingTypes()
{
- return delegate().getBindingTypes();
+ return getAnnotationStore().getBindingTypes();
}
/**
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
+ @Deprecated
public Annotation[] getBindingTypesAsArray()
{
- return delegate().getBindingTypesAsArray();
+ return getAnnotationStore().getBindingTypesAsArray();
}
/**
@@ -109,7 +111,7 @@
*/
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
{
- return delegate().isAnnotationPresent(annotationType);
+ return getAnnotationStore().isAnnotationPresent(annotationType);
}
/**
@@ -192,7 +194,7 @@
public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
{
- return delegate().getDeclaredMetaAnnotations(metaAnnotationType);
+ return getAnnotationStore().getDeclaredMetaAnnotations(metaAnnotationType);
}
/**
@@ -202,9 +204,9 @@
*/
protected abstract AnnotatedItem<T, S> delegate();
- public AnnotatedItem<T, S> wrap(Set<Annotation> annotations)
+ public AnnotationStore getAnnotationStore()
{
- throw new UnsupportedOperationException();
+ return delegate().getAnnotationStore();
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMember.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMember.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMember.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -1,8 +1,6 @@
package org.jboss.webbeans.introspector;
-import java.lang.annotation.Annotation;
import java.lang.reflect.Member;
-import java.util.Set;
public abstract class ForwardingAnnotatedMember<T, S extends Member> extends ForwardingAnnotatedItem<T, S> implements AnnotatedMember<T, S>
{
@@ -15,10 +13,4 @@
return delegate().getMember();
}
- @Override
- public AnnotatedMember<T, S> wrap(Set<Annotation> annotations)
- {
- throw new UnsupportedOperationException();
- }
-
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedType.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedType.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedType.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -1,7 +1,5 @@
package org.jboss.webbeans.introspector;
-import java.lang.annotation.Annotation;
-import java.util.Set;
@@ -21,10 +19,4 @@
return delegate().isEquivalent(clazz);
}
- @Override
- public AnnotatedType<T> wrap(Set<Annotation> annotations)
- {
- throw new UnsupportedOperationException();
- }
-
}
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -0,0 +1,30 @@
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+public class WrappedAnnotatedField<T> extends ForwardingAnnotatedField<T>
+{
+
+ private final AnnotatedField<T> delegate;
+ private AnnotationStore annotationStore;
+
+ public WrappedAnnotatedField(AnnotatedField<T> field, Set<Annotation> extraAnnotations)
+ {
+ this.delegate = field;
+ this.annotationStore = AnnotationStore.wrap(field.getAnnotationStore(), extraAnnotations, extraAnnotations);
+ }
+
+ @Override
+ protected AnnotatedField<T> delegate()
+ {
+ return delegate;
+ }
+
+ @Override
+ public AnnotationStore getAnnotationStore()
+ {
+ return annotationStore;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java (rev 0)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -0,0 +1,30 @@
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+public class WrappedAnnotatedMethod<T> extends ForwardingAnnotatedMethod<T>
+{
+
+ private final AnnotatedMethod<T> delegate;
+ private AnnotationStore annotationStore;
+
+ public WrappedAnnotatedMethod(AnnotatedMethod<T> method, Set<Annotation> extraAnnotations)
+ {
+ this.delegate = method;
+ this.annotationStore = AnnotationStore.wrap(method.getAnnotationStore(), extraAnnotations, extraAnnotations);
+ }
+
+ @Override
+ protected AnnotatedMethod<T> delegate()
+ {
+ return delegate;
+ }
+
+ @Override
+ public AnnotationStore getAnnotationStore()
+ {
+ return annotationStore;
+ }
+
+}
Property changes on: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -23,6 +23,7 @@
import java.util.Set;
import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.util.Proxies;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.Types;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -34,6 +34,7 @@
import org.jboss.webbeans.injection.InjectionPointProvider;
import org.jboss.webbeans.introspector.AnnotatedMember;
import org.jboss.webbeans.introspector.AnnotatedParameter;
+import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.introspector.ForwardingAnnotatedMember;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.Strings;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -20,6 +20,7 @@
import java.lang.reflect.Modifier;
import org.jboss.webbeans.introspector.AnnotatedClass;
+import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.util.Reflections;
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -28,6 +28,7 @@
import org.jboss.webbeans.introspector.AnnotatedAnnotation;
import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.util.Strings;
import com.google.common.collect.ForwardingMap;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -37,6 +37,7 @@
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.Strings;
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -32,6 +32,7 @@
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.AnnotatedType;
+import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.util.Names;
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -17,17 +17,15 @@
package org.jboss.webbeans.introspector.jlr;
-import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
-import java.util.Set;
import javax.webbeans.manager.Manager;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedType;
-import org.jboss.webbeans.introspector.ForwardingAnnotatedField;
+import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
@@ -190,72 +188,5 @@
toString = "Annotated field " + Names.field2String(field);
return toString;
}
-
- public AnnotatedField<T> wrap(Set<Annotation> annotations)
- {
- if (annotations.size() > 0)
- {
- final AnnotatedField<T> delegate = this;
- final AnnotationStore annotationStore = AnnotationStore.wrap(getAnnotationStore(), annotations, annotations);
- return new ForwardingAnnotatedField<T>()
- {
-
- @Override
- protected AnnotatedField<T> delegate()
- {
- return delegate;
- }
-
- @Override
- public <A extends Annotation> A getAnnotation(Class<? extends A> annotationType)
- {
- return annotationStore.getAnnotation(annotationType);
- }
-
- @Override
- public Set<Annotation> getAnnotations()
- {
- return annotationStore.getAnnotations();
- }
-
- @Override
- @Deprecated
- public Set<Annotation> getBindingTypes()
- {
- return annotationStore.getBindingTypes();
- }
-
- @Override
- @Deprecated
- public Annotation[] getBindingTypesAsArray()
- {
- return annotationStore.getBindingTypesAsArray();
- }
-
- @Override
- public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return annotationStore.getDeclaredMetaAnnotations(metaAnnotationType);
- }
-
- @Override
- public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return annotationStore.getMetaAnnotations(metaAnnotationType);
- }
-
- @Override
- public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
- {
- return annotationStore.getMetaAnnotationsAsArray(metaAnnotationType);
- }
-
- };
- }
- else
- {
- return this;
- }
- }
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -25,13 +25,12 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
-import java.util.Set;
import org.jboss.webbeans.ManagerImpl;
import org.jboss.webbeans.introspector.AnnotatedMethod;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.AnnotatedType;
-import org.jboss.webbeans.introspector.ForwardingAnnotatedMethod;
+import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
@@ -328,73 +327,6 @@
toString = "Annotated method " + Names.method2String(method);
return toString;
}
-
- public AnnotatedMethod<T> wrap(Set<Annotation> annotations)
- {
- if (annotations.size() > 0)
- {
- final AnnotatedMethod<T> delegate = this;
- final AnnotationStore annotationStore = AnnotationStore.wrap(getAnnotationStore(), annotations, annotations);
- return new ForwardingAnnotatedMethod<T>()
- {
-
- @Override
- protected AnnotatedMethod<T> delegate()
- {
- return delegate;
- }
-
- @Override
- public <A extends Annotation> A getAnnotation(Class<? extends A> annotationType)
- {
- return annotationStore.getAnnotation(annotationType);
- }
-
- @Override
- public Set<Annotation> getAnnotations()
- {
- return annotationStore.getAnnotations();
- }
-
- @Override
- @Deprecated
- public Set<Annotation> getBindingTypes()
- {
- return annotationStore.getBindingTypes();
- }
-
- @Override
- @Deprecated
- public Annotation[] getBindingTypesAsArray()
- {
- return annotationStore.getBindingTypesAsArray();
- }
-
- @Override
- public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return annotationStore.getDeclaredMetaAnnotations(metaAnnotationType);
- }
-
- @Override
- public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return annotationStore.getMetaAnnotations(metaAnnotationType);
- }
-
- @Override
- public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
- {
- return annotationStore.getMetaAnnotationsAsArray(metaAnnotationType);
- }
-
- };
- }
- else
- {
- return this;
- }
- }
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -26,6 +26,7 @@
import org.jboss.webbeans.introspector.AnnotatedMember;
import org.jboss.webbeans.introspector.AnnotatedParameter;
+import org.jboss.webbeans.introspector.AnnotationStore;
/**
* Represents a parameter
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotationStore.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotationStore.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotationStore.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -1,315 +0,0 @@
-package org.jboss.webbeans.introspector.jlr;
-
-import static org.jboss.webbeans.introspector.AnnotatedItem.MAPPED_METAANNOTATIONS;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AnnotatedElement;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.webbeans.BindingType;
-
-import org.jboss.webbeans.literal.CurrentLiteral;
-import org.jboss.webbeans.util.Strings;
-
-import com.google.common.collect.ForwardingMap;
-
-public class AnnotationStore
-{
-
- // The array of default binding types
- private static final Annotation[] DEFAULT_BINDING_ARRAY = { new CurrentLiteral() };
- // The set of default binding types
- private static final Set<Annotation> DEFAULT_BINDING = new HashSet<Annotation>(Arrays.asList(DEFAULT_BINDING_ARRAY));
-
- private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
-
- /**
- * Represents a mapping from a annotation type to an annotation
- * implementation
- */
- public static class AnnotationMap extends ForwardingMap<Class<? extends Annotation>, Annotation>
- {
- private final Map<Class<? extends Annotation>, Annotation> delegate;
-
- public AnnotationMap()
- {
- delegate = new HashMap<Class<? extends Annotation>, Annotation>();
- }
-
- @Override
- protected Map<Class<? extends Annotation>, Annotation> delegate()
- {
- return delegate;
- }
-
- /**
- * Gets a string representation of the Map
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- return Strings.mapToString("AnnotationMap (annotation type -> annotation): ", delegate);
- }
-
- }
-
- /**
- * Represents a mapping from a annotation (meta-annotation) to a set of
- * annotations
- *
- */
- private static class MetaAnnotationMap extends ForwardingMap<Class<? extends Annotation>, Set<Annotation>>
- {
- private final Map<Class<? extends Annotation>, Set<Annotation>> delegate;
-
- public MetaAnnotationMap()
- {
- delegate = new HashMap<Class<? extends Annotation>, Set<Annotation>>();
- }
-
- @Override
- protected Map<Class<? extends Annotation>, Set<Annotation>> delegate()
- {
- return delegate;
- }
-
- /**
- * Gets the set of annotations matching the given annotation type
- *
- * @param key The meta-annotation to match
- * @returns The set of matching annotations containing this
- * meta-annotation
- */
- @Override
- public Set<Annotation> get(Object key)
- {
- Set<Annotation> annotations = super.get(key);
- return annotations != null ? annotations : new HashSet<Annotation>();
- }
-
- /**
- * Adds an annotation under the meta-annotation type key
- *
- * @param key The meta-annotation type
- * @param value The annotation
- */
- public void put(Class<? extends Annotation> key, Annotation value)
- {
- Set<Annotation> annotations = super.get(key);
- if (annotations == null)
- {
- annotations = new HashSet<Annotation>();
- super.put(key, annotations);
- }
- annotations.add(value);
- }
-
- /**
- * Gets a string representation of the Map
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- return Strings.mapToString("MetaAnnotationMap (annotation type -> annotation set: ", delegate);
- }
-
- }
-
- /**
- * Builds the annotation map (annotation type -> annotation)
- *
- * @param annotations The array of annotations to map
- * @return The annotation map
- */
- protected static AnnotationMap buildAnnotationMap(Annotation[] annotations)
- {
- AnnotationMap annotationMap = new AnnotationMap();
- for (Annotation annotation : annotations)
- {
- annotationMap.put(annotation.annotationType(), annotation);
- }
- return annotationMap;
- }
-
- /**
- * Builds the annotation map (annotation type -> annotation)
- *
- * @param annotations The array of annotations to map
- * @return The annotation map
- */
- protected static AnnotationMap buildAnnotationMap(Iterable<Annotation> annotations)
- {
- AnnotationMap annotationMap = new AnnotationMap();
- for (Annotation annotation : annotations)
- {
- annotationMap.put(annotation.annotationType(), annotation);
- }
- return annotationMap;
- }
-
- /**
- * Build an AnnotatedItemHelper from a class
- *
- * @param annotatedElement
- * @return
- */
- public static AnnotationStore of(AnnotatedElement annotatedElement)
- {
- return new AnnotationStore(buildAnnotationMap(annotatedElement.getAnnotations()), buildAnnotationMap(annotatedElement.getDeclaredAnnotations()));
- }
-
- public static AnnotationStore of(Annotation[] annotations, Annotation[] declaredAnnotations)
- {
- return new AnnotationStore(buildAnnotationMap(annotations), buildAnnotationMap(declaredAnnotations));
- }
-
- public static AnnotationStore wrap(AnnotationStore annotationStore, Set<Annotation> annotations, Set<Annotation> declaredAnnotations)
- {
- AnnotationMap annotationMap = new AnnotationMap();
- annotationMap.putAll(buildAnnotationMap(annotations));
- annotationMap.putAll(annotationStore.getAnnotationMap());
-
- AnnotationMap declaredAnnotationMap = new AnnotationMap();
- declaredAnnotationMap.putAll(buildAnnotationMap(declaredAnnotations));
- declaredAnnotationMap.putAll(annotationStore.getDeclaredAnnotationMap());
-
- return new AnnotationStore(annotationMap, declaredAnnotationMap);
- }
-
- // The annotation map (annotation type -> annotation) of the item
- private final AnnotationMap annotationMap;
- // The meta-annotation map (annotation type -> set of annotations containing
- // meta-annotation) of the item
- private final MetaAnnotationMap metaAnnotationMap;
- // The set of all annotations on the item
- private final Set<Annotation> annotationSet;
-
- // The annotation map (annotation type -> annotation) of the item
- private final AnnotationMap declaredAnnotationMap;
- // The meta-annotation map (annotation type -> set of annotations containing
- // meta-annotation) of the item
- private final MetaAnnotationMap declaredMetaAnnotationMap;
- // The set of all annotations on the item
- private final Set<Annotation> declaredAnnotationSet;
-
- /**
- * Constructor
- *
- * Also builds the meta-annotation map. Throws a NullPointerException if
- * trying to register a null map
- *
- * @param annotationMap A map of annotation to register
- *
- */
- protected AnnotationStore(AnnotationMap annotationMap, AnnotationMap declaredAnnotationMap)
- {
- if (annotationMap == null)
- {
- throw new NullPointerException("annotationMap cannot be null");
- }
- this.annotationMap = annotationMap;
- this.annotationSet = new HashSet<Annotation>();
- this.metaAnnotationMap = new MetaAnnotationMap();
- for (Annotation annotation : annotationMap.values())
- {
- for (Annotation metaAnnotation : annotation.annotationType().getAnnotations())
- {
- // Only map meta-annotations we are interested in
- if (MAPPED_METAANNOTATIONS.contains(metaAnnotation.annotationType()))
- {
- metaAnnotationMap.put(metaAnnotation.annotationType(), annotation);
- }
- }
- annotationSet.add(annotation);
- }
-
- if (declaredAnnotationMap == null)
- {
- throw new NullPointerException("declaredAnnotationMap cannot be null");
- }
- this.declaredAnnotationMap = declaredAnnotationMap;
- this.declaredAnnotationSet = new HashSet<Annotation>();
- this.declaredMetaAnnotationMap = new MetaAnnotationMap();
- for (Annotation annotation : declaredAnnotationMap.values())
- {
- for (Annotation metaAnnotation : annotation.annotationType().getAnnotations())
- {
- // Only map meta-annotations we are interested in
- if (MAPPED_METAANNOTATIONS.contains(metaAnnotation.annotationType()))
- {
- declaredMetaAnnotationMap.put(metaAnnotation.annotationType(), annotation);
- }
- }
- declaredAnnotationSet.add(annotation);
- }
- }
-
- public Set<Annotation> getAnnotations()
- {
- return Collections.unmodifiableSet(annotationSet);
- }
-
- public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return Collections.unmodifiableSet(metaAnnotationMap.get(metaAnnotationType));
- }
-
- public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return Collections.unmodifiableSet(declaredMetaAnnotationMap.get(metaAnnotationType));
- }
-
- public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
- {
- return getMetaAnnotations(metaAnnotationType).toArray(EMPTY_ANNOTATION_ARRAY);
- }
-
- @Deprecated
- public Set<Annotation> getBindingTypes()
- {
- if (getMetaAnnotations(BindingType.class).size() > 0)
- {
- return Collections.unmodifiableSet(getMetaAnnotations(BindingType.class));
- }
- else
- {
- return Collections.unmodifiableSet(DEFAULT_BINDING);
- }
- }
-
- @Deprecated
- public Annotation[] getBindingTypesAsArray()
- {
- return getBindingTypes().toArray(EMPTY_ANNOTATION_ARRAY);
- }
-
- public <A extends Annotation> A getAnnotation(Class<? extends A> annotationType)
- {
- return annotationType.cast(annotationMap.get(annotationType));
- }
-
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
- {
- return annotationMap.containsKey(annotationType);
- }
-
- public AnnotationMap getAnnotationMap()
- {
- return annotationMap;
- }
-
- public AnnotationMap getDeclaredAnnotationMap()
- {
- return declaredAnnotationMap;
- }
-
-}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/MergedStereotypes.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/MergedStereotypes.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/model/MergedStereotypes.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -22,7 +22,7 @@
import java.util.Set;
import org.jboss.webbeans.MetaDataCache;
-import org.jboss.webbeans.introspector.jlr.AnnotationStore.AnnotationMap;
+import org.jboss.webbeans.introspector.AnnotationStore.AnnotationMap;
/**
* Meta model for the merged stereotype for a bean
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java 2009-01-20 23:32:58 UTC (rev 1134)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java 2009-01-21 01:06:31 UTC (rev 1135)
@@ -37,7 +37,7 @@
assert manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getScopeType().equals(RequestScoped.class);
}
- @Test(groups="broken") @SpecAssertion(section="4.1")
+ @Test @SpecAssertion(section="4.1")
public void testRealizedBeanWithProducerMethodHasDeploymentTypeOfRealizingClass()
{
deployBeans(Cow.class);
@@ -85,12 +85,12 @@
assert manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getScopeType().equals(RequestScoped.class);
}
- @Test(groups="broken") @SpecAssertion(section="4.1")
+ @Test @SpecAssertion(section="4.1")
public void testRealizedBeanWithProducerFieldHasDeploymentTypeOfRealizingClass()
{
deployBeans(Horse.class);
- assert manager.resolveByType(Dung.class).size() == 1;
- assert manager.resolveByType(Dung.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).size() == 1;
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
@Test @SpecAssertion(section="4.1")
16 years, 8 months
[webbeans-commits] Webbeans SVN: r1134 - tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization and 1 other directory.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-20 18:32:58 -0500 (Tue, 20 Jan 2009)
New Revision: 1134
Removed:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedAnnotation.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedClass.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedConstructor.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedField.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedMember.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedMethod.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedParameter.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedType.java
Modified:
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotationStore.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java
Log:
More realiziation fixes
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -20,14 +20,9 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Type;
import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
import java.util.Set;
-import javax.webbeans.BindingType;
-
import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.literal.CurrentLiteral;
import org.jboss.webbeans.util.Proxies;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.Types;
@@ -46,7 +41,7 @@
*
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
-public abstract class AbstractAnnotatedItem<T, S> implements WrappableAnnotatedItem<T, S>
+public abstract class AbstractAnnotatedItem<T, S> implements AnnotatedItem<T, S>
{
interface WrappableAnnotatedItem<T, S> extends AnnotatedItem<T, S>
@@ -56,11 +51,8 @@
}
- // The array of default binding types
- private static final Annotation[] DEFAULT_BINDING_ARRAY = { new CurrentLiteral() };
- // The set of default binding types
- private static final Set<Annotation> DEFAULT_BINDING = new HashSet<Annotation>(Arrays.asList(DEFAULT_BINDING_ARRAY));
+
// Cached string representation
private String toString;
private final AnnotationStore annotationStore;
@@ -84,67 +76,29 @@
return annotationStore;
}
- /**
- * Gets the annotation for a given annotation type.
- *
- * @param annotationType the annotation type to match
- * @return The annotation if found, null if no match was found
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#getAnnotation(Class)
- */
public <A extends Annotation> A getAnnotation(Class<? extends A> annotationType)
{
- return annotationType.cast(getAnnotationStore().getAnnotationMap().get(annotationType));
+ return getAnnotationStore().getAnnotation(annotationType);
}
- /**
- * Gets the set of annotations that contain a given annotation type
- *
- * @param metaAnnotationType The meta-annotation type to match
- * @return The set of annotations containing this meta-annotation. An empty
- * set is returned if no match is found.
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#getMetaAnnotations(Class)
- */
public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
{
- return Collections.unmodifiableSet(getAnnotationStore().getMetaAnnotationMap().get(metaAnnotationType));
+ return getAnnotationStore().getMetaAnnotations(metaAnnotationType);
}
public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
{
- return Collections.unmodifiableSet(getAnnotationStore().getDeclaredMetaAnnotationMap().get(metaAnnotationType));
+ return getAnnotationStore().getDeclaredMetaAnnotations(metaAnnotationType);
}
- /**
- * Gets (as an array) the set of annotations that contain a given annotation
- * type.
- *
- * Populates the annotationArray if it was null
- *
- * @param metaAnnotationType meta-annotation type to match
- * @return The array of annotations to match. An empty array is returned if
- * no match is found.
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#getMetaAnnotationsAsArray(Class)
- */
public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
{
return getMetaAnnotations(metaAnnotationType).toArray(new Annotation[0]);
}
- /**
- * Gets all annotations on this item
- *
- * Populates the annotationSet if it was empty
- *
- * @return The set of annotations on this item.
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#getAnnotations()
- */
public Set<Annotation> getAnnotations()
{
- return getAnnotationStore().getAnnotationSet();
+ return getAnnotationStore().getAnnotations();
}
/**
@@ -157,7 +111,7 @@
*/
public boolean isAnnotationPresent(Class<? extends Annotation> annotatedType)
{
- return getAnnotationStore().getAnnotationMap().containsKey(annotatedType);
+ return getAnnotationStore().isAnnotationPresent(annotatedType);
}
/**
@@ -258,26 +212,10 @@
return toString;
}
- /**
- * Gets the binding types of the item
- *
- * Looks at the meta-annotations map for annotations with binding type
- * meta-annotation. Returns default binding (current) if none specified.
- *
- * @return A set of (binding type) annotations
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#getBindingTypes()
- */
+ @Deprecated
public Set<Annotation> getBindingTypes()
{
- if (getMetaAnnotations(BindingType.class).size() > 0)
- {
- return Collections.unmodifiableSet(getMetaAnnotations(BindingType.class));
- }
- else
- {
- return Collections.unmodifiableSet(DEFAULT_BINDING);
- }
+ return getAnnotationStore().getBindingTypes();
}
/**
@@ -290,16 +228,10 @@
*
* @see org.jboss.webbeans.introspector.AnnotatedItem#getBindingTypesAsArray()
*/
+ @Deprecated
public Annotation[] getBindingTypesAsArray()
{
- if (getMetaAnnotationsAsArray(BindingType.class).length > 0)
- {
- return getMetaAnnotationsAsArray(BindingType.class);
- }
- else
- {
- return DEFAULT_BINDING_ARRAY;
- }
+ return getAnnotationStore().getBindingTypesAsArray();
}
/**
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -28,7 +28,6 @@
import org.jboss.webbeans.introspector.AnnotatedAnnotation;
import org.jboss.webbeans.introspector.AnnotatedMethod;
-import org.jboss.webbeans.introspector.ForwardingAnnotatedAnnotation;
import org.jboss.webbeans.util.Strings;
import com.google.common.collect.ForwardingMap;
@@ -42,20 +41,8 @@
*
* @param <T>
*/
-public class AnnotatedAnnotationImpl<T extends Annotation> extends AbstractAnnotatedType<T> implements AnnotatedAnnotation<T>, WrappableAnnotatedAnnotation<T>
+public class AnnotatedAnnotationImpl<T extends Annotation> extends AbstractAnnotatedType<T> implements AnnotatedAnnotation<T>
{
-
- abstract static class ForwardingWrappableAnnotatedAnnotation<T extends Annotation> extends ForwardingAnnotatedAnnotation<T> implements WrappableAnnotatedType<T>
- {
-
- @Override
- protected abstract WrappableAnnotatedAnnotation<T> delegate();
-
- public AnnotationStore getAnnotationStore()
- {
- return delegate().getAnnotationStore();
- }
- }
/**
* A (annotation type -> set of method abstractions with annotation) map
@@ -208,17 +195,7 @@
public AnnotatedAnnotation<T> wrap(Set<Annotation> annotations)
{
- final WrappableAnnotatedAnnotation<T> delegate = this;
- return new ForwardingWrappableAnnotatedAnnotation<T>()
- {
-
- @Override
- protected WrappableAnnotatedAnnotation<T> delegate()
- {
- return delegate;
- }
-
- };
+ throw new UnsupportedOperationException();
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -37,7 +37,6 @@
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedField;
import org.jboss.webbeans.introspector.AnnotatedMethod;
-import org.jboss.webbeans.introspector.ForwardingAnnotatedClass;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.Strings;
@@ -53,22 +52,9 @@
*
* @param <T>
*/
-public class AnnotatedClassImpl<T> extends AbstractAnnotatedType<T> implements AnnotatedClass<T>, WrappableAnnotatedClass<T>
+public class AnnotatedClassImpl<T> extends AbstractAnnotatedType<T> implements AnnotatedClass<T>
{
- abstract static class ForwardingWrappableAnnotatedClass<T> extends ForwardingAnnotatedClass<T> implements WrappableAnnotatedClass<T>
- {
-
- @Override
- protected abstract WrappableAnnotatedClass<T> delegate();
-
-
- public AnnotationStore getAnnotationStore()
- {
- return delegate().getAnnotationStore();
- }
- }
-
/**
* A (annotation type -> set of field abstractions with annotation/meta
* annotation) map
@@ -629,17 +615,7 @@
public AnnotatedClass<T> wrap(Set<Annotation> annotations)
{
- final WrappableAnnotatedClass<T> delegate = this;
- return new ForwardingWrappableAnnotatedClass<T>()
- {
-
- @Override
- protected WrappableAnnotatedClass<T> delegate()
- {
- return delegate;
- }
-
- };
+ throw new UnsupportedOperationException();
}
}
\ No newline at end of file
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -32,7 +32,6 @@
import org.jboss.webbeans.introspector.AnnotatedConstructor;
import org.jboss.webbeans.introspector.AnnotatedParameter;
import org.jboss.webbeans.introspector.AnnotatedType;
-import org.jboss.webbeans.introspector.ForwardingAnnotatedConstructor;
import org.jboss.webbeans.util.Names;
/**
@@ -44,22 +43,9 @@
*
* @param <T>
*/
-public class AnnotatedConstructorImpl<T> extends AbstractAnnotatedMember<T, Constructor<T>> implements WrappableAnnotatedConstructor<T>
+public class AnnotatedConstructorImpl<T> extends AbstractAnnotatedMember<T, Constructor<T>> implements AnnotatedConstructor<T>
{
- static abstract class ForwardingWrappableAnnotatedConstructor<T> extends ForwardingAnnotatedConstructor<T> implements WrappableAnnotatedConstructor<T>
- {
-
- @Override
- protected abstract WrappableAnnotatedConstructor<T> delegate();
-
- public AnnotationStore getAnnotationStore()
- {
- // TODO Auto-generated method stub
- return null;
- }
-
- }
// The type arguments
private static final Type[] actualTypeArguments = new Type[0];
@@ -286,19 +272,9 @@
return toString;
}
- public WrappableAnnotatedConstructor<T> wrap(Set<Annotation> annotations)
+ public AnnotatedConstructor<T> wrap(Set<Annotation> annotations)
{
- final WrappableAnnotatedConstructor<T> delegate = this;
- return new ForwardingWrappableAnnotatedConstructor<T>()
- {
-
- @Override
- protected WrappableAnnotatedConstructor<T> delegate()
- {
- return delegate;
- }
-
- };
+ throw new UnsupportedOperationException();
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -40,22 +40,9 @@
*
* @param <T>
*/
-public class AnnotatedFieldImpl<T> extends AbstractAnnotatedMember<T, Field> implements WrappableAnnotatedField<T>
+public class AnnotatedFieldImpl<T> extends AbstractAnnotatedMember<T, Field> implements AnnotatedField<T>
{
- static abstract class ForwardingWrappableAnnotatedField<T> extends ForwardingAnnotatedField<T> implements WrappableAnnotatedField<T>
- {
-
- @Override
- protected abstract WrappableAnnotatedField<T> delegate();
-
- public AnnotationStore getAnnotationStore()
- {
- return delegate().getAnnotationStore();
- }
-
- }
-
// The actual type arguments
private final Type[] actualTypeArguments;
// The underlying field
@@ -208,23 +195,61 @@
{
if (annotations.size() > 0)
{
- final WrappableAnnotatedField<T> delegate = this;
+ final AnnotatedField<T> delegate = this;
final AnnotationStore annotationStore = AnnotationStore.wrap(getAnnotationStore(), annotations, annotations);
- return new ForwardingWrappableAnnotatedField<T>()
+ return new ForwardingAnnotatedField<T>()
{
@Override
- protected WrappableAnnotatedField<T> delegate()
+ protected AnnotatedField<T> delegate()
{
return delegate;
}
@Override
- public AnnotationStore getAnnotationStore()
+ public <A extends Annotation> A getAnnotation(Class<? extends A> annotationType)
{
- return annotationStore;
+ return annotationStore.getAnnotation(annotationType);
}
+ @Override
+ public Set<Annotation> getAnnotations()
+ {
+ return annotationStore.getAnnotations();
+ }
+
+ @Override
+ @Deprecated
+ public Set<Annotation> getBindingTypes()
+ {
+ return annotationStore.getBindingTypes();
+ }
+
+ @Override
+ @Deprecated
+ public Annotation[] getBindingTypesAsArray()
+ {
+ return annotationStore.getBindingTypesAsArray();
+ }
+
+ @Override
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return annotationStore.getDeclaredMetaAnnotations(metaAnnotationType);
+ }
+
+ @Override
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return annotationStore.getMetaAnnotations(metaAnnotationType);
+ }
+
+ @Override
+ public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
+ {
+ return annotationStore.getMetaAnnotationsAsArray(metaAnnotationType);
+ }
+
};
}
else
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -44,21 +44,8 @@
*
* @param <T>
*/
-public class AnnotatedMethodImpl<T> extends AbstractAnnotatedMember<T, Method> implements AnnotatedMethod<T>, WrappableAnnotatedMethod<T>
+public class AnnotatedMethodImpl<T> extends AbstractAnnotatedMember<T, Method> implements AnnotatedMethod<T>
{
-
- abstract static class ForwardingWrappableAnnotatedMethod<T> extends ForwardingAnnotatedMethod<T> implements WrappableAnnotatedMethod<T>
- {
-
- @Override
- protected abstract WrappableAnnotatedMethod<T> delegate();
-
- public AnnotationStore getAnnotationStore()
- {
- return delegate().getAnnotationStore();
- }
-
- }
// The actual type arguments
private final Type[] actualTypeArguments;
@@ -84,23 +71,7 @@
{
return new AnnotatedMethodImpl<T>(method, declaringClass);
}
-
- public static <T> AnnotatedMethod<T> wrap(final AnnotatedMethod<T> annotatedMethod, final Set<Annotation> extraAnnotations)
- {
- return new ForwardingAnnotatedMethod<T>()
- {
- @Override
- protected AnnotatedMethod<T> delegate()
- {
- return annotatedMethod;
- }
-
-
-
- };
- }
-
/**
* Constructor
*
@@ -362,23 +333,61 @@
{
if (annotations.size() > 0)
{
- final WrappableAnnotatedMethod<T> delegate = this;
+ final AnnotatedMethod<T> delegate = this;
final AnnotationStore annotationStore = AnnotationStore.wrap(getAnnotationStore(), annotations, annotations);
- return new ForwardingWrappableAnnotatedMethod<T>()
+ return new ForwardingAnnotatedMethod<T>()
{
@Override
- protected WrappableAnnotatedMethod<T> delegate()
+ protected AnnotatedMethod<T> delegate()
{
return delegate;
}
@Override
- public AnnotationStore getAnnotationStore()
+ public <A extends Annotation> A getAnnotation(Class<? extends A> annotationType)
{
- return annotationStore;
+ return annotationStore.getAnnotation(annotationType);
}
+ @Override
+ public Set<Annotation> getAnnotations()
+ {
+ return annotationStore.getAnnotations();
+ }
+
+ @Override
+ @Deprecated
+ public Set<Annotation> getBindingTypes()
+ {
+ return annotationStore.getBindingTypes();
+ }
+
+ @Override
+ @Deprecated
+ public Annotation[] getBindingTypesAsArray()
+ {
+ return annotationStore.getBindingTypesAsArray();
+ }
+
+ @Override
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return annotationStore.getDeclaredMetaAnnotations(metaAnnotationType);
+ }
+
+ @Override
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return annotationStore.getMetaAnnotations(metaAnnotationType);
+ }
+
+ @Override
+ public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
+ {
+ return annotationStore.getMetaAnnotationsAsArray(metaAnnotationType);
+ }
+
};
}
else
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -26,7 +26,6 @@
import org.jboss.webbeans.introspector.AnnotatedMember;
import org.jboss.webbeans.introspector.AnnotatedParameter;
-import org.jboss.webbeans.introspector.ForwardingAnnotatedParameter;
/**
* Represents a parameter
@@ -37,22 +36,9 @@
*
* @param <T>
*/
-public class AnnotatedParameterImpl<T> extends AbstractAnnotatedItem<T, Object> implements WrappableAnnotatedParameter<T>
+public class AnnotatedParameterImpl<T> extends AbstractAnnotatedItem<T, Object> implements AnnotatedParameter<T>
{
- static abstract class ForwardingWrappableAnnotatedParameter<T> extends ForwardingAnnotatedParameter<T> implements WrappableAnnotatedParameter<T>
- {
-
- @Override
- protected abstract WrappableAnnotatedParameter<T> delegate();
-
- public AnnotationStore getAnnotationStore()
- {
- return delegate().getAnnotationStore();
- }
-
- }
-
// The type
private final Class<T> type;
// The actual type arguments
@@ -206,18 +192,7 @@
public AnnotatedParameter<T> wrap(Set<Annotation> annotations)
{
- final WrappableAnnotatedParameter<T> delegate = this;
-
- return new ForwardingWrappableAnnotatedParameter<T>()
- {
-
- @Override
- protected WrappableAnnotatedParameter<T> delegate()
- {
- return delegate;
- }
-
- };
+ throw new UnsupportedOperationException();
}
}
Modified: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotationStore.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotationStore.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotationStore.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -4,18 +4,30 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
+import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import javax.webbeans.BindingType;
+
+import org.jboss.webbeans.literal.CurrentLiteral;
import org.jboss.webbeans.util.Strings;
import com.google.common.collect.ForwardingMap;
public class AnnotationStore
{
+
+ // The array of default binding types
+ private static final Annotation[] DEFAULT_BINDING_ARRAY = { new CurrentLiteral() };
+ // The set of default binding types
+ private static final Set<Annotation> DEFAULT_BINDING = new HashSet<Annotation>(Arrays.asList(DEFAULT_BINDING_ARRAY));
+
+ private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
+
/**
* Represents a mapping from a annotation type to an annotation
* implementation
@@ -241,52 +253,63 @@
}
}
- /* (non-Javadoc)
- * @see org.jboss.webbeans.introspector.jlr.AnnotationStore#getAnnotationMap()
- */
- public Map<Class<? extends Annotation>, Annotation> getAnnotationMap()
+ public Set<Annotation> getAnnotations()
{
- return Collections.unmodifiableMap(annotationMap);
+ return Collections.unmodifiableSet(annotationSet);
}
-
- /* (non-Javadoc)
- * @see org.jboss.webbeans.introspector.jlr.AnnotationStore#getAnnotationSet()
- */
- public Set<Annotation> getAnnotationSet()
+
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
{
- return Collections.unmodifiableSet(annotationSet);
+ return Collections.unmodifiableSet(metaAnnotationMap.get(metaAnnotationType));
}
- /* (non-Javadoc)
- * @see org.jboss.webbeans.introspector.jlr.AnnotationStore#getMetaAnnotationMap()
- */
- public Map<Class<? extends Annotation>, Set<Annotation>> getMetaAnnotationMap()
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
{
- return Collections.unmodifiableMap(metaAnnotationMap);
+ return Collections.unmodifiableSet(declaredMetaAnnotationMap.get(metaAnnotationType));
}
-
- /* (non-Javadoc)
- * @see org.jboss.webbeans.introspector.jlr.AnnotationStore#getDeclaredAnnotationMap()
- */
- public Map<Class<? extends Annotation>, Annotation> getDeclaredAnnotationMap()
+
+ public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
{
- return Collections.unmodifiableMap(declaredAnnotationMap);
+ return getMetaAnnotations(metaAnnotationType).toArray(EMPTY_ANNOTATION_ARRAY);
}
+
+ @Deprecated
+ public Set<Annotation> getBindingTypes()
+ {
+ if (getMetaAnnotations(BindingType.class).size() > 0)
+ {
+ return Collections.unmodifiableSet(getMetaAnnotations(BindingType.class));
+ }
+ else
+ {
+ return Collections.unmodifiableSet(DEFAULT_BINDING);
+ }
+ }
+
+ @Deprecated
+ public Annotation[] getBindingTypesAsArray()
+ {
+ return getBindingTypes().toArray(EMPTY_ANNOTATION_ARRAY);
+ }
+
+ public <A extends Annotation> A getAnnotation(Class<? extends A> annotationType)
+ {
+ return annotationType.cast(annotationMap.get(annotationType));
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return annotationMap.containsKey(annotationType);
+ }
- /* (non-Javadoc)
- * @see org.jboss.webbeans.introspector.jlr.AnnotationStore#getDeclaredAnnotationSet()
- */
- public Set<Annotation> getDeclaredAnnotationSet()
+ public AnnotationMap getAnnotationMap()
{
- return Collections.unmodifiableSet(declaredAnnotationSet);
+ return annotationMap;
}
- /* (non-Javadoc)
- * @see org.jboss.webbeans.introspector.jlr.AnnotationStore#getDeclaredMetaAnnotationMap()
- */
- public Map<Class<? extends Annotation>, Set<Annotation>> getDeclaredMetaAnnotationMap()
+ public AnnotationMap getDeclaredAnnotationMap()
{
- return Collections.unmodifiableMap(declaredMetaAnnotationMap);
+ return declaredAnnotationMap;
}
}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedAnnotation.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedAnnotation.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedAnnotation.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -1,10 +0,0 @@
-package org.jboss.webbeans.introspector.jlr;
-
-import java.lang.annotation.Annotation;
-
-import org.jboss.webbeans.introspector.AnnotatedAnnotation;
-
-interface WrappableAnnotatedAnnotation<T extends Annotation> extends AnnotatedAnnotation<T>, WrappableAnnotatedType<T>
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedClass.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedClass.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedClass.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -1,8 +0,0 @@
-package org.jboss.webbeans.introspector.jlr;
-
-import org.jboss.webbeans.introspector.AnnotatedClass;
-
-public interface WrappableAnnotatedClass<T> extends AnnotatedClass<T>, WrappableAnnotatedType<T>
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedConstructor.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedConstructor.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedConstructor.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -1,10 +0,0 @@
-package org.jboss.webbeans.introspector.jlr;
-
-import java.lang.reflect.Constructor;
-
-import org.jboss.webbeans.introspector.AnnotatedConstructor;
-
-interface WrappableAnnotatedConstructor<T> extends AnnotatedConstructor<T>, WrappableAnnotatedItem<T, Constructor<T>>
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedField.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedField.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedField.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -1,10 +0,0 @@
-package org.jboss.webbeans.introspector.jlr;
-
-import java.lang.reflect.Field;
-
-import org.jboss.webbeans.introspector.AnnotatedField;
-
-interface WrappableAnnotatedField<T> extends AnnotatedField<T>, WrappableAnnotatedItem<T, Field>
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedItem.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedItem.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedItem.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -1,10 +0,0 @@
-package org.jboss.webbeans.introspector.jlr;
-
-import org.jboss.webbeans.introspector.AnnotatedItem;
-
-interface WrappableAnnotatedItem<T, S> extends AnnotatedItem<T, S>
-{
-
- AnnotationStore getAnnotationStore();
-
-}
\ No newline at end of file
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedMember.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedMember.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedMember.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -1,10 +0,0 @@
-package org.jboss.webbeans.introspector.jlr;
-
-import java.lang.reflect.Member;
-
-import org.jboss.webbeans.introspector.AnnotatedMember;
-
-interface WrappableAnnotatedMember<T, S extends Member> extends AnnotatedMember<T, S>, WrappableAnnotatedItem<T, S>
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedMethod.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedMethod.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedMethod.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -1,11 +0,0 @@
-package org.jboss.webbeans.introspector.jlr;
-
-import java.lang.reflect.Method;
-
-import org.jboss.webbeans.introspector.AnnotatedMember;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
-
-interface WrappableAnnotatedMethod<T> extends AnnotatedMethod<T>, WrappableAnnotatedItem<T, Method>
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedParameter.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedParameter.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedParameter.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -1,8 +0,0 @@
-package org.jboss.webbeans.introspector.jlr;
-
-import org.jboss.webbeans.introspector.AnnotatedParameter;
-
-interface WrappableAnnotatedParameter<T> extends AnnotatedParameter<T>, WrappableAnnotatedItem<T, Object>
-{
-
-}
Deleted: ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedType.java
===================================================================
--- ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedType.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ ri/trunk/webbeans-ri/src/main/java/org/jboss/webbeans/introspector/jlr/WrappableAnnotatedType.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -1,8 +0,0 @@
-package org.jboss.webbeans.introspector.jlr;
-
-import org.jboss.webbeans.introspector.AnnotatedType;
-
-interface WrappableAnnotatedType<T> extends AnnotatedType<T>, WrappableAnnotatedItem<T, Class<T>>
-{
-
-}
\ No newline at end of file
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java 2009-01-20 22:31:23 UTC (rev 1133)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java 2009-01-20 23:32:58 UTC (rev 1134)
@@ -54,7 +54,7 @@
assert manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getBindings().iterator().next().annotationType().equals(Smelly.class);
}
- @Test(groups="broken") @SpecAssertion(section="4.1")
+ @Test@SpecAssertion(section="4.1")
public void testRealizedBeanWithProducerMethodHasBindingsOfMethodAndRealizingType()
{
deployBeans(TameCow.class);
@@ -102,13 +102,13 @@
assert manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getBindings().iterator().next().annotationType().equals(Smelly.class);
}
- @Test(groups="broken") @SpecAssertion(section="4.1")
+ @Test @SpecAssertion(section="4.1")
public void testRealizedBeanWithProducerFieldHasBindingsOfMethodAndRealizingType()
{
deployBeans(TameHorse.class);
- assert manager.resolveByType(Dung.class).size() == 1;
- assert manager.resolveByType(Dung.class).iterator().next().getBindings().size() == 2;
- assert annotationSetMatches(manager.resolveByType(Dung.class).iterator().next().getBindings(), Smelly.class, Tame.class);
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).size() == 1;
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getBindings().size() == 2;
+ assert annotationSetMatches(manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getBindings(), Smelly.class, Tame.class);
}
@Test @SpecAssertion(section="4.1")
16 years, 8 months
[webbeans-commits] Webbeans SVN: r1133 - tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-01-20 17:31:23 -0500 (Tue, 20 Jan 2009)
New Revision: 1133
Modified:
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/Horse.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/Stable.java
tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/TameCow.java
Log:
enable more realization tests
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/Horse.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/Horse.java 2009-01-20 22:30:59 UTC (rev 1132)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/Horse.java 2009-01-20 22:31:23 UTC (rev 1133)
@@ -1,6 +1,8 @@
package org.jboss.webbeans.tck.unit.inheritance.realization;
-@AnotherDeploymentType
+import javax.webbeans.Realizes;
+
+@AnotherDeploymentType @Realizes
class Horse extends AbstractHorse
{
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java 2009-01-20 22:30:59 UTC (rev 1132)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/RealizationTest.java 2009-01-20 22:31:23 UTC (rev 1133)
@@ -16,6 +16,9 @@
public class RealizationTest extends AbstractTest
{
+ private static Annotation SMELLY_LITERAL = new AnnotationLiteral<Smelly>(){};
+
+
@Override
protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
{
@@ -30,34 +33,34 @@
public void testRealizedBeanWithProducerMethodHasSameScope()
{
deployBeans(Cow.class);
- assert manager.resolveByType(Dung.class, new AnnotationLiteral<Smelly>(){}).size() == 1;
- assert manager.resolveByType(Dung.class, new AnnotationLiteral<Smelly>(){}).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).size() == 1;
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test(groups="broken") @SpecAssertion(section="4.1")
- public void testRealizedBeanWithProducerMethodHasScopeOfRealizingClass()
+ public void testRealizedBeanWithProducerMethodHasDeploymentTypeOfRealizingClass()
{
deployBeans(Cow.class);
- assert manager.resolveByType(Dung.class).size() == 1;
- assert manager.resolveByType(Dung.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).size() == 1;
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
- @Test(groups="broken") @SpecAssertion(section="4.1")
+ @Test @SpecAssertion(section="4.1")
public void testRealizedBeanWithProducerMethodHasSameBindings()
{
deployBeans(Cow.class);
- assert manager.resolveByType(Dung.class).size() == 1;
- assert manager.resolveByType(Dung.class).iterator().next().getBindings().size() == 1;
- assert manager.resolveByType(Dung.class).iterator().next().getBindings().iterator().next().annotationType().equals(Smelly.class);
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).size() == 1;
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getBindings().size() == 1;
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getBindings().iterator().next().annotationType().equals(Smelly.class);
}
@Test(groups="broken") @SpecAssertion(section="4.1")
public void testRealizedBeanWithProducerMethodHasBindingsOfMethodAndRealizingType()
{
deployBeans(TameCow.class);
- assert manager.resolveByType(Dung.class).size() == 1;
- assert manager.resolveByType(Dung.class).iterator().next().getBindings().size() == 2;
- assert annotationSetMatches(manager.resolveByType(Dung.class).iterator().next().getBindings(), Smelly.class, Tame.class);
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).size() == 1;
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getBindings().size() == 2;
+ assert annotationSetMatches(manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getBindings(), Smelly.class, Tame.class);
}
@Test @SpecAssertion(section="4.1")
@@ -74,29 +77,29 @@
assert false;
}
- @Test(groups="broken") @SpecAssertion(section="4.1")
+ @Test @SpecAssertion(section="4.1")
public void testRealizedBeanWithProducerFieldHasSameScope()
{
deployBeans(Horse.class);
- assert manager.resolveByType(Dung.class).size() == 1;
- assert manager.resolveByType(Dung.class).iterator().next().getScopeType().equals(RequestScoped.class);
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).size() == 1;
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getScopeType().equals(RequestScoped.class);
}
@Test(groups="broken") @SpecAssertion(section="4.1")
- public void testRealizedBeanWithProducerFieldHasScopeOfRealizingClass()
+ public void testRealizedBeanWithProducerFieldHasDeploymentTypeOfRealizingClass()
{
deployBeans(Horse.class);
assert manager.resolveByType(Dung.class).size() == 1;
assert manager.resolveByType(Dung.class).iterator().next().getDeploymentType().equals(AnotherDeploymentType.class);
}
- @Test(groups="broken") @SpecAssertion(section="4.1")
+ @Test @SpecAssertion(section="4.1")
public void testRealizedBeanWithProducerFieldHasSameBindings()
{
deployBeans(Horse.class);
- assert manager.resolveByType(Dung.class).size() == 1;
- assert manager.resolveByType(Dung.class).iterator().next().getBindings().size() == 1;
- assert manager.resolveByType(Dung.class).iterator().next().getBindings().iterator().next().annotationType().equals(Smelly.class);
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).size() == 1;
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getBindings().size() == 1;
+ assert manager.resolveByType(Dung.class, SMELLY_LITERAL).iterator().next().getBindings().iterator().next().annotationType().equals(Smelly.class);
}
@Test(groups="broken") @SpecAssertion(section="4.1")
@@ -108,7 +111,7 @@
assert annotationSetMatches(manager.resolveByType(Dung.class).iterator().next().getBindings(), Smelly.class, Tame.class);
}
- @Test(groups="broken") @SpecAssertion(section="4.1")
+ @Test @SpecAssertion(section="4.1")
public void testRealizedBeanWithProducerFieldHasSameStereotypes()
{
deployBeans(Stable.class);
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/Stable.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/Stable.java 2009-01-20 22:30:59 UTC (rev 1132)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/Stable.java 2009-01-20 22:31:23 UTC (rev 1133)
@@ -1,6 +1,9 @@
package org.jboss.webbeans.tck.unit.inheritance.realization;
-public class Stable
+import javax.webbeans.Realizes;
+
+@Realizes
+class Stable extends AbstractStable
{
}
Modified: tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/TameCow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/TameCow.java 2009-01-20 22:30:59 UTC (rev 1132)
+++ tck/trunk/impl/src/main/java/org/jboss/webbeans/tck/unit/inheritance/realization/TameCow.java 2009-01-20 22:31:23 UTC (rev 1133)
@@ -3,7 +3,7 @@
import javax.webbeans.Realizes;
@Realizes @Tame
-class TameCow extends Cow
+class TameCow extends AbstractCow
{
}
16 years, 8 months