[webbeans-commits] Webbeans SVN: r2836 - tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl.
by webbeans-commits@lists.jboss.org
Author: dan.j.allen
Date: 2009-06-15 17:54:43 -0400 (Mon, 15 Jun 2009)
New Revision: 2836
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/JSR299PropertiesBasedConfigurationBuilder.java
Log:
whitespace
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/JSR299PropertiesBasedConfigurationBuilder.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/JSR299PropertiesBasedConfigurationBuilder.java 2009-06-15 20:28:55 UTC (rev 2835)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/impl/JSR299PropertiesBasedConfigurationBuilder.java 2009-06-15 21:54:43 UTC (rev 2836)
@@ -35,7 +35,7 @@
getConfiguration().setBeans(getInstanceValue(Beans.PROPERTY_NAME, Beans.class, true));
getConfiguration().setEl(getInstanceValue(EL.PROPERTY_NAME, EL.class, true));
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("unchecked")
Contexts<? extends Context> instanceValue = getInstanceValue(Contexts.PROPERTY_NAME, Contexts.class, true);
getConfiguration().setContexts(instanceValue);
14 years, 10 months
[webbeans-commits] Webbeans SVN: r2835 - in tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests: lookup/injection and 7 other directories.
by webbeans-commits@lists.jboss.org
Author: dallen6
Date: 2009-06-15 16:28:55 -0400 (Mon, 15 Jun 2009)
New Revision: 2835
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/enterprise/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Barn.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Farm.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/FarmLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Hamlet.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/HamletLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/NonContextualInjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Village.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/VillageLocal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/servlet/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/instantiation/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/xml/
Modified:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/nullableBean/NullableBeanTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
Log:
Updates to TCK lookup tests
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java 2009-06-15 16:24:34 UTC (rev 2834)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/InjectionTest.java 2009-06-15 20:28:55 UTC (rev 2835)
@@ -19,7 +19,7 @@
{
@Test(groups = { "injection", "producerMethod" })
- @SpecAssertion(section = "5.2", id = "aa")
+ @SpecAssertion(section = "5.1.3", id = "aa")
public void testInjectionPerformsBoxingIfNecessary() throws Exception
{
assert getBeans(SpiderNest.class).size() == 1;
@@ -28,26 +28,6 @@
assert spiderNest.numberOfSpiders.equals(4);
}
- @Test(groups = { "injection", "clientProxy" }, expectedExceptions = ContextNotActiveException.class)
- @SpecAssertion(section = "5.3", id = "a")
- public void testInvokeNormalInjectedWebBeanWhenContextNotActive()
- {
- assert getBeans(TunaFarm.class).size() == 1;
- TunaFarm tunaFarm = getInstanceByType(TunaFarm.class);
- assert tunaFarm.tuna != null;
- getCurrentConfiguration().getContexts().setInactive(getCurrentConfiguration().getContexts().getRequestContext());
- tunaFarm.tuna.getName();
- }
-
- @Test(groups = "injection")
- @SpecAssertion(section = "5.3", id = "b")
- public void testInvokeDependentScopeWhenContextNotActive()
- {
- assert getBeans(FoxRun.class).size() == 1;
- FoxRun foxRun = getInstanceByType(FoxRun.class);
- assert foxRun.fox.getName().equals("gavin");
- }
-
@Test
@SpecAssertion(section="4.2", id = "aa")
public void testFieldDeclaredInSuperclassInjected() throws Exception
@@ -67,7 +47,7 @@
@Test
@SpecAssertion(section="4.2", id = "ac")
public void testFieldDeclaredInIndirectSuperclassInjected() throws Exception
- {
+ {
new RunInDependentContext()
{
@Override
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/nullableBean/NullableBeanTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/nullableBean/NullableBeanTest.java 2009-06-15 16:24:34 UTC (rev 2834)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injection/nullableBean/NullableBeanTest.java 2009-06-15 20:28:55 UTC (rev 2835)
@@ -15,7 +15,7 @@
@Test(groups = { "injection", "producerMethod" })
- @SpecAssertion(section = "5.2", id = "a")
+ @SpecAssertion(section = "5.1.3", id = "aa")
public void testPrimitiveInjectionPointResolvesToNullableWebBean() throws Exception
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-06-15 16:24:34 UTC (rev 2834)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-06-15 20:28:55 UTC (rev 2835)
@@ -48,7 +48,7 @@
{
@Test(groups = { "injectionPoint" })
- @SpecAssertion(section = "5.6", id = "a")
+ @SpecAssertion(section = "5.4.9", id = "a")
public void testGetBean() throws Exception
{
@@ -71,7 +71,7 @@
}
@Test(groups = { "injectionPoint" })
- @SpecAssertion(section = "5.6", id = "ba")
+ @SpecAssertion(section = "5.4.9", id = "ba")
public void testGetType() throws Exception
{
// Get an instance of the bean which has another bean injected into it
@@ -90,7 +90,7 @@
}
@Test(groups = { "injectionPoint" })
- @SpecAssertion(section = "5.6", id = "bc")
+ @SpecAssertion(section = "5.4.9", id = "bc")
public void testGetBindingTypes() throws Exception
{
// Get an instance of the bean which has another bean injected into it
@@ -111,7 +111,7 @@
}
@Test(groups = { "injectionPoint" })
- @SpecAssertion(section = "5.6", id = "ca")
+ @SpecAssertion(section = "5.4.9", id = "ca")
public void testGetMemberField() throws Exception
{
// Get an instance of the bean which has another bean injected into it
@@ -130,7 +130,7 @@
}
@Test(groups = { "injectionPoint" })
- @SpecAssertion(section = "5.6", id = "cb")
+ @SpecAssertion(section = "5.4.9", id = "cb")
public void testGetMemberMethod() throws Exception
{
// Get an instance of the bean which has another bean injected into it
@@ -154,7 +154,7 @@
}
@Test(groups = { "injectionPoint" })
- @SpecAssertion(section = "5.6", id = "cc")
+ @SpecAssertion(section = "5.4.9", id = "cc")
public void testGetMemberConstructor() throws Exception
{
// Get an instance of the bean which has another bean injected into it
@@ -177,8 +177,8 @@
}.run();
}
- @Test(groups = { "injectionPoint" })
- @SpecAssertion(section = "5.6", id = "da")
+ @Test(groups = { "injectionPoint", "rewrite" })
+ @SpecAssertion(section = "5.4.9", id = "daa")
public void testGetAnnotation() throws Exception
{
// Get an instance of the bean which has another bean injected into it
@@ -195,105 +195,4 @@
}
}.run();
}
-
- @Test(groups = { "injectionPoint" })
- @SpecAssertion(section = "5.6", id = "dd")
- public void testGetAnnotations() throws Exception
- {
- // Get an instance of the bean which has another bean injected into it
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
- BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
- assert beanWithInjectionPoint.getInjectedMetadata() != null;
- Set<Annotation> annotations = new HashSet<Annotation>(beanWithInjectionPoint.getInjectedMetadata().getAnnotated().getAnnotations());
- assert annotations.size() > 0;
- assert annotations.contains(new CurrentLiteral());
- assert annotations.contains(new AnimalStereotypeAnnotationLiteral());
- }
- }.run();
- }
-
- @Test(groups = { "injectionPoint" })
- @SpecAssertions({
- @SpecAssertion(section = "5.6.1", id = "za"),
- @SpecAssertion(section = "2.5.1", id="a")
- })
- public void testStandardDeployment() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- assert getBeans(InjectionPoint.class).size() == 1;
- assert getBeans(InjectionPoint.class).iterator().next().getDeploymentType().equals(Standard.class);
- }
-
- }.run();
- }
-
- @Test(groups = { "injectionPoint" })
- @SpecAssertion(section = "5.6.1", id = "zb")
- public void testDependentScope() throws Exception
- {
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- assert getBeans(InjectionPoint.class).size() == 1;
- assert getBeans(InjectionPoint.class).iterator().next().getScopeType().equals(Dependent.class);
- }
-
- }.run();
- }
-
- @Test(groups = { "injectionPoint" })
- @SpecAssertions({
- @SpecAssertion(section = "5.6.1", id = "zc")
- })
- public void testApiTypeInjectionPoint() throws Exception
- {
- // Get an instance of the bean which has another bean injected into it
- new RunInDependentContext()
- {
-
- @Override
- protected void execute() throws Exception
- {
- FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
- BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
- assert beanWithInjectionPoint.getInjectedMetadata() != null;
- assert InjectionPoint.class.isAssignableFrom(beanWithInjectionPoint.getInjectedMetadata().getClass());
- }
- }.run();
- }
-
- @Test(groups = { "injectionPoint" })
- @SpecAssertions({
- @SpecAssertion(section = "5.6.1", id = "zd"),
- @SpecAssertion(section = "5.6.1", id = "a")
- })
- public void testCurrentBinding() throws Exception
- {
- // Get an instance of the bean which has another bean injected into it
- new RunInDependentContext()
- {
- @Override
- protected void execute() throws Exception
- {
- FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
- BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
- assert beanWithInjectionPoint.getInjectedMetadata() != null;
- assert beanWithInjectionPoint.getInjectedMetadata().getBindings().contains(new CurrentLiteral());
- }
- }.run();
- }
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java 2009-06-15 16:24:34 UTC (rev 2834)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/ManagerTest.java 2009-06-15 20:28:55 UTC (rev 2835)
@@ -22,7 +22,7 @@
public class ManagerTest extends AbstractJSR299Test
{
@Test(groups={"manager", "injection", "deployment"})
- @SpecAssertion(section="5.7.2", id = "a")
+ @SpecAssertion(section="11.2", id = "c")
public void testInjectingManager() throws Exception
{
new RunInDependentContext()
@@ -39,14 +39,14 @@
}
@Test
- @SpecAssertion(section = "5.7.2", id = "aa")
+ @SpecAssertion(section = "11.2", id = "a")
public void testContainerProvidesManagerBean()
{
assert getBeans(BeanManager.class).size() > 0;
}
@Test
- @SpecAssertion(section = "5.7.2", id = "ab")
+ @SpecAssertion(section = "11.2", id = "a")
public void testManagerBeanIsDependentScoped()
{
Bean<BeanManager> beanManager = getBeans(BeanManager.class).iterator().next();
@@ -54,7 +54,7 @@
}
@Test
- @SpecAssertion(section = "5.7.2", id = "ac")
+ @SpecAssertion(section = "11.2", id = "a")
public void testManagerBeanHasStandardDeployment()
{
Bean<BeanManager> beanManager = getBeans(BeanManager.class).iterator().next();
@@ -62,7 +62,7 @@
}
@Test
- @SpecAssertion(section = "5.7.2", id = "ad")
+ @SpecAssertion(section = "11.2", id = "a")
public void testManagerBeanHasCurrentBinding()
{
Bean<BeanManager> beanManager = getBeans(BeanManager.class).iterator().next();
@@ -71,10 +71,10 @@
@Test
@SpecAssertions({
- @SpecAssertion(section = "5.7.2", id = "c"),
- @SpecAssertion(section = "5.7.2", id = "d")
+ @SpecAssertion(section = "11.2.1", id = "a"),
+ @SpecAssertion(section = "11.2.1", id = "b")
})
- public void testGetInstanceReturnsContextualInstance()
+ public void testGetReferenceReturnsContextualInstance()
{
Bean<FishFarmOffice> bean = getBeans(FishFarmOffice.class).iterator().next();
assert getCurrentManager().getReference(bean,FishFarmOffice.class) instanceof FishFarmOffice;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java 2009-06-15 16:24:34 UTC (rev 2834)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/manager/jndi/ManagerTest.java 2009-06-15 20:28:55 UTC (rev 2835)
@@ -14,11 +14,11 @@
public class ManagerTest extends AbstractJSR299Test
{
@Test(groups = { "manager", "ejb3", "integration" })
- @SpecAssertion(section = "5.7.2", id = "b")
+ @SpecAssertion(section = "11.2", id = "d")
public void testManagerLookupInJndi() throws Exception
{
InitialContext ctx = new InitialContext();
- BeanManager beanManager = (BeanManager) ctx.lookup("java:app/Manager");
+ BeanManager beanManager = (BeanManager) ctx.lookup("java:app/BeanManager");
assert beanManager != null;
}
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Barn.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Barn.java 2009-06-15 16:24:34 UTC (rev 2834)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Barn.java 2009-06-15 20:28:55 UTC (rev 2835)
@@ -1,8 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.nonContextual;
-
-import java.io.Serializable;
-
-public class Barn implements Serializable
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Farm.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Farm.java 2009-06-15 16:24:34 UTC (rev 2834)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Farm.java 2009-06-15 20:28:55 UTC (rev 2835)
@@ -1,26 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.nonContextual;
-
-import java.io.Serializable;
-
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-import javax.enterprise.inject.Current;
-
-@Stateful
-public class Farm implements FarmLocal, Serializable
-{
-
- @Current Barn barn;
-
- @Remove
- public void remove()
- {
-
- }
-
- public Barn getBarn()
- {
- return barn;
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/FarmLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/FarmLocal.java 2009-06-15 16:24:34 UTC (rev 2834)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/FarmLocal.java 2009-06-15 20:28:55 UTC (rev 2835)
@@ -1,11 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.nonContextual;
-
-import javax.ejb.Local;
-
-@Local
-public interface FarmLocal
-{
-
- public Barn getBarn();
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Hamlet.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Hamlet.java 2009-06-15 16:24:34 UTC (rev 2834)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Hamlet.java 2009-06-15 20:28:55 UTC (rev 2835)
@@ -1,21 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.nonContextual;
-
-import javax.annotation.Resource;
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-
-@Stateful
-public class Hamlet implements HamletLocal
-{
-
- @Resource(mappedName="java:comp/env/servlet-test-runner/Farm/local") FarmLocal farm;
-
- @Remove
- public void remove() {}
-
- public FarmLocal getFarm()
- {
- return farm;
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/HamletLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/HamletLocal.java 2009-06-15 16:24:34 UTC (rev 2834)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/HamletLocal.java 2009-06-15 20:28:55 UTC (rev 2835)
@@ -1,11 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.nonContextual;
-
-import javax.ejb.Local;
-
-@Local
-public interface HamletLocal
-{
-
- public FarmLocal getFarm();
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/NonContextualInjectionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/NonContextualInjectionTest.java 2009-06-15 16:24:34 UTC (rev 2834)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/NonContextualInjectionTest.java 2009-06-15 20:28:55 UTC (rev 2835)
@@ -1,55 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.nonContextual;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.testharness.impl.packaging.IntegrationTest;
-import org.jboss.testharness.impl.packaging.Packaging;
-import org.jboss.testharness.impl.packaging.PackagingType;
-import org.testng.annotations.Test;
-
-/**
- *
- * Spec version: PRD2
- *
- */
-@Artifact
-@IntegrationTest
-(a)Packaging(PackagingType.EAR)
-public class NonContextualInjectionTest extends AbstractJSR299Test
-{
-
- @Test(groups = { "integration", "stub" })
- @SpecAssertion(section = "5.12.1", id = "a")
- public void testInjectionIntoSessionBeanLookedUpInJndi() throws Exception
- {
- // Quite tough as no universal names. Need to allow these to be specified or something...
- assert false;
- }
-
- @Test(groups = { "integration" })
- @SpecAssertion(section = "5.12.1", id = "a")
- public void testInjectionIntoSessionBeanInjectedViaEjb() throws Exception
- {
- assert getBeans(VillageLocal.class).size() == 1;
- assert getInstanceByType(VillageLocal.class).getFarm().getBarn() != null;
- }
-
- @Test(groups = { "integration", "broken" })
- @SpecAssertion(section = "5.12.1", id = "a")
- public void testInjectionIntoSessionBeanInjectedViaResource() throws Exception
- {
- // Quite tough as no universal names. Need to allow these to be specified or something...
- assert getBeans(HamletLocal.class).size() == 1;
- assert getInstanceByType(HamletLocal.class).getFarm().getBarn() != null;
- }
-
- @Test(groups = { "stub", "integration" })
- @SpecAssertion(section = "5.12.2", id = "a")
- public void testInjectionIntoMessageDrivenBean()
- {
- assert false;
- }
-
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Village.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Village.java 2009-06-15 16:24:34 UTC (rev 2834)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/Village.java 2009-06-15 20:28:55 UTC (rev 2835)
@@ -1,21 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.nonContextual;
-
-import javax.ejb.EJB;
-import javax.ejb.Remove;
-import javax.ejb.Stateful;
-
-@Stateful
-public class Village implements VillageLocal
-{
-
- @EJB FarmLocal farm;
-
- @Remove
- public void remove() {}
-
- public FarmLocal getFarm()
- {
- return farm;
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/VillageLocal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/VillageLocal.java 2009-06-15 16:24:34 UTC (rev 2834)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/nonContextual/VillageLocal.java 2009-06-15 20:28:55 UTC (rev 2835)
@@ -1,11 +0,0 @@
-package org.jboss.jsr299.tck.tests.lookup.nonContextual;
-
-import javax.ejb.Local;
-
-@Local
-public interface VillageLocal
-{
-
- public FarmLocal getFarm();
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-06-15 16:24:34 UTC (rev 2834)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/typesafe/resolution/ResolutionByTypeTest.java 2009-06-15 20:28:55 UTC (rev 2835)
@@ -62,8 +62,7 @@
@Test(groups="resolution")
@SpecAssertions({
- @SpecAssertion(section="5.1", id = "a"),
- @SpecAssertion(section = "5.1", id ="fa")
+ @SpecAssertion(section = "5.1", id ="faa")
})
public void testResolveByType() throws Exception
{
@@ -98,7 +97,7 @@
@Test(groups="injection")
@SpecAssertions({
@SpecAssertion(section = "2.3.4", id = "b" ),
- @SpecAssertion(section = "5.1", id = "gb"),
+ @SpecAssertion(section = "5.1", id = "gba"),
@SpecAssertion(section = "2.3.3", id = "d" ),
@SpecAssertion(section = "5.1.5", id = "a" )
})
@@ -148,7 +147,6 @@
{
assert getBeans(Animal.class, new AnnotationLiteral<Whitefish>() {}).size() == 1;
assert getBeans(Animal.class, new AnnotationLiteral<Whitefish>() {}).iterator().next().getTypes().contains(Plaice.class);
-
}
@@ -161,7 +159,6 @@
@Test(groups="resolution")
@SpecAssertions({
- @SpecAssertion(section="5.1.4", id = "b"),
@SpecAssertion(section="5.1", id = "gca")
})
public void testResolveByTypeWithNonBindingMembers() throws Exception
14 years, 10 months
[webbeans-commits] Webbeans SVN: r2834 - in ri/trunk: impl/src/main/java/org/jboss/webbeans and 8 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-15 12:24:34 -0400 (Mon, 15 Jun 2009)
New Revision: 2834
Modified:
ri/trunk/api/src/main/java/javax/enterprise/inject/Current.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanResolvableTransformer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBMember.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBType.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/ELResolverTest.java
Log:
tidy up imports
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/Current.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/Current.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/Current.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -17,10 +17,10 @@
package javax.enterprise.inject;
+import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.PARAMETER;
import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
import java.lang.annotation.Documented;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -80,8 +80,8 @@
import org.jboss.webbeans.event.EventObserver;
import org.jboss.webbeans.event.ObserverImpl;
import org.jboss.webbeans.injection.NonContextualInjector;
+import org.jboss.webbeans.injection.resolution.ResolvableFactory;
import org.jboss.webbeans.injection.resolution.ResolvableWBClass;
-import org.jboss.webbeans.injection.resolution.ResolvableFactory;
import org.jboss.webbeans.injection.resolution.Resolver;
import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.log.Log;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingBean.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -22,7 +22,6 @@
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.InjectionPoint;
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -32,11 +32,11 @@
import org.jboss.webbeans.context.DependentStorageRequest;
import org.jboss.webbeans.ejb.EJBApiAbstraction;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.injection.WBInjectionPoint;
import org.jboss.webbeans.injection.ConstructorInjectionPoint;
import org.jboss.webbeans.injection.FieldInjectionPoint;
import org.jboss.webbeans.injection.MethodInjectionPoint;
import org.jboss.webbeans.injection.ParameterInjectionPoint;
+import org.jboss.webbeans.injection.WBInjectionPoint;
import org.jboss.webbeans.introspector.WBClass;
import org.jboss.webbeans.introspector.WBConstructor;
import org.jboss.webbeans.introspector.WBField;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanResolvableTransformer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanResolvableTransformer.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanResolvableTransformer.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -24,8 +24,8 @@
import java.util.Set;
import org.jboss.webbeans.injection.resolution.ForwardingResolvable;
+import org.jboss.webbeans.injection.resolution.Resolvable;
import org.jboss.webbeans.injection.resolution.ResolvableTransformer;
-import org.jboss.webbeans.injection.resolution.Resolvable;
/**
* AnnotatedItem transformer which can be used for FacadeBeans
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -26,8 +26,8 @@
import javax.enterprise.inject.TypeLiteral;
import javax.inject.Obtains;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.InstanceImpl;
-import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.injection.resolution.ResolvableTransformer;
import org.jboss.webbeans.literal.ObtainsLiteral;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -36,8 +36,8 @@
import org.jboss.webbeans.event.ObserverImpl;
import org.jboss.webbeans.injection.resolution.ResolvableFactory;
import org.jboss.webbeans.injection.resolution.Resolver;
+import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.introspector.WBClass;
-import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.introspector.WBMethod;
public class BeanDeployerEnvironment
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/EventImpl.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -23,8 +23,8 @@
import javax.event.Event;
import javax.event.Observer;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.FacadeImpl;
-import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.literal.AnyLiteral;
import org.jboss.webbeans.util.Strings;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBMember.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBMember.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBMember.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -20,9 +20,9 @@
import java.lang.reflect.Modifier;
import java.lang.reflect.Type;
-import org.jboss.webbeans.introspector.WBMember;
import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.introspector.ForwardingWBMember;
+import org.jboss.webbeans.introspector.WBMember;
import org.jboss.webbeans.util.Reflections;
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBType.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBType.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBType.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -19,9 +19,9 @@
import java.lang.reflect.Modifier;
import java.lang.reflect.Type;
+import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.introspector.WBClass;
import org.jboss.webbeans.introspector.WBType;
-import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.resources.ClassTransformer;
import org.jboss.webbeans.util.Reflections;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -18,9 +18,9 @@
import java.util.Arrays;
-import org.jboss.webbeans.introspector.WBConstructor;
import org.jboss.webbeans.introspector.ConstructorSignature;
import org.jboss.webbeans.introspector.MethodSignature;
+import org.jboss.webbeans.introspector.WBConstructor;
public class ConstructorSignatureImpl implements ConstructorSignature
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -19,8 +19,8 @@
import java.lang.reflect.Method;
import java.util.Arrays;
+import org.jboss.webbeans.introspector.MethodSignature;
import org.jboss.webbeans.introspector.WBMethod;
-import org.jboss.webbeans.introspector.MethodSignature;
public class MethodSignatureImpl implements MethodSignature
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -24,10 +24,10 @@
import java.util.Map;
import java.util.Set;
+import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.introspector.WBAnnotation;
import org.jboss.webbeans.introspector.WBClass;
import org.jboss.webbeans.introspector.WBMethod;
-import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.resources.ClassTransformer;
import org.jboss.webbeans.util.collections.multi.SetHashMultiMap;
import org.jboss.webbeans.util.collections.multi.SetMultiMap;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -29,13 +29,13 @@
import java.util.Map;
import java.util.Set;
+import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.introspector.ConstructorSignature;
+import org.jboss.webbeans.introspector.MethodSignature;
import org.jboss.webbeans.introspector.WBClass;
import org.jboss.webbeans.introspector.WBConstructor;
import org.jboss.webbeans.introspector.WBField;
import org.jboss.webbeans.introspector.WBMethod;
-import org.jboss.webbeans.introspector.AnnotationStore;
-import org.jboss.webbeans.introspector.ConstructorSignature;
-import org.jboss.webbeans.introspector.MethodSignature;
import org.jboss.webbeans.resources.ClassTransformer;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -25,11 +25,11 @@
import java.util.List;
import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.introspector.ConstructorSignature;
import org.jboss.webbeans.introspector.WBConstructor;
import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.introspector.WBType;
-import org.jboss.webbeans.introspector.AnnotationStore;
-import org.jboss.webbeans.introspector.ConstructorSignature;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.collections.multi.ListHashMultiMap;
import org.jboss.webbeans.util.collections.multi.ListMultiMap;
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -20,9 +20,9 @@
import java.lang.reflect.Type;
import java.util.Set;
+import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.introspector.WBMember;
import org.jboss.webbeans.introspector.WBParameter;
-import org.jboss.webbeans.introspector.AnnotationStore;
/**
* Represents a parameter
Modified: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -1,8 +1,8 @@
package org.jboss.jsr299.tck.tests.activities.current;
+import javax.enterprise.inject.Any;
import javax.enterprise.inject.Initializer;
import javax.event.Event;
-import javax.enterprise.inject.Any;
class Dusk
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/bootstrap/environments/ServletEnvironmentTest.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -8,8 +8,8 @@
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.spi.Bean;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bean.SimpleBean;
import org.jboss.webbeans.mock.MockServletLifecycle;
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/ELResolverTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/ELResolverTest.java 2009-06-15 15:50:27 UTC (rev 2833)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/definition/ELResolverTest.java 2009-06-15 16:24:34 UTC (rev 2834)
@@ -1,6 +1,6 @@
package org.jboss.webbeans.test.unit.definition;
-import static org.testng.Assert.*;
+import static org.testng.Assert.assertEquals;
import javax.el.ELContext;
import javax.el.ExpressionFactory;
14 years, 10 months
[webbeans-commits] Webbeans SVN: r2833 - ri/trunk/spi/src/main/java/org/jboss/webbeans/manager/api and 9 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-15 11:50:27 -0400 (Mon, 15 Jun 2009)
New Revision: 2833
Added:
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Cow.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Dummy.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Field.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Fox.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/NightTime.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Tame.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/BeanWithInjection.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/MyBean.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/SameBeanTypeInChildActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/SpecialBindingType.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Cow.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Donkey.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dummy.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Field.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Horse.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InactiveScopeTest.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NightTime.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScope.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScopeTest.java
ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Tame.java
Removed:
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Cow.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Dummy.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Field.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Fox.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/NightTime.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Tame.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/child/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/current/
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/duplicateOnParent/
Modified:
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/manager/api/WebBeansManager.java
ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
ri/trunk/tests/unit-tests.xml
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
Log:
Move activities tests to impl from tck
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java 2009-06-15 08:01:01 UTC (rev 2832)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -44,7 +44,7 @@
*/
public interface BeanManager
{
-
+
/**
* Obtains a contextual reference for a given bean and a given bean type.
*
@@ -57,7 +57,7 @@
* if the given type is not a bean type of the given bean
*/
public Object getReference(Bean<?> bean, Type beanType);
-
+
/**
* Obtains an instance of bean for a given injection point.
*
@@ -75,7 +75,7 @@
* bindings
*/
public Object getInjectableReference(InjectionPoint injectionPoint, CreationalContext<?> creationalContext);
-
+
/**
* Returns the set of beans which match the given required type and bindings and are
* accessible to the class into which the BeanManager was injected, according to the
@@ -95,8 +95,8 @@
* if an instance of an annotation that is not a binding type is given
*/
public Set<Bean<?>> getBeans(Type beanType, Annotation... bindings);
-
+
/**
* Returns the set of beans which match the given EL name and are accessible to the
* class into which the BeanManager was injected, according to the rules of EL name
@@ -107,7 +107,7 @@
* @return the matched beans
*/
public Set<Bean<?>> getBeans(String name);
-
+
/**
* Returns the Bean object representing the most specialized enabled bean registered
* with the container that specializes the given bean,
@@ -132,7 +132,7 @@
* @param beans A set of beans of the given type
*/
public <X> Bean<? extends X> getHighestPrecedenceBean(Set<Bean<? extends X>> beans);
-
+
/**
* Allows a new bean to be registered. This fires a ProcessBean event and then
* registers a new bean with the container, thereby making it available for injection
@@ -145,8 +145,8 @@
*/
public void addBean(Bean<?> bean);
-
-
+
+
/**
* Register an observer with the container, allowing it to begin receiving
* event notifications.
@@ -167,8 +167,8 @@
* if the runtime type of the observer object contains a type variable
*/
public void addObserver(Observer<?> observer, Annotation... bindings);
-
+
/**
* An alternative mechanism for registering an observer. The observed event
* type and event bindings for registration will be obtained from the
@@ -177,8 +177,8 @@
* a the method to register for receiving events
*/
public void addObserver(ObserverMethod<?, ?> observerMethod);
-
-
+
+
/**
* Remove an observer registration
*
@@ -189,8 +189,8 @@
* if two instances of the same binding type are passed
*/
public void removeObserver(Observer<?> observer);
-
-
+
+
/**
* Fire an event
*
@@ -204,7 +204,7 @@
* if an instance of an annotation that is not a binding type is given,
*/
public void fireEvent(Object event, Annotation... bindings);
-
+
/**
* Obtains observers for an event by considering event type and bindings.
*
@@ -276,41 +276,41 @@
* Determine if the given annotationType is a scope type
*/
public boolean isScopeType(Class<? extends Annotation> annotationType);
-
+
/**
* Determine if the given annotationType is a binding type
*/
public boolean isBindingType(Class<? extends Annotation> annotationType);
-
-
+
+
/**
* Determine if the given annotationType is an interceptor binding type
*/
public boolean isInterceptorBindingType(Class<? extends Annotation> annotationType);
-
+
/**
* Determine if the given annotationType is a stereotype
*/
public boolean isStereotype(Class<? extends Annotation> annotationType);
-
+
/**
* Return a ScopeType definition type for a given annotation representing a scope type
*/
public ScopeType getScopeDefinition(Class<? extends Annotation> scopeType);
-
+
/**
* Obtain the set of interceptor binding types meta-annotatinos for the given binding type
* annotation
*/
public Set<Annotation> getInterceptorBindingTypeDefinition(Class<? extends Annotation> bindingType);
-
-
+
+
/**
* Obtain the set of binding types meta-annotations for the given stereotype annotation
*/
public Set<Annotation> getStereotypeDefinition(Class<? extends Annotation> stereotype);
-
+
/**
* Exposes the list of enabled deployment types, in order of lower to higher precedence,
* This method may be used by portable extensions to discover information about the
@@ -340,14 +340,14 @@
* if more than one active context exists for the given scope type
*/
public Context getContext(Class<? extends Annotation> scopeType);
-
+
/**
* Returns the ELResolver for integration with the servlet engine and JSF implementation
* This resolver will return a contextual instance of a bean if the name for resolution
* resolves to exactly one bean
*/
public ELResolver getELResolver();
-
+
/**
* Parse and validate the standard metadata defined by JSR-299 for the specified class,
* returning an InjectionTarget to allow injection into custom beans or
@@ -405,29 +405,4 @@
*/
public <T> ManagedBean<T> createManagedBean(AnnotatedType<T> type);
- /**
- * Create a new child activity. A child activity inherits all beans,
- * interceptors, decorators, observers, and contexts defined by its direct
- * and indirect parent activities.
- *
- * This method should not be called by the application.
- *
- * @return the child activity
- */
- public BeanManager createActivity();
-
- /**
- * Associate an activity with the current context for a normal scope
- *
- * @param scopeType
- * the scope to associate the activity with
- * @return the activity
- * @throws ContextNotActiveException
- * if the given scope is inactive
- * @throws IllegalArgumentException
- * if the given scope is not a normal scope
- */
- public BeanManager setCurrent(Class<? extends Annotation> scopeType);
-
-
}
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/manager/api/WebBeansManager.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/manager/api/WebBeansManager.java 2009-06-15 08:01:01 UTC (rev 2832)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/manager/api/WebBeansManager.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -18,7 +18,9 @@
package org.jboss.webbeans.manager.api;
import java.io.Serializable;
+import java.lang.annotation.Annotation;
+import javax.enterprise.context.ContextNotActiveException;
import javax.enterprise.inject.spi.BeanManager;
/**
@@ -30,7 +32,31 @@
*/
public interface WebBeansManager extends BeanManager, Serializable
{
-
+
public void shutdown();
-
+
+ /**
+ * Create a new child activity. A child activity inherits all beans,
+ * interceptors, decorators, observers, and contexts defined by its direct
+ * and indirect parent activities.
+ *
+ * This method should not be called by the application.
+ *
+ * @return the child activity
+ */
+ public WebBeansManager createActivity();
+
+ /**
+ * Associate an activity with the current context for a normal scope
+ *
+ * @param scopeType
+ * the scope to associate the activity with
+ * @return the activity
+ * @throws ContextNotActiveException
+ * if the given scope is inactive
+ * @throws IllegalArgumentException
+ * if the given scope is not a normal scope
+ */
+ public WebBeansManager setCurrent(Class<? extends Annotation> scopeType);
+
}
Modified: ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java
===================================================================
--- ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-06-15 08:01:01 UTC (rev 2832)
+++ ri/trunk/tests/src/main/java/org/jboss/webbeans/test/AbstractWebBeansTest.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -12,13 +12,15 @@
import java.util.List;
import java.util.Set;
+import javax.el.ELContext;
+import javax.enterprise.inject.TypeLiteral;
import javax.enterprise.inject.deployment.Production;
import javax.enterprise.inject.deployment.Standard;
import javax.enterprise.inject.spi.Bean;
import org.jboss.testharness.AbstractTest;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.CurrentManager;
-import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.mock.el.EL;
import org.jboss.webbeans.util.EnumerationIterable;
@@ -29,20 +31,20 @@
public abstract class AbstractWebBeansTest extends AbstractTest
{
-
+
protected abstract static class RunInDependentContext
{
-
+
protected void setup()
{
DependentContext.instance().setActive(true);
}
-
+
protected void cleanup()
{
DependentContext.instance().setActive(false);
}
-
+
public final void run() throws Exception
{
try
@@ -55,17 +57,17 @@
cleanup();
}
}
-
+
protected abstract void execute() throws Exception;
-
+
}
-
+
protected static final int BUILT_IN_BEANS = 3;
-
+
private BeanManagerImpl manager;
public static boolean visited = false;
-
+
@Override
@BeforeSuite
public void beforeSuite(ITestContext context) throws Exception
@@ -83,25 +85,25 @@
{
this.manager = CurrentManager.rootManager();
}
-
+
@AfterMethod
public void after() throws Exception
{
this.manager = null;
}
-
+
protected List<Class<? extends Annotation>> getEnabledDeploymentTypes()
{
return getDefaultDeploymentTypes();
}
-
+
@SuppressWarnings("unchecked")
protected final List<Class<? extends Annotation>> getDefaultDeploymentTypes()
{
return Arrays.asList(Standard.class, Production.class);
}
-
+
protected Iterable<URL> getResources(String name)
{
if (name.startsWith("/"))
@@ -121,7 +123,7 @@
throw new RuntimeException("Error loading resource from classloader" + name, e);
}
}
-
+
protected byte[] serialize(Object instance) throws IOException
{
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
@@ -140,7 +142,7 @@
{
return manager;
}
-
+
public boolean isExceptionInHierarchy(Throwable exception, Class<? extends Throwable> expectedException )
{
while (exception != null)
@@ -153,7 +155,7 @@
}
return false;
}
-
+
public <T> Bean<T> getBean(Type beanType, Annotation... bindings)
{
Set<Bean<?>> beans = getCurrentManager().getBeans(beanType, bindings);
@@ -169,16 +171,35 @@
Bean<T> bean = (Bean<T>) beans.iterator().next();
return bean;
}
-
+
@SuppressWarnings("unchecked")
+ public <T> Set<Bean<T>> getBeans(Class<T> type, Annotation... bindings)
+ {
+ return (Set) getCurrentManager().getBeans(type, bindings);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <T> Set<Bean<T>> getBeans(TypeLiteral<T> type, Annotation... bindings)
+ {
+ return (Set)getCurrentManager().getBeans(type.getType(), bindings);
+ }
+
+ @SuppressWarnings("unchecked")
public <T> T createContextualInstance(Class<T> beanType, Annotation... bindings)
{
return (T) createContextualInstance((Type) beanType, bindings);
}
-
+
public Object createContextualInstance(Type beanType, Annotation... bindings)
{
return getCurrentManager().getReference(getBean(beanType, bindings), beanType);
}
-
+
+ @SuppressWarnings("unchecked")
+ public <T> T evaluateValueExpression(String expression, Class<T> expectedType)
+ {
+ ELContext elContext = EL.createELContext();
+ return (T) EL.EXPRESSION_FACTORY.createValueExpression(elContext, expression, expectedType).getValue(elContext);
+ }
+
}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,290 @@
+package org.jboss.jsr299.tck.tests.activities;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Member;
+import java.lang.reflect.Type;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.UnsatisfiedResolutionException;
+import javax.enterprise.inject.deployment.Production;
+import javax.enterprise.inject.spi.Annotated;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.event.Observer;
+
+import org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle.MockCreationalContext;
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.bean.ForwardingBean;
+import org.jboss.webbeans.literal.CurrentLiteral;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
+@Artifact
+public class ActivitiesTest extends AbstractWebBeansTest
+{
+
+ private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>();
+
+ static
+ {
+ DEFAULT_BINDINGS.add(new CurrentLiteral());
+ }
+
+ private Bean<?> createDummyBean(BeanManager beanManager, final Type injectionPointType)
+ {
+ final Set<InjectionPoint> injectionPoints = new HashSet<InjectionPoint>();
+ final Set<Type> types = new HashSet<Type>();
+ final Set<Annotation> bindings = new HashSet<Annotation>();
+ bindings.add(new AnnotationLiteral<Tame>() {});
+ types.add(Object.class);
+ final Bean<?> bean = new Bean<Object>()
+ {
+
+ public Set<Annotation> getBindings()
+ {
+ return bindings;
+ }
+
+ public Class<? extends Annotation> getDeploymentType()
+ {
+ return Production.class;
+ }
+
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return injectionPoints;
+ }
+
+ public String getName()
+ {
+ return null;
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dependent.class;
+ }
+
+ public Set<Type> getTypes()
+ {
+ return types;
+ }
+
+ public boolean isNullable()
+ {
+ return false;
+ }
+
+ public boolean isSerializable()
+ {
+ return false;
+ }
+
+ public Object create(CreationalContext<Object> creationalContext)
+ {
+ return null;
+ }
+
+ public void destroy(Object instance, CreationalContext<Object> creationalContext)
+ {
+
+ }
+
+ };
+ InjectionPoint injectionPoint = new InjectionPoint()
+ {
+
+ public Bean<?> getBean()
+ {
+ return bean;
+ }
+
+ public Set<Annotation> getBindings()
+ {
+ return DEFAULT_BINDINGS;
+ }
+
+ public Member getMember()
+ {
+ return null;
+ }
+
+ public Type getType()
+ {
+ return injectionPointType;
+ }
+
+ public Annotated getAnnotated()
+ {
+ return null;
+ }
+
+ public boolean isDelegate()
+ {
+ return false;
+ }
+
+ public boolean isTransient()
+ {
+ return false;
+ }
+
+ };
+ injectionPoints.add(injectionPoint);
+ return bean;
+ }
+
+ private static class DummyContext implements Context
+ {
+
+ public <T> T get(Contextual<T> contextual)
+ {
+ return null;
+ }
+
+ public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext)
+ {
+ return null;
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dummy.class;
+ }
+
+ public boolean isActive()
+ {
+ return false;
+ }
+
+ }
+
+ @Test
+ public void testBeanBelongingToParentActivityBelongsToChildActivity()
+ {
+ assert getBeans(Cow.class).size() == 1;
+ Bean<?> bean = getBeans(Cow.class).iterator().next();
+ BeanManager childActivity = getCurrentManager().createActivity();
+ assert childActivity.getBeans(Cow.class).size() == 1;
+ assert childActivity.getBeans(Cow.class).iterator().next().equals(bean);
+ }
+
+ @Test
+ public void testBeanBelongingToParentActivityCanBeInjectedIntoChildActivityBean()
+ {
+ assert getBeans(Cow.class).size() == 1;
+ Bean<?> bean = getBeans(Cow.class).iterator().next();
+ BeanManager childActivity = getCurrentManager().createActivity();
+ Bean<?> dummyBean = createDummyBean(childActivity, Cow.class);
+ childActivity.addBean(dummyBean);
+ assert childActivity.getInjectableReference(dummyBean.getInjectionPoints().iterator().next(), new MockCreationalContext<Cow>()) != null;
+ }
+
+ @Test
+ public void testObserverBelongingToParentActivityBelongsToChildActivity()
+ {
+ assert getCurrentManager().resolveObservers(new NightTime()).size() == 1;
+ Observer<?> observer = getCurrentManager().resolveObservers(new NightTime()).iterator().next();
+ BeanManager childActivity = getCurrentManager().createActivity();
+ assert childActivity.resolveObservers(new NightTime()).size() == 1;
+ assert childActivity.resolveObservers(new NightTime()).iterator().next().equals(observer);
+ }
+
+ @Test
+ public void testObserverBelongingToParentFiresForChildActivity()
+ {
+ Fox.setObserved(false);
+ BeanManager childActivity = getCurrentManager().createActivity();
+ childActivity.fireEvent(new NightTime());
+ assert Fox.isObserved();
+ }
+
+ @Test
+ public void testContextObjectBelongingToParentBelongsToChild()
+ {
+ Context context = new DummyContext()
+ {
+
+ @Override
+ public boolean isActive()
+ {
+ return true;
+ }
+
+ };
+ getCurrentManager().addContext(context);
+ BeanManager childActivity = getCurrentManager().createActivity();
+ assert childActivity.getContext(Dummy.class) != null;
+ }
+
+ @Test
+ public void testBeanBelongingToChildActivityCannotBeInjectedIntoParentActivityBean()
+ {
+ assert getBeans(Cow.class).size() == 1;
+ BeanManager childActivity = getCurrentManager().createActivity();
+ Bean<?> dummyBean = createDummyBean(childActivity, Cow.class);
+ childActivity.addBean(dummyBean);
+ assert getBeans(Object.class, new AnnotationLiteral<Tame>() {}).size() == 0;
+ }
+
+ @Test(expectedExceptions=UnsatisfiedResolutionException.class)
+ public void testInstanceProcessedByParentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getBeans(Cow.class).size() == 1;
+ final Bean<Cow> bean = getBeans(Cow.class).iterator().next();
+ BeanManager childActivity = getCurrentManager().createActivity();
+ final Set<Annotation> bindingTypes = new HashSet<Annotation>();
+ bindingTypes.add(new AnnotationLiteral<Tame>() {});
+ childActivity.addBean(new ForwardingBean<Cow>()
+ {
+
+ @Override
+ protected Bean<Cow> delegate()
+ {
+ return bean;
+ }
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return bindingTypes;
+ }
+
+ });
+ createContextualInstance(Field.class).get();
+ }
+
+ @Test
+ public void testObserverBelongingToChildDoesNotFireForParentActivity()
+ {
+ BeanManager childActivity = getCurrentManager().createActivity();
+ Observer<NightTime> observer = new Observer<NightTime>()
+ {
+
+ public boolean notify(NightTime event)
+ {
+ assert false;
+ return false;
+ }
+
+ };
+ childActivity.addObserver(observer);
+ getCurrentManager().fireEvent(new NightTime());
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Cow.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Cow.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Cow.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.activities;
+
+class Cow
+{
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Dummy.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Dummy.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Dummy.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.jboss.jsr299.tck.tests.activities;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.ScopeType;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@ScopeType
+@Inherited
+@interface Dummy {}
\ No newline at end of file
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Field.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Field.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Field.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.activities;
+
+import javax.enterprise.inject.Instance;
+import javax.inject.Obtains;
+
+class Field
+{
+
+ @Obtains @Tame Instance<Cow> instance;
+
+ public Cow get()
+ {
+ return instance.get();
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Fox.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Fox.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Fox.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,25 @@
+package org.jboss.jsr299.tck.tests.activities;
+
+import javax.event.Observes;
+
+class Fox
+{
+
+ private static boolean observed = false;
+
+ public void observe(@Observes NightTime nighttime)
+ {
+ observed = true;
+ }
+
+ public static boolean isObserved()
+ {
+ return observed;
+ }
+
+ public static void setObserved(boolean observed)
+ {
+ Fox.observed = observed;
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/NightTime.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/NightTime.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/NightTime.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.activities;
+
+class NightTime
+{
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Tame.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Tame.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/Tame.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.activities;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/BeanWithInjection.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/BeanWithInjection.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/BeanWithInjection.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.activities.child;
+
+class BeanWithInjection
+{
+ @SpecialBindingType
+ protected MyBean myBean;
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/MyBean.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/MyBean.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/MyBean.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,7 @@
+package org.jboss.jsr299.tck.tests.activities.child;
+
+@SpecialBindingType
+class MyBean
+{
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/SameBeanTypeInChildActivityTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/SameBeanTypeInChildActivityTest.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/SameBeanTypeInChildActivityTest.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,118 @@
+package org.jboss.jsr299.tck.tests.activities.child;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.deployment.Production;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.inject.DeploymentException;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.literal.CurrentLiteral;
+import org.jboss.webbeans.manager.api.WebBeansManager;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
+@Artifact
+public class SameBeanTypeInChildActivityTest extends AbstractWebBeansTest
+{
+ private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>();
+
+ static
+ {
+ DEFAULT_BINDINGS.add(new CurrentLiteral());
+ }
+
+ private Bean<?> createDummyBean(BeanManager beanManager)
+ {
+ final Set<InjectionPoint> injectionPoints = new HashSet<InjectionPoint>();
+ final Set<Type> types = new HashSet<Type>();
+ final Set<Annotation> bindings = new HashSet<Annotation>();
+ bindings.add(new AnnotationLiteral<SpecialBindingType>() {});
+ types.add(Object.class);
+ final Bean<?> bean = new Bean<MyBean>()
+ {
+
+ public Set<Annotation> getBindings()
+ {
+ return bindings;
+ }
+
+ public Class<? extends Annotation> getDeploymentType()
+ {
+ return Production.class;
+ }
+
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return injectionPoints;
+ }
+
+ public String getName()
+ {
+ return null;
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dependent.class;
+ }
+
+ public Set<Type> getTypes()
+ {
+ return types;
+ }
+
+ public boolean isNullable()
+ {
+ return false;
+ }
+
+ public boolean isSerializable()
+ {
+ return false;
+ }
+
+ public MyBean create(CreationalContext<MyBean> creationalContext)
+ {
+ return null;
+ }
+
+ public void destroy(MyBean instance, CreationalContext<MyBean> creationalContext)
+ {
+
+ }
+
+ };
+ return bean;
+ }
+
+ @Test(groups = { "ri-broken" }, expectedExceptions = { DeploymentException.class })
+ public void testSameBeanTypeInChildAsParentInjection()
+ {
+ BeanManager childActivity = getCurrentManager().createActivity();
+ Bean<?> anotherMyBean = createDummyBean(childActivity);
+ childActivity.addBean(anotherMyBean);
+ }
+
+ @Test(groups = { "ri-broken" }, expectedExceptions = { DeploymentException.class })
+ public void testSameBeanTypeInChildAsIndirectParentInjection()
+ {
+ WebBeansManager childActivity = getCurrentManager().createActivity();
+ WebBeansManager grandChildActivity = childActivity.createActivity();
+ Bean<?> anotherMyBean = createDummyBean(grandChildActivity);
+ grandChildActivity.addBean(anotherMyBean);
+ }
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/SpecialBindingType.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/SpecialBindingType.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/child/SpecialBindingType.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,20 @@
+package org.jboss.jsr299.tck.tests.activities.child;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Retention(RUNTIME)
+@Target({TYPE, METHOD, FIELD, PARAMETER})
+@BindingType
+@interface SpecialBindingType
+{
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Cow.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Cow.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Cow.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+class Cow
+{
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Donkey.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Donkey.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Donkey.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import javax.enterprise.inject.spi.BeanManager;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+class Donkey
+{
+
+ BeanManager beanManager;
+
+ public Donkey() throws NamingException
+ {
+ beanManager = (BeanManager) new InitialContext().lookup("java:app/Manager");
+ }
+
+ public BeanManager getManager()
+ {
+ return beanManager;
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dummy.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dummy.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dummy.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.ScopeType;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@ScopeType
+@Inherited
+@interface Dummy {}
\ No newline at end of file
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Dusk.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,18 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import javax.enterprise.inject.Initializer;
+import javax.event.Event;
+import javax.enterprise.inject.Any;
+
+class Dusk
+{
+
+ @Initializer
+ public Dusk(@Any Event<NightTime> event)
+ {
+ event.fire(new NightTime());
+ }
+
+ public void ping() {}
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/ELCurrentActivityTest.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,158 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.deployment.Production;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.event.Observer;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.manager.api.WebBeansManager;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
+@Artifact
+public class ELCurrentActivityTest extends AbstractWebBeansTest
+{
+
+ static interface TestableObserver<T> extends Observer<T>
+ {
+
+ boolean isObserved();
+
+ }
+
+
+ private static class DummyContext implements Context
+ {
+
+ private boolean active = true;
+
+ public <T> T get(Contextual<T> contextual)
+ {
+ return null;
+ }
+
+ public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext)
+ {
+ return null;
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dummy.class;
+ }
+
+ public boolean isActive()
+ {
+ return active;
+ }
+
+ public void setActive(boolean active)
+ {
+ this.active = active;
+ }
+
+ }
+
+ private static class Daisy implements Bean<Cow>
+ {
+
+ private static final Set<Type> TYPES = new HashSet<Type>();
+
+ private final static Set<Annotation> BINDING_TYPES = new HashSet<Annotation>();
+
+
+ static
+ {
+ TYPES.add(Cow.class);
+ TYPES.add(Object.class);
+ BINDING_TYPES.add(new AnnotationLiteral<Tame>() {});
+ }
+
+ public Daisy(BeanManager beanManager)
+ {
+ }
+
+ public Set<Annotation> getBindings()
+ {
+ return BINDING_TYPES;
+ }
+
+ public Class<? extends Annotation> getDeploymentType()
+ {
+ return Production.class;
+ }
+
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return Collections.emptySet();
+ }
+
+ public String getName()
+ {
+ return "daisy";
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dependent.class;
+ }
+
+ public Set<Type> getTypes()
+ {
+ return TYPES;
+ }
+
+ public boolean isNullable()
+ {
+ return true;
+ }
+
+ public boolean isSerializable()
+ {
+ return false;
+ }
+
+ public Cow create(CreationalContext<Cow> creationalContext)
+ {
+ return new Cow();
+ }
+
+ public void destroy(Cow instance, CreationalContext<Cow> creationalContext)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ }
+
+ @Test
+ public void testELEvaluationProcessedByCurrentActivty()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getBeans(Cow.class).size() == 1;
+ WebBeansManager childActivity = getCurrentManager().createActivity();
+ childActivity.addBean(new Daisy(childActivity));
+ childActivity.setCurrent(dummyContext.getScopeType());
+ assert evaluateValueExpression("#{daisy}", Cow.class) != null;
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/EventCurrentActivityTest.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,93 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.event.Observer;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.manager.api.WebBeansManager;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
+@Artifact
+public class EventCurrentActivityTest extends AbstractWebBeansTest
+{
+
+ static interface TestableObserver<T> extends Observer<T>
+ {
+
+ boolean isObserved();
+
+ }
+
+
+ private static class DummyContext implements Context
+ {
+
+ private boolean active = true;
+
+ public <T> T get(Contextual<T> contextual)
+ {
+ return null;
+ }
+
+ public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext)
+ {
+ return null;
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dummy.class;
+ }
+
+ public boolean isActive()
+ {
+ return active;
+ }
+
+ public void setActive(boolean active)
+ {
+ this.active = active;
+ }
+
+ }
+
+ @Test
+ public void testEventProcessedByCurrentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ WebBeansManager childActivity = getCurrentManager().createActivity();
+ TestableObserver<NightTime> observer = new TestableObserver<NightTime>()
+ {
+
+ boolean observed = false;
+
+ public boolean notify(NightTime event)
+ {
+ observed = true;
+ return false;
+ }
+
+ public boolean isObserved()
+ {
+ return observed;
+ }
+
+ };
+ childActivity.addObserver(observer);
+ childActivity.setCurrent(dummyContext.getScopeType());
+ createContextualInstance(Dusk.class).ping();
+ assert observer.isObserved();
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Field.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Field.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Field.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import javax.enterprise.inject.Instance;
+import javax.inject.Obtains;
+
+class Field
+{
+
+ @Obtains @Tame Instance<Cow> instance;
+
+ public Cow get()
+ {
+ return instance.get();
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Horse.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Horse.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Horse.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,16 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import javax.enterprise.inject.Current;
+import javax.enterprise.inject.spi.BeanManager;
+
+class Horse
+{
+
+ @Current BeanManager beanManager;
+
+ public BeanManager getManager()
+ {
+ return beanManager;
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InactiveScopeTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InactiveScopeTest.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InactiveScopeTest.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,75 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.context.ContextNotActiveException;
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.event.Observer;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.manager.api.WebBeansManager;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
+@Artifact
+public class InactiveScopeTest extends AbstractWebBeansTest
+{
+
+ static interface TestableObserver<T> extends Observer<T>
+ {
+
+ boolean isObserved();
+
+ }
+
+
+ private static class DummyContext implements Context
+ {
+
+ private boolean active = true;
+
+ public <T> T get(Contextual<T> contextual)
+ {
+ return null;
+ }
+
+ public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext)
+ {
+ return null;
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dummy.class;
+ }
+
+ public boolean isActive()
+ {
+ return active;
+ }
+
+ public void setActive(boolean active)
+ {
+ this.active = active;
+ }
+
+ }
+
+ @Test(expectedExceptions=ContextNotActiveException.class)
+ public void testInactiveScope()
+ {
+ DummyContext dummyContext = new DummyContext();
+ dummyContext.setActive(false);
+ getCurrentManager().addContext(dummyContext);
+ WebBeansManager childActivity = getCurrentManager().createActivity();
+ childActivity.setCurrent(dummyContext.getScopeType());
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InjectedManagerCurrentActivityTest.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,74 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.event.Observer;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.manager.api.WebBeansManager;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
+@Artifact
+public class InjectedManagerCurrentActivityTest extends AbstractWebBeansTest
+{
+
+ static interface TestableObserver<T> extends Observer<T>
+ {
+
+ boolean isObserved();
+
+ }
+
+ private static class DummyContext implements Context
+ {
+
+ private boolean active = true;
+
+ public <T> T get(Contextual<T> contextual)
+ {
+ return null;
+ }
+
+ public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext)
+ {
+ return null;
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dummy.class;
+ }
+
+ public boolean isActive()
+ {
+ return active;
+ }
+
+ public void setActive(boolean active)
+ {
+ this.active = active;
+ }
+
+ }
+
+ @Test
+ public void testInjectedManagerIsCurrentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getBeans(Cow.class).size() == 1;
+ WebBeansManager childActivity = getCurrentManager().createActivity();
+ childActivity.setCurrent(dummyContext.getScopeType());
+ assert createContextualInstance(Horse.class).getManager().equals(childActivity);
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/InstanceCurrentActivityTest.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,171 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.context.Dependent;
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.AnnotationLiteral;
+import javax.enterprise.inject.deployment.Production;
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+import javax.enterprise.inject.spi.InjectionPoint;
+import javax.event.Observer;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.manager.api.WebBeansManager;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
+@Artifact
+public class InstanceCurrentActivityTest extends AbstractWebBeansTest
+{
+
+ static interface TestableObserver<T> extends Observer<T>
+ {
+
+ boolean isObserved();
+
+ }
+
+ public static class TameLiteral extends AnnotationLiteral<Tame> implements Tame {}
+
+
+ private static class DummyContext implements Context
+ {
+
+ private boolean active = true;
+
+ public <T> T get(Contextual<T> contextual)
+ {
+ return null;
+ }
+
+ public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext)
+ {
+ return null;
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dummy.class;
+ }
+
+ public boolean isActive()
+ {
+ return active;
+ }
+
+ public void setActive(boolean active)
+ {
+ this.active = active;
+ }
+
+ }
+
+ private static class NonNormalContext extends DummyContext
+ {
+
+ @Override
+ public Class<? extends Annotation> getScopeType()
+ {
+ return NonNormalScope.class;
+ }
+
+ }
+
+ private static class Daisy implements Bean<Cow>
+ {
+
+ private static final Set<Type> TYPES = new HashSet<Type>();
+
+ private final static Set<Annotation> BINDING_TYPES = new HashSet<Annotation>();
+
+
+ static
+ {
+ TYPES.add(Cow.class);
+ TYPES.add(Object.class);
+ BINDING_TYPES.add(new TameLiteral());
+ }
+
+ public Daisy(BeanManager beanManager)
+ {
+ }
+
+ public Set<Annotation> getBindings()
+ {
+ return BINDING_TYPES;
+ }
+
+ public Class<? extends Annotation> getDeploymentType()
+ {
+ return Production.class;
+ }
+
+ public Set<InjectionPoint> getInjectionPoints()
+ {
+ return Collections.emptySet();
+ }
+
+ public String getName()
+ {
+ return "daisy";
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dependent.class;
+ }
+
+ public Set<Type> getTypes()
+ {
+ return TYPES;
+ }
+
+ public boolean isNullable()
+ {
+ return true;
+ }
+
+ public boolean isSerializable()
+ {
+ return false;
+ }
+
+ public Cow create(CreationalContext<Cow> creationalContext)
+ {
+ return new Cow();
+ }
+
+ public void destroy(Cow instance, CreationalContext<Cow> creationalContext)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ }
+
+ @Test
+ public void testInstanceProcessedByCurrentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getBeans(Cow.class).size() == 1;
+ WebBeansManager childActivity = getCurrentManager().createActivity();
+ childActivity.addBean(new Daisy(childActivity));
+ childActivity.setCurrent(dummyContext.getScopeType());
+ assert createContextualInstance(Field.class).get() != null;
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/JndiManagerCurrentActivityTest.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,77 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.event.Observer;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.testharness.impl.packaging.IntegrationTest;
+import org.jboss.webbeans.manager.api.WebBeansManager;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
+@Artifact
+@IntegrationTest
+public class JndiManagerCurrentActivityTest extends AbstractWebBeansTest
+{
+
+ static interface TestableObserver<T> extends Observer<T>
+ {
+
+ boolean isObserved();
+
+ }
+
+
+ private static class DummyContext implements Context
+ {
+
+ private boolean active = true;
+
+ public <T> T get(Contextual<T> contextual)
+ {
+ return null;
+ }
+
+ public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext)
+ {
+ return null;
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dummy.class;
+ }
+
+ public boolean isActive()
+ {
+ return active;
+ }
+
+ public void setActive(boolean active)
+ {
+ this.active = active;
+ }
+
+ }
+
+ @Test
+ public void testJndiManagerIsCurrentActivity()
+ {
+ Context dummyContext = new DummyContext();
+ getCurrentManager().addContext(dummyContext);
+ assert getBeans(Cow.class).size() == 1;
+ WebBeansManager childActivity = getCurrentManager().createActivity();
+ childActivity.setCurrent(dummyContext.getScopeType());
+ assert createContextualInstance(Donkey.class).getManager().equals(childActivity);
+ }
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NightTime.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NightTime.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NightTime.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+class NightTime
+{
+
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScope.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScope.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScope.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,23 @@
+/**
+ *
+ */
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.context.ScopeType;
+
+@Target( { TYPE, METHOD, FIELD })
+@Retention(RUNTIME)
+@Documented
+@ScopeType(normal=false)
+@Inherited
+@interface NonNormalScope {}
\ No newline at end of file
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScopeTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScopeTest.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/NonNormalScopeTest.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,83 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import java.lang.annotation.Annotation;
+
+import javax.enterprise.context.spi.Context;
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+import javax.event.Observer;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.webbeans.manager.api.WebBeansManager;
+import org.jboss.webbeans.test.AbstractWebBeansTest;
+import org.testng.annotations.Test;
+
+/**
+ *
+ * Spec version: 20090519
+ *
+ */
+@Artifact
+public class NonNormalScopeTest extends AbstractWebBeansTest
+{
+
+ static interface TestableObserver<T> extends Observer<T>
+ {
+
+ boolean isObserved();
+
+ }
+
+
+ private static class DummyContext implements Context
+ {
+
+ private boolean active = true;
+
+ public <T> T get(Contextual<T> contextual)
+ {
+ return null;
+ }
+
+ public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext)
+ {
+ return null;
+ }
+
+ public Class<? extends Annotation> getScopeType()
+ {
+ return Dummy.class;
+ }
+
+ public boolean isActive()
+ {
+ return active;
+ }
+
+ public void setActive(boolean active)
+ {
+ this.active = active;
+ }
+
+ }
+
+ private static class NonNormalContext extends DummyContext
+ {
+
+ @Override
+ public Class<? extends Annotation> getScopeType()
+ {
+ return NonNormalScope.class;
+ }
+
+ }
+
+ @Test(expectedExceptions=IllegalArgumentException.class)
+ public void testNonNormalScope()
+ {
+ Context dummyContext = new NonNormalContext();
+ getCurrentManager().addContext(dummyContext);
+ WebBeansManager childActivity = getCurrentManager().createActivity();
+ childActivity.setCurrent(dummyContext.getScopeType());
+ }
+}
Added: ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Tame.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Tame.java (rev 0)
+++ ri/trunk/tests/src/test/java/org/jboss/jsr299/tck/tests/activities/current/Tame.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -0,0 +1,22 @@
+package org.jboss.jsr299.tck.tests.activities.current;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+import javax.enterprise.inject.BindingType;
+
+@Target( { TYPE, METHOD, PARAMETER, FIELD })
+@Retention(RUNTIME)
+@Documented
+@BindingType
+@interface Tame
+{
+
+}
Modified: ri/trunk/tests/unit-tests.xml
===================================================================
--- ri/trunk/tests/unit-tests.xml 2009-06-15 08:01:01 UTC (rev 2832)
+++ ri/trunk/tests/unit-tests.xml 2009-06-15 15:50:27 UTC (rev 2833)
@@ -44,6 +44,9 @@
<!-- <package name="org.jboss.jsr299.tck.tests.implementation.enterprise.lifecycle" />-->
<package name="org.jboss.webbeans.test.examples" />
<package name="org.jboss.webbeans.test.unit.bootstrap" />
+ <package name="org.jboss.webbeans.test.unit.activities" />
+ <package name="org.jboss.webbeans.test.unit.activities.current" />
+ <package name="org.jboss.webbeans.test.unit.activities.child" />
<package name="org.jboss.webbeans.test.unit.bootstrap.ordering" />
<package name="org.jboss.webbeans.test.unit.bootstrap.environments" />
<package name="org.jboss.webbeans.test.unit.bootstrap.environments.multipleEnterprise" />
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java 2009-06-15 08:01:01 UTC (rev 2832)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/ForwardingBean.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -12,7 +12,7 @@
public abstract class ForwardingBean<T> implements Bean<T>
{
- protected ForwardingBean(BeanManager beanManager)
+ protected ForwardingBean()
{
}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-06-15 08:01:01 UTC (rev 2832)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -1,305 +0,0 @@
-package org.jboss.jsr299.tck.tests.activities;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Member;
-import java.lang.reflect.Type;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.enterprise.context.Dependent;
-import javax.enterprise.context.spi.Context;
-import javax.enterprise.context.spi.Contextual;
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.AnnotationLiteral;
-import javax.enterprise.inject.UnsatisfiedResolutionException;
-import javax.enterprise.inject.deployment.Production;
-import javax.enterprise.inject.spi.Annotated;
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-import javax.enterprise.inject.spi.InjectionPoint;
-import javax.event.Observer;
-
-import org.hibernate.tck.annotations.SpecAssertion;
-import org.hibernate.tck.annotations.SpecAssertions;
-import org.jboss.jsr299.tck.AbstractJSR299Test;
-import org.jboss.jsr299.tck.ForwardingBean;
-import org.jboss.jsr299.tck.impl.MockCreationalContext;
-import org.jboss.jsr299.tck.literals.CurrentLiteral;
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.testng.annotations.Test;
-
-
-/**
- *
- * Spec version: 20090519
- *
- */
-@Artifact
-public class ActivitiesTest extends AbstractJSR299Test
-{
-
- private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>();
-
- static
- {
- DEFAULT_BINDINGS.add(new CurrentLiteral());
- }
-
- private Bean<?> createDummyBean(BeanManager beanManager, final Type injectionPointType)
- {
- final Set<InjectionPoint> injectionPoints = new HashSet<InjectionPoint>();
- final Set<Type> types = new HashSet<Type>();
- final Set<Annotation> bindings = new HashSet<Annotation>();
- bindings.add(new AnnotationLiteral<Tame>() {});
- types.add(Object.class);
- final Bean<?> bean = new Bean<Object>()
- {
-
- public Set<Annotation> getBindings()
- {
- return bindings;
- }
-
- public Class<? extends Annotation> getDeploymentType()
- {
- return Production.class;
- }
-
- public Set<InjectionPoint> getInjectionPoints()
- {
- return injectionPoints;
- }
-
- public String getName()
- {
- return null;
- }
-
- public Class<? extends Annotation> getScopeType()
- {
- return Dependent.class;
- }
-
- public Set<Type> getTypes()
- {
- return types;
- }
-
- public boolean isNullable()
- {
- return false;
- }
-
- public boolean isSerializable()
- {
- return false;
- }
-
- public Object create(CreationalContext<Object> creationalContext)
- {
- return null;
- }
-
- public void destroy(Object instance, CreationalContext<Object> creationalContext)
- {
-
- }
-
- };
- InjectionPoint injectionPoint = new InjectionPoint()
- {
-
- public Bean<?> getBean()
- {
- return bean;
- }
-
- public Set<Annotation> getBindings()
- {
- return DEFAULT_BINDINGS;
- }
-
- public Member getMember()
- {
- return null;
- }
-
- public Type getType()
- {
- return injectionPointType;
- }
-
- public Annotated getAnnotated()
- {
- return null;
- }
-
- public boolean isDelegate()
- {
- return false;
- }
-
- public boolean isTransient()
- {
- return false;
- }
-
- };
- injectionPoints.add(injectionPoint);
- return bean;
- }
-
- private static class DummyContext implements Context
- {
-
- public <T> T get(Contextual<T> contextual)
- {
- return null;
- }
-
- public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext)
- {
- return null;
- }
-
- public Class<? extends Annotation> getScopeType()
- {
- return Dummy.class;
- }
-
- public boolean isActive()
- {
- return false;
- }
-
- }
-
- @Test
- @SpecAssertions({
- @SpecAssertion(section="11.6", id="b"),
- @SpecAssertion(section="11.6", id="d")
- })
- public void testBeanBelongingToParentActivityBelongsToChildActivity()
- {
- assert getBeans(Cow.class).size() == 1;
- Bean<?> bean = getBeans(Cow.class).iterator().next();
- BeanManager childActivity = getCurrentManager().createActivity();
- assert childActivity.getBeans(Cow.class).size() == 1;
- assert childActivity.getBeans(Cow.class).iterator().next().equals(bean);
- }
-
- @Test
- @SpecAssertion(section="11.6", id="c")
- public void testBeanBelongingToParentActivityCanBeInjectedIntoChildActivityBean()
- {
- assert getBeans(Cow.class).size() == 1;
- Bean<?> bean = getBeans(Cow.class).iterator().next();
- BeanManager childActivity = getCurrentManager().createActivity();
- Bean<?> dummyBean = createDummyBean(childActivity, Cow.class);
- childActivity.addBean(dummyBean);
- assert childActivity.getInjectableReference(dummyBean.getInjectionPoints().iterator().next(), new MockCreationalContext<Cow>()) != null;
- }
-
- @Test
- @SpecAssertions({
- @SpecAssertion(section="11.6", id="j")
- })
- public void testObserverBelongingToParentActivityBelongsToChildActivity()
- {
- assert getCurrentManager().resolveObservers(new NightTime()).size() == 1;
- Observer<?> observer = getCurrentManager().resolveObservers(new NightTime()).iterator().next();
- BeanManager childActivity = getCurrentManager().createActivity();
- assert childActivity.resolveObservers(new NightTime()).size() == 1;
- assert childActivity.resolveObservers(new NightTime()).iterator().next().equals(observer);
- }
-
- @Test
- @SpecAssertion(section="11.6", id="k")
- public void testObserverBelongingToParentFiresForChildActivity()
- {
- Fox.setObserved(false);
- BeanManager childActivity = getCurrentManager().createActivity();
- childActivity.fireEvent(new NightTime());
- assert Fox.isObserved();
- }
-
- @Test
- @SpecAssertion(section="11.6", id="l")
- public void testContextObjectBelongingToParentBelongsToChild()
- {
- Context context = new DummyContext()
- {
-
- @Override
- public boolean isActive()
- {
- return true;
- }
-
- };
- getCurrentManager().addContext(context);
- BeanManager childActivity = getCurrentManager().createActivity();
- assert childActivity.getContext(Dummy.class) != null;
- }
-
- @Test
- @SpecAssertion(section="11.6", id="g")
- public void testBeanBelongingToChildActivityCannotBeInjectedIntoParentActivityBean()
- {
- assert getBeans(Cow.class).size() == 1;
- BeanManager childActivity = getCurrentManager().createActivity();
- Bean<?> dummyBean = createDummyBean(childActivity, Cow.class);
- childActivity.addBean(dummyBean);
- assert getBeans(Object.class, new AnnotationLiteral<Tame>() {}).size() == 0;
- }
-
- @Test(expectedExceptions=UnsatisfiedResolutionException.class)
- @SpecAssertion(section="11.6", id="i")
- public void testInstanceProcessedByParentActivity()
- {
- Context dummyContext = new DummyContext();
- getCurrentManager().addContext(dummyContext);
- assert getBeans(Cow.class).size() == 1;
- final Bean<Cow> bean = getBeans(Cow.class).iterator().next();
- BeanManager childActivity = getCurrentManager().createActivity();
- final Set<Annotation> bindingTypes = new HashSet<Annotation>();
- bindingTypes.add(new AnnotationLiteral<Tame>() {});
- childActivity.addBean(new ForwardingBean<Cow>(childActivity)
- {
-
- @Override
- protected Bean<Cow> delegate()
- {
- return bean;
- }
-
- @Override
- public Set<Annotation> getBindings()
- {
- return bindingTypes;
- }
-
- });
- getInstanceByType(Field.class).get();
- }
-
- @Test
- @SpecAssertion(section="11.6", id="f")
- public void testObserverBelongingToChildDoesNotFireForParentActivity()
- {
- BeanManager childActivity = getCurrentManager().createActivity();
- Observer<NightTime> observer = new Observer<NightTime>()
- {
-
- public boolean notify(NightTime event)
- {
- assert false;
- return false;
- }
-
- };
- childActivity.addObserver(observer);
- getCurrentManager().fireEvent(new NightTime());
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Cow.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Cow.java 2009-06-15 08:01:01 UTC (rev 2832)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Cow.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -1,6 +0,0 @@
-package org.jboss.jsr299.tck.tests.activities;
-
-class Cow
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Dummy.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Dummy.java 2009-06-15 08:01:01 UTC (rev 2832)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Dummy.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -1,23 +0,0 @@
-/**
- *
- */
-package org.jboss.jsr299.tck.tests.activities;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.enterprise.context.ScopeType;
-
-@Target( { TYPE, METHOD, FIELD })
-@Retention(RUNTIME)
-@Documented
-@ScopeType
-@Inherited
-@interface Dummy {}
\ No newline at end of file
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Field.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Field.java 2009-06-15 08:01:01 UTC (rev 2832)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Field.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -1,16 +0,0 @@
-package org.jboss.jsr299.tck.tests.activities;
-
-import javax.enterprise.inject.Instance;
-import javax.inject.Obtains;
-
-class Field
-{
-
- @Obtains @Tame Instance<Cow> instance;
-
- public Cow get()
- {
- return instance.get();
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Fox.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Fox.java 2009-06-15 08:01:01 UTC (rev 2832)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Fox.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -1,25 +0,0 @@
-package org.jboss.jsr299.tck.tests.activities;
-
-import javax.event.Observes;
-
-class Fox
-{
-
- private static boolean observed = false;
-
- public void observe(@Observes NightTime nighttime)
- {
- observed = true;
- }
-
- public static boolean isObserved()
- {
- return observed;
- }
-
- public static void setObserved(boolean observed)
- {
- Fox.observed = observed;
- }
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/NightTime.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/NightTime.java 2009-06-15 08:01:01 UTC (rev 2832)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/NightTime.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -1,6 +0,0 @@
-package org.jboss.jsr299.tck.tests.activities;
-
-class NightTime
-{
-
-}
Deleted: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Tame.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Tame.java 2009-06-15 08:01:01 UTC (rev 2832)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/Tame.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -1,22 +0,0 @@
-package org.jboss.jsr299.tck.tests.activities;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-import static java.lang.annotation.ElementType.TYPE;
-import static java.lang.annotation.RetentionPolicy.RUNTIME;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.Retention;
-import java.lang.annotation.Target;
-
-import javax.enterprise.inject.BindingType;
-
-@Target( { TYPE, METHOD, PARAMETER, FIELD })
-@Retention(RUNTIME)
-@Documented
-@BindingType
-@interface Tame
-{
-
-}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-06-15 08:01:01 UTC (rev 2832)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-06-15 15:50:27 UTC (rev 2833)
@@ -32,7 +32,7 @@
private Type type;
private Member member;
private Set<Annotation> bindings;
-
+
public MockInjectionPoint(Bean<?> bean, Type type, Member member,
Set<Annotation> bindings)
{
@@ -80,7 +80,7 @@
return false;
}
}
-
+
@Test
@SpecAssertions({
@SpecAssertion(section = "5.7.1", id = "c"),
@@ -89,42 +89,42 @@
public void testGetInstanceToInjectReturnsContextualInstance() throws Exception
{
Bean<Vanilla> vanillaBean = getBeans(Vanilla.class).iterator().next();
-
+
Field injectedField = InjectedBean.class.getField("vanilla");
Set<Annotation> bindings = new HashSet<Annotation>();
bindings.add(new CurrentLiteral());
MockInjectionPoint injectionPoint = new MockInjectionPoint(vanillaBean, Vanilla.class, injectedField, bindings);
-
+
assert getCurrentManager().getInjectableReference(injectionPoint, new MockCreationalContext<Object>()) instanceof Vanilla;
}
-
+
@Test(expectedExceptions = UnsatisfiedResolutionException.class)
@SpecAssertion(section = "5.7.1", id = "e")
public void testGetInstanceToInjectThrowsUnsatisfiedDependencyException() throws Exception
{
Bean<Vanilla> vanillaBean = getBeans(Vanilla.class).iterator().next();
-
+
Field injectedField = InjectedBean.class.getField("vanilla");
Set<Annotation> bindings = new HashSet<Annotation>();
bindings.add(new OtherLiteral());
MockInjectionPoint injectionPoint = new MockInjectionPoint(vanillaBean, Vanilla.class, injectedField, bindings);
-
+
assert getCurrentManager().getInjectableReference(injectionPoint, null) instanceof Vanilla;
}
-
+
@Test(expectedExceptions = UnsatisfiedResolutionException.class)
@SpecAssertion(section = "5.7.1", id = "f")
public void testGetInstanceToInjectThrowsAmbiguousDependencyException() throws Exception
{
Bean<Vanilla> vanillaBean = getBeans(Vanilla.class).iterator().next();
-
+
Field injectedField = InjectedBean.class.getField("vanilla");
Set<Annotation> bindings = new HashSet<Annotation>();
bindings.add(new OtherLiteral());
MockInjectionPoint injectionPoint = new MockInjectionPoint(vanillaBean, Vanilla.class, injectedField, bindings);
getCurrentManager().getInjectableReference(injectionPoint, null);
}
-
+
@Test(expectedExceptions=UnproxyableResolutionException.class)
@SpecAssertion(section = "5.7.1", id = "g")
public void testGetInstanceToInjectThrowsUnproxyableDependencyException() throws Exception
@@ -132,8 +132,8 @@
final Bean<Mustard> bean = getBeans(Mustard.class).iterator().next();
final Set<Annotation> bindings = new HashSet<Annotation>();
bindings.add(new OtherLiteral());
-
- Bean<Mustard> wrappedBean = new ForwardingBean<Mustard>(getCurrentManager())
+
+ Bean<Mustard> wrappedBean = new ForwardingBean<Mustard>()
{
@Override
@@ -141,29 +141,29 @@
{
return bean;
}
-
+
@Override
public Class<? extends Annotation> getScopeType()
{
return RequestScoped.class;
}
-
+
@Override
public Set<Annotation> getBindings()
{
return bindings;
}
-
+
@Override
public boolean equals(Object obj)
{
return this == obj;
}
-
+
};
-
+
getCurrentManager().addBean(wrappedBean);
-
+
Field injectedField = BrokenInjectedBean.class.getField("mustard");
MockInjectionPoint injectionPoint = new MockInjectionPoint(bean, Mustard.class, injectedField, bindings);
getCurrentManager().getInjectableReference(injectionPoint, null);
14 years, 10 months
[webbeans-commits] Webbeans SVN: r2832 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/bean and 7 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-15 04:01:01 -0400 (Mon, 15 Jun 2009)
New Revision: 2832
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableWBClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBField.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMember.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotation.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBField.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMember.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBMember.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/AnnotationModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/BindingTypeModel.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
Log:
Start to merge Annotated* into core
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -119,7 +119,7 @@
{
throw new UnproxyableResolutionException("The injection point " + injectionPoint + " has non-proxyable dependencies");
}
- if (Reflections.isPrimitive(annotatedItem.getRawType()) && resolvedBean.isNullable())
+ if (Reflections.isPrimitive(annotatedItem.getJavaClass()) && resolvedBean.isNullable())
{
throw new NullableDependencyException("The injection point " + injectionPoint + " has nullable dependencies");
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -300,7 +300,7 @@
for (WBInjectionPoint<?, ?> injectionPoint : getAnnotatedInjectionPoints())
{
Annotation[] bindings = injectionPoint.getMetaAnnotationsAsArray(BindingType.class);
- Bean<?> resolvedBean = manager.getBeans(injectionPoint.getRawType(), bindings).iterator().next();
+ Bean<?> resolvedBean = manager.getBeans(injectionPoint.getJavaClass(), bindings).iterator().next();
if (passivating)
{
if (Dependent.class.equals(resolvedBean.getScopeType()) && !resolvedBean.isSerializable() && (((injectionPoint instanceof WBField) && !((WBField<?>) injectionPoint).isTransient()) || (injectionPoint instanceof WBParameter)) )
@@ -346,7 +346,7 @@
{
throw new DefinitionException("type: " + getType() + " must specify a deployment type");
}
- else if (deploymentType.equals(Standard.class) && !STANDARD_WEB_BEAN_CLASSES.contains(getAnnotatedItem().getRawType()))
+ else if (deploymentType.equals(Standard.class) && !STANDARD_WEB_BEAN_CLASSES.contains(getAnnotatedItem().getJavaClass()))
{
throw new DefinitionException(getAnnotatedItem().getName() + " cannot have deployment type @Standard");
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -124,7 +124,7 @@
protected void initType()
{
log.trace("Bean type specified in Java");
- this.type = getAnnotatedItem().getRawType();
+ this.type = getAnnotatedItem().getJavaClass();
this.dependencies = new HashSet<String>();
for (Class<?> clazz = type.getSuperclass(); clazz != Object.class; clazz = clazz.getSuperclass())
{
@@ -272,7 +272,7 @@
protected void preSpecialize(BeanDeployerEnvironment environment)
{
super.preSpecialize(environment);
- if (getAnnotatedItem().getSuperclass() == null || getAnnotatedItem().getSuperclass().getRawType().equals(Object.class))
+ if (getAnnotatedItem().getSuperclass() == null || getAnnotatedItem().getSuperclass().getJavaClass().equals(Object.class))
{
throw new DefinitionException("Specializing bean must extend another bean " + toString());
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -126,11 +126,11 @@
{
try
{
- this.type = getAnnotatedItem().getRawType();
+ this.type = getAnnotatedItem().getJavaClass();
}
catch (ClassCastException e)
{
- throw new RuntimeException(" Cannot cast producer type " + getAnnotatedItem().getRawType() + " to bean type " + (getDeclaredBeanType() == null ? " unknown " : getDeclaredBeanType()), e);
+ throw new RuntimeException(" Cannot cast producer type " + getAnnotatedItem().getJavaClass() + " to bean type " + (getDeclaredBeanType() == null ? " unknown " : getDeclaredBeanType()), e);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -132,7 +132,7 @@
{
if (decoratedType instanceof Class)
{
- if (!((Class<?>) decoratedType).isAssignableFrom(decorates.getRawType()))
+ if (!((Class<?>) decoratedType).isAssignableFrom(decorates.getJavaClass()))
{
throw new DefinitionException("The delegate type must extend or implement every decorated type. Decorated type " + decoratedType + "." + this );
}
@@ -146,7 +146,7 @@
}
if (!Arrays.equals(decorates.getActualTypeArguments(), parameterizedType.getActualTypeArguments()));
Type rawType = ((ParameterizedType) decoratedType).getRawType();
- if (rawType instanceof Class && !((Class<?>) rawType).isAssignableFrom(decorates.getRawType()))
+ if (rawType instanceof Class && !((Class<?>) rawType).isAssignableFrom(decorates.getJavaClass()))
{
throw new DefinitionException("The delegate type must extend or implement every decorated type. Decorated type " + decoratedType + "." + this );
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -69,7 +69,7 @@
@SuppressWarnings("unchecked")
protected void initType()
{
- this.type = (Class<T>) disposalMethodInjectionPoint.getAnnotatedParameters(Disposes.class).get(0).getRawType();
+ this.type = (Class<T>) disposalMethodInjectionPoint.getAnnotatedParameters(Disposes.class).get(0).getJavaClass();
}
@Override
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -194,7 +194,7 @@
protected void preSpecialize(BeanDeployerEnvironment environment)
{
super.preSpecialize(environment);
- if (!environment.getEjbDescriptors().containsKey(getAnnotatedItem().getSuperclass().getRawType()))
+ if (!environment.getEjbDescriptors().containsKey(getAnnotatedItem().getSuperclass().getJavaClass()))
{
throw new DefinitionException("Annotation defined specializing EJB must have EJB superclass");
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -372,7 +372,7 @@
protected void preSpecialize(BeanDeployerEnvironment environment)
{
super.preSpecialize(environment);
- if (environment.getEjbDescriptors().containsKey(getAnnotatedItem().getSuperclass().getRawType()))
+ if (environment.getEjbDescriptors().containsKey(getAnnotatedItem().getSuperclass().getJavaClass()))
{
throw new DefinitionException("Simple bean must specialize a simple bean");
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -120,7 +120,7 @@
{
for (WBClass<?> clazz : classes)
{
- if (environment.getEjbDescriptors().containsKey(clazz.getRawType()))
+ if (environment.getEjbDescriptors().containsKey(clazz.getJavaClass()))
{
createEnterpriseBean(clazz);
}
@@ -316,7 +316,7 @@
*/
private boolean isTypeManagedBeanOrDecorator(WBClass<?> clazz)
{
- Class<?> rawType = clazz.getRawType();
+ Class<?> rawType = clazz.getJavaClass();
EJBApiAbstraction ejbApiAbstraction = manager.getServices().get(EJBApiAbstraction.class);
JsfApiAbstraction jsfApiAbstraction = manager.getServices().get(JsfApiAbstraction.class);
ServletApiAbstraction servletApiAbstraction = manager.getServices().get(ServletApiAbstraction.class);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -21,6 +21,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Member;
import java.lang.reflect.Type;
import java.util.AbstractList;
import java.util.Iterator;
@@ -173,9 +174,14 @@
public Type getType()
{
- return getRawType();
+ return getJavaClass();
}
+ public Member getMember()
+ {
+ return getJavaMember();
+ }
+
public Annotated getAnnotated()
{
return delegate();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -20,6 +20,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
+import java.lang.reflect.Member;
import java.lang.reflect.Type;
import java.util.Set;
@@ -114,4 +115,10 @@
return getBaseType();
}
+ public Member getMember()
+ {
+ return getJavaMember();
+ }
+
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -20,6 +20,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.AbstractList;
@@ -285,4 +286,9 @@
return getBaseType();
}
+ public Member getMember()
+ {
+ return getJavaMember();
+ }
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -64,9 +64,9 @@
return delegate().getBindings();
}
- public Member getMember()
+ public Member getJavaMember()
{
- return delegate().getDeclaringMember().getMember();
+ return delegate().getDeclaringMember().getJavaMember();
}
public void inject(Object declaringInstance, Object value)
@@ -102,4 +102,10 @@
return getBaseType();
}
+ public Member getMember()
+ {
+ return getJavaMember();
+ }
+
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableWBClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableWBClass.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableWBClass.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -160,7 +160,7 @@
}
@Override
- public Class<T> getRawType()
+ public Class<T> getJavaClass()
{
return rawType;
}
@@ -194,7 +194,7 @@
@Override
public Type getBaseType()
{
- return getRawType();
+ return getJavaClass();
}
public boolean isAssignableTo(Class<?> clazz)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -68,9 +68,9 @@
return delegate().getName();
}
- public Class<T> getRawType()
+ public Class<T> getJavaClass()
{
- return delegate().getRawType();
+ return delegate().getJavaClass();
}
public boolean isAssignableFrom(WBAnnotated<?, ?> that)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBField.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBField.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBField.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -29,11 +29,6 @@
return delegate().get(instance);
}
- public Field getAnnotatedField()
- {
- return delegate().getAnnotatedField();
- }
-
public WBType<?> getDeclaringType()
{
return delegate().getDeclaringType();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMember.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMember.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMember.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -24,9 +24,9 @@
@Override
protected abstract WBMember<T, S> delegate();
- public S getMember()
+ public S getJavaMember()
{
- return delegate().getMember();
+ return delegate().getJavaMember();
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -117,7 +117,7 @@
*
* @return The type of the element
*/
- public Class<T> getRawType();
+ public Class<T> getJavaClass();
/**
* Extends Java Class assignability such that actual type parameters are also
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotation.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotation.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotation.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -33,7 +33,7 @@
* @return A set of abstracted members
*/
public Set<WBMethod<?>> getMembers();
-
+
/**
* Gets all the members annotated with annotationType
*
@@ -41,7 +41,7 @@
* @return A set of abstracted members with the annotation type
*/
public Set<WBMethod<?>> getAnnotatedMembers(Class<? extends Annotation> annotationType);
-
+
/**
* Get an annotation member by name
*
@@ -49,7 +49,7 @@
* @return
*/
public <A> WBMethod<A> getMember(String memberName, WBClass<A> expectedType);
-
- public Class<T> getRawType();
-
+
+ public Class<T> getJavaClass();
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBField.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBField.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBField.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -29,13 +29,6 @@
{
/**
- * Gets the annotated field
- *
- * @return The annotated field
- */
- public Field getAnnotatedField();
-
- /**
* Injects an instance
*
*
@@ -47,13 +40,6 @@
public T get(Object instance);
/**
- * Gets an abstraction of the declaring class
- *
- * @return The declaring class
- */
- public WBType<?> getDeclaringType();
-
- /**
* Gets the property name of the field
*
* @return The name
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMember.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMember.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMember.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -26,7 +26,7 @@
public interface WBMember<T, S extends Member> extends WBAnnotated<T, S>
{
- public S getMember();
+ public S getJavaMember();
/**
* Gets an abstraction of the declaring class
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -162,7 +162,7 @@
if (other instanceof WBAnnotated)
{
WBAnnotated<?, ?> that = (WBAnnotated<?, ?>) other;
- return this.getAnnotations().equals(that.getAnnotations()) && this.getRawType().equals(that.getRawType());
+ return this.getAnnotations().equals(that.getAnnotations()) && this.getJavaClass().equals(that.getJavaClass());
}
return false;
}
@@ -178,12 +178,12 @@
*/
public boolean isAssignableFrom(WBAnnotated<?, ?> that)
{
- return isAssignableFrom(that.getRawType(), that.getActualTypeArguments());
+ return isAssignableFrom(that.getJavaClass(), that.getActualTypeArguments());
}
public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
{
- return Reflections.isAssignableFrom(getRawType(), getActualTypeArguments(), type, actualTypeArguments);
+ return Reflections.isAssignableFrom(getJavaClass(), getActualTypeArguments(), type, actualTypeArguments);
}
public boolean isAssignableFrom(Type type)
@@ -199,7 +199,7 @@
@Override
public int hashCode()
{
- return getRawType().hashCode();
+ return getJavaClass().hashCode();
}
/**
@@ -252,7 +252,7 @@
return proxyable;
}
- public Class<T> getRawType()
+ public Class<T> getJavaClass()
{
return rawType;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBMember.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBMember.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBMember.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -136,7 +136,7 @@
return toString;
}
- public S getMember()
+ public S getJavaMember()
{
return getDelegate();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -32,7 +32,7 @@
this.parameterTypes = new String[method.getParameters().size()];
for (int i = 0; i < method.getParameters().size(); i++)
{
- parameterTypes[i] = method.getParameters().get(i).getRawType().getName();
+ parameterTypes[i] = method.getParameters().get(i).getJavaClass().getName();
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -36,7 +36,7 @@
this.parameterTypes = new String[method.getParameters().size()];
for (int i = 0; i < method.getParameters().size(); i++)
{
- parameterTypes[i] = method.getParameters().get(i).getRawType().getName();
+ parameterTypes[i] = method.getParameters().get(i).getJavaClass().getName();
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -248,7 +248,7 @@
*/
public Class<? extends T> getAnnotatedClass()
{
- return getRawType();
+ return getJavaClass();
}
/**
@@ -258,7 +258,7 @@
*/
public Class<T> getDelegate()
{
- return getRawType();
+ return getJavaClass();
}
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -145,7 +145,7 @@
buffer.append("static ");
if (_final)
buffer.append("final ");
- buffer.append(getRawType().getName());
+ buffer.append(getJavaClass().getName());
buffer.append(" for operation ");
buffer.append(getDeclaringMember().toString());
toString = buffer.toString();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/AnnotationModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/AnnotationModel.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/AnnotationModel.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -81,7 +81,7 @@
*/
public Class<T> getRawType()
{
- return annotatedAnnotation.getRawType();
+ return annotatedAnnotation.getJavaClass();
}
/**
@@ -119,7 +119,7 @@
@Override
public String toString()
{
- return (isValid() ? "Valid" : "Invalid") + " annotation model for " + getRawType();
+ return (isValid() ? "Valid" : "Invalid") + " annotation model for " + getRawType();
}
-
+
}
\ No newline at end of file
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/BindingTypeModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/BindingTypeModel.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/BindingTypeModel.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -69,7 +69,7 @@
{
for (WBMethod<?> annotatedMethod : getAnnotatedAnnotation().getMembers())
{
- if ((Reflections.isArrayType(annotatedMethod.getRawType()) || Annotation.class.isAssignableFrom(annotatedMethod.getRawType())) && !nonBindingTypes.contains(annotatedMethod))
+ if ((Reflections.isArrayType(annotatedMethod.getJavaClass()) || Annotation.class.isAssignableFrom(annotatedMethod.getJavaClass())) && !nonBindingTypes.contains(annotatedMethod))
{
throw new DefinitionException("Member of array type or annotation type must be annotated @NonBinding " + annotatedMethod);
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-06-15 03:46:15 UTC (rev 2831)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-06-15 08:01:01 UTC (rev 2832)
@@ -27,7 +27,7 @@
WBClass<Order> annotatedElement = WBClassImpl.of(Order.class, transformer);
assert annotatedElement.getAnnotations().size() == 1;
assert annotatedElement.getAnnotation(Production.class) != null;
- assert annotatedElement.getRawType().equals(Order.class);
+ assert annotatedElement.getJavaClass().equals(Order.class);
}
@Test
14 years, 10 months
[webbeans-commits] Webbeans SVN: r2831 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-06-14 23:46:15 -0400 (Sun, 14 Jun 2009)
New Revision: 2831
Modified:
tck/trunk/impl/src/main/resources/README.TXT
Log:
updated sigtest readme
Modified: tck/trunk/impl/src/main/resources/README.TXT
===================================================================
--- tck/trunk/impl/src/main/resources/README.TXT 2009-06-15 03:33:54 UTC (rev 2830)
+++ tck/trunk/impl/src/main/resources/README.TXT 2009-06-15 03:46:15 UTC (rev 2831)
@@ -1,10 +1,11 @@
Notes on using Sigtest
------------------------------------------
+======================
+
Sigtest home page: https://sigtest.dev.java.net/
User Guide: http://java.sun.com/javame/sigtest/docs/sigtest2.1_usersguide.pdf
Generating a signature file
----------------------------
+===========================
The general command for generating a signature file looks like this:
java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.Setup -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static
@@ -13,3 +14,51 @@
java -cp %JAVA_HOME%\jre\lib\rt.jar;c:/java/sigtest-2.0/lib/sigtestdev.jar com.sun.tdk.signaturetest.Setup -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar;"C:\Documents and Settings\shane\.m2\repository\org\jboss\webbeans\jsr299-api\1.0.0-SNAPSHOT\jsr299-api-1.0.0-SNAPSHOT.jar";"C:\Documents and Settings\shane\.m2\repository\javax\el\el-api\1.2\el-api-1.2.jar" -static
+Running the signature test
+==========================
+To run the signature test simply change the execution class from Setup to SignatureTest:
+
+java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.SignatureTest -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static
+
+Here's a working example:
+
+java -cp %JAVA_HOME%\jre\lib\rt.jar;c:/java/sigtest-2.0/lib/sigtestdev.jar com.sun.tdk.signaturetest.SignatureTest -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar;"C:\Documents and Settings\shane\.m2\repository\org\jboss\webbeans\jsr299-api\1.0.0-SNAPSHOT\jsr299-api-1.0.0-SNAPSHOT.jar";"C:\Documents and Settings\shane\.m2\repository\javax\el\el-api\1.2\el-api-1.2.jar" -static
+
+
+When running the signature test, you may get the following message:
+
+ "The return type java.lang.reflect.Member can't be resolved"
+
+This can safely be ignored, the important thing is to get the "STATUS:Passed." message.
+
+Forcing a signature test failure
+================================
+Just for fun (and to confirm that the signature test is working correctly), you can try the following:
+
+1) Edit webbeans.sig
+2) Modify one of the class signatures - in the following example we change one of the constructors for NullableDependencyException - here's the original:
+
+CLSS public javax.inject.NullableDependencyException
+cons public NullableDependencyException()
+cons public NullableDependencyException(java.lang.String)
+
+Let's change the constructor parameter to a java.lang.Integer instead:
+
+CLSS public javax.inject.NullableDependencyException
+cons public NullableDependencyException()
+cons public NullableDependencyException(java.lang.Integer)
+
+3) Now we run the signature test using the above command, which should result in the following errors:
+
+Missing Constructors
+--------------------
+
+javax.inject.NullableDependencyException: constructor public javax.inject.NullableDependencyException.NullableDependencyException(java.lang.Integer)
+
+Added Constructors
+------------------
+
+javax.inject.NullableDependencyException: constructor public javax.inject.NullableDependencyException.NullableDependencyException(java.lang.String)
+
+
+STATUS:Failed.2 errors
\ No newline at end of file
14 years, 10 months
[webbeans-commits] Webbeans SVN: r2830 - tck/trunk/impl/src/main/resources.
by webbeans-commits@lists.jboss.org
Author: shane.bryzak(a)jboss.com
Date: 2009-06-14 23:33:54 -0400 (Sun, 14 Jun 2009)
New Revision: 2830
Modified:
tck/trunk/impl/src/main/resources/README.TXT
tck/trunk/impl/src/main/resources/webbeans.sig
Log:
updated sigtest signatures
Modified: tck/trunk/impl/src/main/resources/README.TXT
===================================================================
--- tck/trunk/impl/src/main/resources/README.TXT 2009-06-14 20:29:43 UTC (rev 2829)
+++ tck/trunk/impl/src/main/resources/README.TXT 2009-06-15 03:33:54 UTC (rev 2830)
@@ -5,6 +5,11 @@
Generating a signature file
---------------------------
-To generate a signature file, use the following command:
+The general command for generating a signature file looks like this:
-java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.Setup -Package javax.annotation -Package javax.context -Package javax.decorator -Package javax.event -Package javax.inject -Package javax.interceptor -Package javax.webbeans -FileName webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static -Exclude java
\ No newline at end of file
+java -cp %JAVA_HOME%\jre\lib\rt.jar%;sigtestdev.jar com.sun.tdk.signaturetest.Setup -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar -static
+
+Here's a working example with the classpaths filled out:
+
+java -cp %JAVA_HOME%\jre\lib\rt.jar;c:/java/sigtest-2.0/lib/sigtestdev.jar com.sun.tdk.signaturetest.Setup -Package javax.decorator -Package javax.enterprise -Package javax.event -Package javax.inject -Package javax.interceptor -FileName webbeans.sig -Classpath .;%JAVA_HOME%\jre\lib\rt.jar;"C:\Documents and Settings\shane\.m2\repository\org\jboss\webbeans\jsr299-api\1.0.0-SNAPSHOT\jsr299-api-1.0.0-SNAPSHOT.jar";"C:\Documents and Settings\shane\.m2\repository\javax\el\el-api\1.2\el-api-1.2.jar" -static
+
Modified: tck/trunk/impl/src/main/resources/webbeans.sig
===================================================================
--- tck/trunk/impl/src/main/resources/webbeans.sig 2009-06-14 20:29:43 UTC (rev 2829)
+++ tck/trunk/impl/src/main/resources/webbeans.sig 2009-06-15 03:33:54 UTC (rev 2830)
@@ -1,249 +1,527 @@
#Signature file v4.0
#Version
-CLSS public abstract interface !annotation javax.annotation.Generated
+CLSS public abstract interface java.io.Serializable
+
+CLSS public abstract interface java.lang.Comparable<%0 extends java.lang.Object>
+meth public abstract int compareTo({java.lang.Comparable%0})
+
+CLSS public abstract java.lang.Enum<%0 extends java.lang.Enum<{java.lang.Enum%0}>>
+cons protected Enum(java.lang.String,int)
+intf java.io.Serializable
+intf java.lang.Comparable<{java.lang.Enum%0}>
+meth protected final java.lang.Object clone() throws java.lang.CloneNotSupportedException
+meth protected final void finalize()
+meth public final boolean equals(java.lang.Object)
+meth public final int compareTo({java.lang.Enum%0})
+meth public final int hashCode()
+meth public final int ordinal()
+meth public final java.lang.Class<{java.lang.Enum%0}> getDeclaringClass()
+meth public final java.lang.String name()
+meth public java.lang.String toString()
+meth public static <%0 extends java.lang.Enum<{%%0}>> {%%0} valueOf(java.lang.Class<{%%0}>,java.lang.String)
+supr java.lang.Object
+hfds name,ordinal
+
+CLSS public java.lang.Exception
+cons public Exception()
+cons public Exception(java.lang.String)
+cons public Exception(java.lang.String,java.lang.Throwable)
+cons public Exception(java.lang.Throwable)
+supr java.lang.Throwable
+hfds serialVersionUID
+
+CLSS public abstract interface java.lang.Iterable<%0 extends java.lang.Object>
+meth public abstract java.util.Iterator<{java.lang.Iterable%0}> iterator()
+
+CLSS public java.lang.Object
+cons public Object()
+meth protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
+meth protected void finalize() throws java.lang.Throwable
+meth public boolean equals(java.lang.Object)
+meth public final java.lang.Class<?> getClass()
+meth public final void notify()
+meth public final void notifyAll()
+meth public final void wait() throws java.lang.InterruptedException
+meth public final void wait(long) throws java.lang.InterruptedException
+meth public final void wait(long,int) throws java.lang.InterruptedException
+meth public int hashCode()
+meth public java.lang.String toString()
+
+CLSS public java.lang.RuntimeException
+cons public RuntimeException()
+cons public RuntimeException(java.lang.String)
+cons public RuntimeException(java.lang.String,java.lang.Throwable)
+cons public RuntimeException(java.lang.Throwable)
+supr java.lang.Exception
+hfds serialVersionUID
+
+CLSS public java.lang.Throwable
+cons public Throwable()
+cons public Throwable(java.lang.String)
+cons public Throwable(java.lang.String,java.lang.Throwable)
+cons public Throwable(java.lang.Throwable)
+intf java.io.Serializable
+meth public java.lang.StackTraceElement[] getStackTrace()
+meth public java.lang.String getLocalizedMessage()
+meth public java.lang.String getMessage()
+meth public java.lang.String toString()
+meth public java.lang.Throwable fillInStackTrace()
+meth public java.lang.Throwable getCause()
+meth public java.lang.Throwable initCause(java.lang.Throwable)
+meth public void printStackTrace()
+meth public void printStackTrace(java.io.PrintStream)
+meth public void printStackTrace(java.io.PrintWriter)
+meth public void setStackTrace(java.lang.StackTraceElement[])
+supr java.lang.Object
+hfds backtrace,cause,detailMessage,serialVersionUID,stackTrace
+
+CLSS public abstract interface java.lang.annotation.Annotation
+meth public abstract boolean equals(java.lang.Object)
+meth public abstract int hashCode()
+meth public abstract java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
+meth public abstract java.lang.String toString()
+
+CLSS public abstract interface !annotation java.lang.annotation.Documented
anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=SOURCE)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[PACKAGE, TYPE, ANNOTATION_TYPE, METHOD, CONSTRUCTOR, FIELD, LOCAL_VARIABLE, PARAMETER])
+ anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE])
intf java.lang.annotation.Annotation
-meth public abstract !hasdefault java.lang.String comments()
-meth public abstract !hasdefault java.lang.String date()
-meth public abstract java.lang.String[] value()
-CLSS public abstract interface !annotation javax.annotation.Named
+CLSS public abstract interface !annotation java.lang.annotation.Inherited
anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD])
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE])
intf java.lang.annotation.Annotation
-meth public abstract !hasdefault java.lang.String value()
-CLSS public abstract interface !annotation javax.annotation.NonBinding
+CLSS public abstract interface !annotation java.lang.annotation.Retention
+ anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD])
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE])
intf java.lang.annotation.Annotation
+meth public abstract java.lang.annotation.RetentionPolicy value()
-CLSS public abstract interface !annotation javax.annotation.PostConstruct
+CLSS public abstract interface !annotation java.lang.annotation.Target
anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD])
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE])
intf java.lang.annotation.Annotation
+meth public abstract java.lang.annotation.ElementType[] value()
-CLSS public abstract interface !annotation javax.annotation.PreDestroy
+CLSS public abstract interface !annotation javax.decorator.Decorates
anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD])
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[FIELD])
intf java.lang.annotation.Annotation
-CLSS public abstract interface !annotation javax.annotation.Resource
+CLSS public abstract interface !annotation javax.decorator.Decorator
+ anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, FIELD, METHOD])
-innr public final static !enum AuthenticationType
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE])
+ anno 0 javax.enterprise.inject.Stereotype(java.lang.Class<? extends java.lang.annotation.Annotation>[] supportedScopes=[], java.lang.Class<?>[] requiredTypes=[])
intf java.lang.annotation.Annotation
-meth public abstract !hasdefault boolean shareable()
-meth public abstract !hasdefault java.lang.Class type()
-meth public abstract !hasdefault java.lang.String description()
-meth public abstract !hasdefault java.lang.String mappedName()
-meth public abstract !hasdefault java.lang.String name()
-meth public abstract !hasdefault javax.annotation.Resource$AuthenticationType authenticationType()
-CLSS public final static !enum javax.annotation.Resource$AuthenticationType
-fld public final static javax.annotation.Resource$AuthenticationType APPLICATION
-fld public final static javax.annotation.Resource$AuthenticationType CONTAINER
-meth public static javax.annotation.Resource$AuthenticationType valueOf(java.lang.String)
-meth public static javax.annotation.Resource$AuthenticationType[] values()
-supr java.lang.Enum<javax.annotation.Resource$AuthenticationType>
+CLSS public abstract interface !annotation javax.enterprise.context.ApplicationScoped
+ anno 0 java.lang.annotation.Documented()
+ anno 0 java.lang.annotation.Inherited()
+ anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD])
+ anno 0 javax.enterprise.context.ScopeType(boolean normal=true, boolean passivating=false)
+intf java.lang.annotation.Annotation
-CLSS public abstract interface !annotation javax.annotation.Resources
+CLSS public javax.enterprise.context.ContextNotActiveException
+cons public ContextNotActiveException()
+cons public ContextNotActiveException(java.lang.String)
+cons public ContextNotActiveException(java.lang.String,java.lang.Throwable)
+cons public ContextNotActiveException(java.lang.Throwable)
+supr javax.inject.ExecutionException
+hfds serialVersionUID
+
+CLSS public abstract interface javax.enterprise.context.Conversation
+meth public abstract boolean isLongRunning()
+meth public abstract java.lang.String getId()
+meth public abstract long getTimeout()
+meth public abstract void begin()
+meth public abstract void begin(java.lang.String)
+meth public abstract void end()
+meth public abstract void setTimeout(long)
+
+CLSS public abstract interface !annotation javax.enterprise.context.ConversationScoped
anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE])
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD])
+ anno 0 javax.enterprise.context.ScopeType(boolean normal=true, boolean passivating=true)
intf java.lang.annotation.Annotation
-meth public abstract javax.annotation.Resource[] value()
-CLSS public abstract interface !annotation javax.annotation.Stereotype
+CLSS public abstract interface !annotation javax.enterprise.context.Dependent
anno 0 java.lang.annotation.Documented()
+ anno 0 java.lang.annotation.Inherited()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD, TYPE, FIELD])
+ anno 0 javax.enterprise.context.ScopeType(boolean normal=false, boolean passivating=false)
+intf java.lang.annotation.Annotation
+
+CLSS public abstract interface !annotation javax.enterprise.context.RequestScoped
+ anno 0 java.lang.annotation.Documented()
+ anno 0 java.lang.annotation.Inherited()
+ anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD])
+ anno 0 javax.enterprise.context.ScopeType(boolean normal=true, boolean passivating=false)
+intf java.lang.annotation.Annotation
+
+CLSS public abstract interface !annotation javax.enterprise.context.ScopeType
+ anno 0 java.lang.annotation.Documented()
+ anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE])
intf java.lang.annotation.Annotation
-meth public abstract !hasdefault java.lang.Class<? extends java.lang.annotation.Annotation>[] supportedScopes()
-meth public abstract !hasdefault java.lang.Class<?>[] requiredTypes()
+meth public abstract !hasdefault boolean normal()
+meth public abstract !hasdefault boolean passivating()
-CLSS public abstract javax.annotation.processing.AbstractProcessor
-cons protected AbstractProcessor()
-fld protected javax.annotation.processing.ProcessingEnvironment processingEnv
-intf javax.annotation.processing.Processor
-meth protected boolean isInitialized()
-meth public abstract boolean process(java.util.Set<? extends javax.lang.model.element.TypeElement>,javax.annotation.processing.RoundEnvironment)
-meth public java.lang.Iterable<? extends javax.annotation.processing.Completion> getCompletions(javax.lang.model.element.Element,javax.lang.model.element.AnnotationMirror,javax.lang.model.element.ExecutableElement,java.lang.String)
-meth public java.util.Set<java.lang.String> getSupportedAnnotationTypes()
-meth public java.util.Set<java.lang.String> getSupportedOptions()
-meth public javax.lang.model.SourceVersion getSupportedSourceVersion()
-meth public void init(javax.annotation.processing.ProcessingEnvironment)
-supr java.lang.Object
-hfds initialized
+CLSS public abstract interface !annotation javax.enterprise.context.SessionScoped
+ anno 0 java.lang.annotation.Documented()
+ anno 0 java.lang.annotation.Inherited()
+ anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD])
+ anno 0 javax.enterprise.context.ScopeType(boolean normal=true, boolean passivating=true)
+intf java.lang.annotation.Annotation
-CLSS public abstract interface javax.annotation.processing.Completion
-meth public abstract java.lang.String getMessage()
-meth public abstract java.lang.String getValue()
+CLSS public abstract interface javax.enterprise.context.spi.Context
+meth public abstract <%0 extends java.lang.Object> {%%0} get(javax.enterprise.context.spi.Contextual<{%%0}>)
+meth public abstract <%0 extends java.lang.Object> {%%0} get(javax.enterprise.context.spi.Contextual<{%%0}>,javax.enterprise.context.spi.CreationalContext<{%%0}>)
+meth public abstract boolean isActive()
+meth public abstract java.lang.Class<? extends java.lang.annotation.Annotation> getScopeType()
-CLSS public javax.annotation.processing.Completions
-meth public static javax.annotation.processing.Completion of(java.lang.String)
-meth public static javax.annotation.processing.Completion of(java.lang.String,java.lang.String)
-supr java.lang.Object
-hcls SimpleCompletion
+CLSS public abstract interface javax.enterprise.context.spi.Contextual<%0 extends java.lang.Object>
+meth public abstract void destroy({javax.enterprise.context.spi.Contextual%0},javax.enterprise.context.spi.CreationalContext<{javax.enterprise.context.spi.Contextual%0}>)
+meth public abstract {javax.enterprise.context.spi.Contextual%0} create(javax.enterprise.context.spi.CreationalContext<{javax.enterprise.context.spi.Contextual%0}>)
-CLSS public abstract interface javax.annotation.processing.Filer
-meth public abstract !varargs javax.tools.FileObject createResource(javax.tools.JavaFileManager$Location,java.lang.CharSequence,java.lang.CharSequence,javax.lang.model.element.Element[]) throws java.io.IOException
-meth public abstract !varargs javax.tools.JavaFileObject createClassFile(java.lang.CharSequence,javax.lang.model.element.Element[]) throws java.io.IOException
-meth public abstract !varargs javax.tools.JavaFileObject createSourceFile(java.lang.CharSequence,javax.lang.model.element.Element[]) throws java.io.IOException
-meth public abstract javax.tools.FileObject getResource(javax.tools.JavaFileManager$Location,java.lang.CharSequence,java.lang.CharSequence) throws java.io.IOException
+CLSS public abstract interface javax.enterprise.context.spi.CreationalContext<%0 extends java.lang.Object>
+meth public abstract void push({javax.enterprise.context.spi.CreationalContext%0})
+meth public abstract void release()
-CLSS public javax.annotation.processing.FilerException
-cons public FilerException(java.lang.String)
-supr java.io.IOException
+CLSS public javax.enterprise.inject.AmbiguousResolutionException
+cons public AmbiguousResolutionException()
+cons public AmbiguousResolutionException(java.lang.String)
+cons public AmbiguousResolutionException(java.lang.String,java.lang.Throwable)
+cons public AmbiguousResolutionException(java.lang.Throwable)
+supr javax.inject.DeploymentException
hfds serialVersionUID
-CLSS public abstract interface javax.annotation.processing.Messager
-meth public abstract void printMessage(javax.tools.Diagnostic$Kind,java.lang.CharSequence)
-meth public abstract void printMessage(javax.tools.Diagnostic$Kind,java.lang.CharSequence,javax.lang.model.element.Element)
-meth public abstract void printMessage(javax.tools.Diagnostic$Kind,java.lang.CharSequence,javax.lang.model.element.Element,javax.lang.model.element.AnnotationMirror)
-meth public abstract void printMessage(javax.tools.Diagnostic$Kind,java.lang.CharSequence,javax.lang.model.element.Element,javax.lang.model.element.AnnotationMirror,javax.lang.model.element.AnnotationValue)
+CLSS public abstract javax.enterprise.inject.AnnotationLiteral<%0 extends java.lang.annotation.Annotation>
+cons protected AnnotationLiteral()
+intf java.lang.annotation.Annotation
+meth public boolean equals(java.lang.Object)
+meth public int hashCode()
+meth public java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
+meth public java.lang.String toString()
+supr java.lang.Object
+hfds annotationType,members
-CLSS public abstract interface javax.annotation.processing.ProcessingEnvironment
-meth public abstract java.util.Locale getLocale()
-meth public abstract java.util.Map<java.lang.String,java.lang.String> getOptions()
-meth public abstract javax.annotation.processing.Filer getFiler()
-meth public abstract javax.annotation.processing.Messager getMessager()
-meth public abstract javax.lang.model.SourceVersion getSourceVersion()
-meth public abstract javax.lang.model.util.Elements getElementUtils()
-meth public abstract javax.lang.model.util.Types getTypeUtils()
-
-CLSS public abstract interface javax.annotation.processing.Processor
-meth public abstract boolean process(java.util.Set<? extends javax.lang.model.element.TypeElement>,javax.annotation.processing.RoundEnvironment)
-meth public abstract java.lang.Iterable<? extends javax.annotation.processing.Completion> getCompletions(javax.lang.model.element.Element,javax.lang.model.element.AnnotationMirror,javax.lang.model.element.ExecutableElement,java.lang.String)
-meth public abstract java.util.Set<java.lang.String> getSupportedAnnotationTypes()
-meth public abstract java.util.Set<java.lang.String> getSupportedOptions()
-meth public abstract javax.lang.model.SourceVersion getSupportedSourceVersion()
-meth public abstract void init(javax.annotation.processing.ProcessingEnvironment)
-
-CLSS public abstract interface javax.annotation.processing.RoundEnvironment
-meth public abstract boolean errorRaised()
-meth public abstract boolean processingOver()
-meth public abstract java.util.Set<? extends javax.lang.model.element.Element> getElementsAnnotatedWith(java.lang.Class<? extends java.lang.annotation.Annotation>)
-meth public abstract java.util.Set<? extends javax.lang.model.element.Element> getElementsAnnotatedWith(javax.lang.model.element.TypeElement)
-meth public abstract java.util.Set<? extends javax.lang.model.element.Element> getRootElements()
-
-CLSS public abstract interface !annotation javax.annotation.processing.SupportedAnnotationTypes
+CLSS public abstract interface !annotation javax.enterprise.inject.Any
anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE])
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD, PARAMETER])
+ anno 0 javax.enterprise.inject.BindingType()
intf java.lang.annotation.Annotation
-meth public abstract java.lang.String[] value()
-CLSS public abstract interface !annotation javax.annotation.processing.SupportedOptions
+CLSS public abstract interface !annotation javax.enterprise.inject.BindingType
anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE])
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE])
intf java.lang.annotation.Annotation
-meth public abstract java.lang.String[] value()
-CLSS public abstract interface !annotation javax.annotation.processing.SupportedSourceVersion
+CLSS public javax.enterprise.inject.CreationException
+cons public CreationException()
+cons public CreationException(java.lang.String)
+cons public CreationException(java.lang.String,java.lang.Throwable)
+cons public CreationException(java.lang.Throwable)
+supr javax.inject.ExecutionException
+hfds serialVersionUID
+
+CLSS public abstract interface !annotation javax.enterprise.inject.Current
anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE])
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, PARAMETER, FIELD])
+ anno 0 javax.enterprise.inject.BindingType()
intf java.lang.annotation.Annotation
-meth public abstract javax.lang.model.SourceVersion value()
-CLSS public abstract interface !annotation javax.context.ApplicationScoped
+CLSS public abstract interface !annotation javax.enterprise.inject.Disposes
anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Inherited()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD])
- anno 0 javax.context.ScopeType(boolean normal=true, boolean passivating=false)
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[PARAMETER])
intf java.lang.annotation.Annotation
-CLSS public abstract interface javax.context.Context
-meth public abstract <%0 extends java.lang.Object> {%%0} get(javax.context.Contextual<{%%0}>)
-meth public abstract <%0 extends java.lang.Object> {%%0} get(javax.context.Contextual<{%%0}>,javax.context.CreationalContext<{%%0}>)
-meth public abstract boolean isActive()
-meth public abstract java.lang.Class<? extends java.lang.annotation.Annotation> getScopeType()
-
-CLSS public javax.context.ContextNotActiveException
-cons public ContextNotActiveException()
-cons public ContextNotActiveException(java.lang.String)
-cons public ContextNotActiveException(java.lang.String,java.lang.Throwable)
-cons public ContextNotActiveException(java.lang.Throwable)
+CLSS public javax.enterprise.inject.IllegalProductException
+cons public IllegalProductException()
+cons public IllegalProductException(java.lang.String)
+cons public IllegalProductException(java.lang.String,java.lang.Throwable)
+cons public IllegalProductException(java.lang.Throwable)
supr javax.inject.ExecutionException
hfds serialVersionUID
-CLSS public abstract interface javax.context.Contextual<%0 extends java.lang.Object>
-meth public abstract void destroy({javax.context.Contextual%0})
-meth public abstract {javax.context.Contextual%0} create(javax.context.CreationalContext<{javax.context.Contextual%0}>)
+CLSS public abstract interface !annotation javax.enterprise.inject.Initializer
+ anno 0 java.lang.annotation.Documented()
+ anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD, CONSTRUCTOR])
+intf java.lang.annotation.Annotation
-CLSS public abstract interface javax.context.Conversation
-meth public abstract boolean isLongRunning()
-meth public abstract java.lang.String getId()
-meth public abstract long getTimeout()
-meth public abstract void begin()
-meth public abstract void begin(java.lang.String)
-meth public abstract void end()
-meth public abstract void setTimeout(long)
+CLSS public abstract interface javax.enterprise.inject.Instance<%0 extends java.lang.Object>
+intf java.lang.Iterable<{javax.enterprise.inject.Instance%0}>
+meth public abstract !varargs {javax.enterprise.inject.Instance%0} get(java.lang.annotation.Annotation[])
-CLSS public abstract interface !annotation javax.context.ConversationScoped
- anno 0 java.lang.annotation.Documented()
+CLSS public abstract interface !annotation javax.enterprise.inject.Model
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD])
- anno 0 javax.context.ScopeType(boolean normal=true, boolean passivating=true)
+ anno 0 javax.enterprise.context.RequestScoped()
+ anno 0 javax.enterprise.inject.Named(java.lang.String value="")
+ anno 0 javax.enterprise.inject.Stereotype(java.lang.Class<? extends java.lang.annotation.Annotation>[] supportedScopes=[], java.lang.Class<?>[] requiredTypes=[])
intf java.lang.annotation.Annotation
-CLSS public abstract interface javax.context.CreationalContext<%0 extends java.lang.Object>
-meth public abstract void push({javax.context.CreationalContext%0})
+CLSS public abstract interface !annotation javax.enterprise.inject.Named
+ anno 0 java.lang.annotation.Documented()
+ anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD])
+intf java.lang.annotation.Annotation
+meth public abstract !hasdefault java.lang.String value()
-CLSS public abstract interface !annotation javax.context.Dependent
+CLSS public abstract interface !annotation javax.enterprise.inject.New
anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Inherited()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD, TYPE, FIELD])
- anno 0 javax.context.ScopeType(boolean normal=false, boolean passivating=false)
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[FIELD, PARAMETER])
+ anno 0 javax.enterprise.inject.BindingType()
intf java.lang.annotation.Annotation
-CLSS public abstract interface !annotation javax.context.RequestScoped
+CLSS public abstract interface !annotation javax.enterprise.inject.NonBinding
+ anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD])
+intf java.lang.annotation.Annotation
+
+CLSS public abstract interface !annotation javax.enterprise.inject.Produces
anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Inherited()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD])
- anno 0 javax.context.ScopeType(boolean normal=true, boolean passivating=false)
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD, FIELD])
intf java.lang.annotation.Annotation
-CLSS public abstract interface !annotation javax.context.ScopeType
+CLSS public abstract interface !annotation javax.enterprise.inject.Stereotype
anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE])
intf java.lang.annotation.Annotation
-meth public abstract !hasdefault boolean normal()
-meth public abstract !hasdefault boolean passivating()
+meth public abstract !hasdefault java.lang.Class<? extends java.lang.annotation.Annotation>[] supportedScopes()
+meth public abstract !hasdefault java.lang.Class<?>[] requiredTypes()
-CLSS public abstract interface !annotation javax.context.SessionScoped
+CLSS public abstract javax.enterprise.inject.TypeLiteral<%0 extends java.lang.Object>
+cons protected TypeLiteral()
+meth public final java.lang.Class<{javax.enterprise.inject.TypeLiteral%0}> getRawType()
+meth public final java.lang.reflect.Type getType()
+supr java.lang.Object
+hfds actualType
+
+CLSS public javax.enterprise.inject.UnproxyableResolutionException
+cons public UnproxyableResolutionException()
+cons public UnproxyableResolutionException(java.lang.String)
+cons public UnproxyableResolutionException(java.lang.String,java.lang.Throwable)
+cons public UnproxyableResolutionException(java.lang.Throwable)
+supr javax.inject.DeploymentException
+hfds serialVersionUID
+
+CLSS public javax.enterprise.inject.UnsatisfiedResolutionException
+cons public UnsatisfiedResolutionException()
+cons public UnsatisfiedResolutionException(java.lang.String)
+cons public UnsatisfiedResolutionException(java.lang.String,java.lang.Throwable)
+cons public UnsatisfiedResolutionException(java.lang.Throwable)
+supr javax.inject.DeploymentException
+hfds serialVersionUID
+
+CLSS public abstract interface !annotation javax.enterprise.inject.deployment.DeploymentType
anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Inherited()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE])
+intf java.lang.annotation.Annotation
+
+CLSS public abstract interface !annotation javax.enterprise.inject.deployment.Production
+ anno 0 java.lang.annotation.Documented()
+ anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD])
- anno 0 javax.context.ScopeType(boolean normal=true, boolean passivating=true)
+ anno 0 javax.enterprise.inject.deployment.DeploymentType()
intf java.lang.annotation.Annotation
-CLSS public abstract interface !annotation javax.decorator.Decorates
+CLSS public abstract interface !annotation javax.enterprise.inject.deployment.Specializes
anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[FIELD])
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD])
intf java.lang.annotation.Annotation
-CLSS public abstract interface !annotation javax.decorator.Decorator
+CLSS public abstract interface !annotation javax.enterprise.inject.deployment.Standard
anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE])
- anno 0 javax.annotation.Stereotype(java.lang.Class<? extends java.lang.annotation.Annotation>[] supportedScopes=[], java.lang.Class<?>[] requiredTypes=[])
+ anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD])
+ anno 0 javax.enterprise.inject.deployment.DeploymentType()
intf java.lang.annotation.Annotation
+CLSS public abstract interface javax.enterprise.inject.spi.AfterBeanDiscovery
+meth public abstract void addDefinitionError(java.lang.Throwable)
+
+CLSS public abstract interface javax.enterprise.inject.spi.AfterDeploymentValidation
+meth public abstract void addDeploymentProblem(java.lang.Throwable)
+
+CLSS public abstract interface javax.enterprise.inject.spi.Annotated
+meth public abstract <%0 extends java.lang.annotation.Annotation> {%%0} getAnnotation(java.lang.Class<{%%0}>)
+meth public abstract boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation>)
+meth public abstract java.lang.reflect.Type getBaseType()
+meth public abstract java.util.Set<java.lang.annotation.Annotation> getAnnotations()
+meth public abstract java.util.Set<java.lang.reflect.Type> getTypeClosure()
+
+CLSS public abstract interface javax.enterprise.inject.spi.AnnotatedCallable<%0 extends java.lang.Object>
+intf javax.enterprise.inject.spi.AnnotatedMember<{javax.enterprise.inject.spi.AnnotatedCallable%0}>
+meth public abstract java.util.List<javax.enterprise.inject.spi.AnnotatedParameter<{javax.enterprise.inject.spi.AnnotatedCallable%0}>> getParameters()
+
+CLSS public abstract interface javax.enterprise.inject.spi.AnnotatedConstructor<%0 extends java.lang.Object>
+intf javax.enterprise.inject.spi.AnnotatedCallable<{javax.enterprise.inject.spi.AnnotatedConstructor%0}>
+meth public abstract java.lang.reflect.Constructor<{javax.enterprise.inject.spi.AnnotatedConstructor%0}> getJavaMember()
+
+CLSS public abstract interface javax.enterprise.inject.spi.AnnotatedField<%0 extends java.lang.Object>
+intf javax.enterprise.inject.spi.AnnotatedMember<{javax.enterprise.inject.spi.AnnotatedField%0}>
+meth public abstract java.lang.reflect.Field getJavaMember()
+
+CLSS public abstract interface javax.enterprise.inject.spi.AnnotatedMember<%0 extends java.lang.Object>
+intf javax.enterprise.inject.spi.Annotated
+meth public abstract boolean isStatic()
+meth public abstract java.lang.reflect.Member getJavaMember()
+meth public abstract javax.enterprise.inject.spi.AnnotatedType<{javax.enterprise.inject.spi.AnnotatedMember%0}> getDeclaringType()
+
+CLSS public abstract interface javax.enterprise.inject.spi.AnnotatedMethod<%0 extends java.lang.Object>
+intf javax.enterprise.inject.spi.AnnotatedCallable<{javax.enterprise.inject.spi.AnnotatedMethod%0}>
+meth public abstract java.lang.reflect.Method getJavaMember()
+
+CLSS public abstract interface javax.enterprise.inject.spi.AnnotatedParameter<%0 extends java.lang.Object>
+intf javax.enterprise.inject.spi.Annotated
+meth public abstract int getPosition()
+meth public abstract javax.enterprise.inject.spi.AnnotatedCallable<{javax.enterprise.inject.spi.AnnotatedParameter%0}> getDeclaringCallable()
+
+CLSS public abstract interface javax.enterprise.inject.spi.AnnotatedType<%0 extends java.lang.Object>
+intf javax.enterprise.inject.spi.Annotated
+meth public abstract java.lang.Class<{javax.enterprise.inject.spi.AnnotatedType%0}> getJavaClass()
+meth public abstract java.util.Set<javax.enterprise.inject.spi.AnnotatedConstructor<{javax.enterprise.inject.spi.AnnotatedType%0}>> getConstructors()
+meth public abstract java.util.Set<javax.enterprise.inject.spi.AnnotatedField<? super {javax.enterprise.inject.spi.AnnotatedType%0}>> getFields()
+meth public abstract java.util.Set<javax.enterprise.inject.spi.AnnotatedMethod<? super {javax.enterprise.inject.spi.AnnotatedType%0}>> getMethods()
+
+CLSS public abstract interface javax.enterprise.inject.spi.Bean<%0 extends java.lang.Object>
+intf javax.enterprise.context.spi.Contextual<{javax.enterprise.inject.spi.Bean%0}>
+meth public abstract boolean isNullable()
+meth public abstract boolean isSerializable()
+meth public abstract java.lang.Class<? extends java.lang.annotation.Annotation> getDeploymentType()
+meth public abstract java.lang.Class<? extends java.lang.annotation.Annotation> getScopeType()
+meth public abstract java.lang.String getName()
+meth public abstract java.util.Set<java.lang.annotation.Annotation> getBindings()
+meth public abstract java.util.Set<java.lang.reflect.Type> getTypes()
+meth public abstract java.util.Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
+
+CLSS public abstract interface javax.enterprise.inject.spi.BeanManager
+meth public abstract !varargs <%0 extends java.lang.Object> java.util.Set<javax.event.Observer<{%%0}>> resolveObservers({%%0},java.lang.annotation.Annotation[])
+meth public abstract !varargs java.util.List<javax.enterprise.inject.spi.Decorator<?>> resolveDecorators(java.util.Set<java.lang.reflect.Type>,java.lang.annotation.Annotation[])
+meth public abstract !varargs java.util.List<javax.enterprise.inject.spi.Interceptor<?>> resolveInterceptors(javax.enterprise.inject.spi.InterceptionType,java.lang.annotation.Annotation[])
+meth public abstract !varargs java.util.Set<javax.enterprise.inject.spi.Bean<?>> getBeans(java.lang.reflect.Type,java.lang.annotation.Annotation[])
+meth public abstract !varargs void addObserver(javax.event.Observer<?>,java.lang.annotation.Annotation[])
+meth public abstract !varargs void fireEvent(java.lang.Object,java.lang.annotation.Annotation[])
+meth public abstract <%0 extends java.lang.Object> javax.enterprise.inject.spi.Bean<? extends {%%0}> getHighestPrecedenceBean(java.util.Set<javax.enterprise.inject.spi.Bean<? extends {%%0}>>)
+meth public abstract <%0 extends java.lang.Object> javax.enterprise.inject.spi.Bean<? extends {%%0}> getMostSpecializedBean(javax.enterprise.inject.spi.Bean<{%%0}>)
+meth public abstract <%0 extends java.lang.Object> javax.enterprise.inject.spi.InjectionTarget<{%%0}> createInjectionTarget(java.lang.Class<{%%0}>)
+meth public abstract <%0 extends java.lang.Object> javax.enterprise.inject.spi.InjectionTarget<{%%0}> createInjectionTarget(javax.enterprise.inject.spi.AnnotatedType<{%%0}>)
+meth public abstract <%0 extends java.lang.Object> javax.enterprise.inject.spi.ManagedBean<{%%0}> createManagedBean(java.lang.Class<{%%0}>)
+meth public abstract <%0 extends java.lang.Object> javax.enterprise.inject.spi.ManagedBean<{%%0}> createManagedBean(javax.enterprise.inject.spi.AnnotatedType<{%%0}>)
+meth public abstract boolean isBindingType(java.lang.Class<? extends java.lang.annotation.Annotation>)
+meth public abstract boolean isInterceptorBindingType(java.lang.Class<? extends java.lang.annotation.Annotation>)
+meth public abstract boolean isScopeType(java.lang.Class<? extends java.lang.annotation.Annotation>)
+meth public abstract boolean isStereotype(java.lang.Class<? extends java.lang.annotation.Annotation>)
+meth public abstract java.lang.Object getInjectableReference(javax.enterprise.inject.spi.InjectionPoint,javax.enterprise.context.spi.CreationalContext<?>)
+meth public abstract java.lang.Object getReference(javax.enterprise.inject.spi.Bean<?>,java.lang.reflect.Type)
+meth public abstract java.util.List<java.lang.Class<? extends java.lang.annotation.Annotation>> getEnabledDeploymentTypes()
+meth public abstract java.util.Set<java.lang.annotation.Annotation> getInterceptorBindingTypeDefinition(java.lang.Class<? extends java.lang.annotation.Annotation>)
+meth public abstract java.util.Set<java.lang.annotation.Annotation> getStereotypeDefinition(java.lang.Class<? extends java.lang.annotation.Annotation>)
+meth public abstract java.util.Set<javax.enterprise.inject.spi.Bean<?>> getBeans(java.lang.String)
+meth public abstract javax.el.ELResolver getELResolver()
+meth public abstract javax.enterprise.context.ScopeType getScopeDefinition(java.lang.Class<? extends java.lang.annotation.Annotation>)
+meth public abstract javax.enterprise.context.spi.Context getContext(java.lang.Class<? extends java.lang.annotation.Annotation>)
+meth public abstract javax.enterprise.inject.spi.Bean<?> getPassivationCapableBean(java.lang.String)
+meth public abstract javax.enterprise.inject.spi.BeanManager createActivity()
+meth public abstract javax.enterprise.inject.spi.BeanManager setCurrent(java.lang.Class<? extends java.lang.annotation.Annotation>)
+meth public abstract void addBean(javax.enterprise.inject.spi.Bean<?>)
+meth public abstract void addContext(javax.enterprise.context.spi.Context)
+meth public abstract void addObserver(javax.enterprise.inject.spi.ObserverMethod<?,?>)
+meth public abstract void removeObserver(javax.event.Observer<?>)
+meth public abstract void validate(javax.enterprise.inject.spi.InjectionPoint)
+
+CLSS public abstract interface javax.enterprise.inject.spi.BeforeBeanDiscovery
+meth public abstract !varargs void addStereotype(java.lang.Class<? extends java.lang.annotation.Annotation>,java.lang.annotation.Annotation[])
+meth public abstract void addBindingType(java.lang.Class<? extends java.lang.annotation.Annotation>)
+meth public abstract void addInterceptorBindingType(java.lang.Class<? extends java.lang.annotation.Annotation>)
+meth public abstract void addScopeType(java.lang.Class<? extends java.lang.annotation.Annotation>,boolean,boolean)
+
+CLSS public abstract interface javax.enterprise.inject.spi.Decorator<%0 extends java.lang.Object>
+intf javax.enterprise.inject.spi.Bean<{javax.enterprise.inject.spi.Decorator%0}>
+meth public abstract java.lang.reflect.Type getDelegateType()
+meth public abstract java.util.Set<java.lang.annotation.Annotation> getDelegateBindings()
+meth public abstract java.util.Set<java.lang.reflect.Type> getDecoratedTypes()
+
+CLSS public abstract interface javax.enterprise.inject.spi.Extension
+
+CLSS public abstract interface javax.enterprise.inject.spi.InjectionPoint
+meth public abstract boolean isDelegate()
+meth public abstract boolean isTransient()
+meth public abstract java.lang.reflect.Member getMember()
+meth public abstract java.lang.reflect.Type getType()
+meth public abstract java.util.Set<java.lang.annotation.Annotation> getBindings()
+meth public abstract javax.enterprise.inject.spi.Annotated getAnnotated()
+meth public abstract javax.enterprise.inject.spi.Bean<?> getBean()
+
+CLSS public abstract interface javax.enterprise.inject.spi.InjectionTarget<%0 extends java.lang.Object>
+meth public abstract java.util.Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
+meth public abstract void destroy({javax.enterprise.inject.spi.InjectionTarget%0})
+meth public abstract void dispose({javax.enterprise.inject.spi.InjectionTarget%0})
+meth public abstract void inject({javax.enterprise.inject.spi.InjectionTarget%0},javax.enterprise.context.spi.CreationalContext<{javax.enterprise.inject.spi.InjectionTarget%0}>)
+meth public abstract {javax.enterprise.inject.spi.InjectionTarget%0} produce(javax.enterprise.context.spi.CreationalContext<{javax.enterprise.inject.spi.InjectionTarget%0}>)
+
+CLSS public final !enum javax.enterprise.inject.spi.InterceptionType
+fld public final static javax.enterprise.inject.spi.InterceptionType AROUND_INVOKE
+fld public final static javax.enterprise.inject.spi.InterceptionType POST_ACTIVATE
+fld public final static javax.enterprise.inject.spi.InterceptionType POST_CONSTRUCT
+fld public final static javax.enterprise.inject.spi.InterceptionType PRE_DESTROY
+fld public final static javax.enterprise.inject.spi.InterceptionType PRE_PASSIVATE
+meth public static javax.enterprise.inject.spi.InterceptionType valueOf(java.lang.String)
+meth public static javax.enterprise.inject.spi.InterceptionType[] values()
+supr java.lang.Enum<javax.enterprise.inject.spi.InterceptionType>
+
+CLSS public abstract interface javax.enterprise.inject.spi.Interceptor<%0 extends java.lang.Object>
+intf javax.enterprise.inject.spi.Bean<{javax.enterprise.inject.spi.Interceptor%0}>
+meth public abstract java.lang.reflect.Method getMethod(javax.enterprise.inject.spi.InterceptionType)
+meth public abstract java.util.Set<java.lang.annotation.Annotation> getInterceptorBindingTypes()
+
+CLSS public abstract interface javax.enterprise.inject.spi.ManagedBean<%0 extends java.lang.Object>
+intf javax.enterprise.inject.spi.Bean<{javax.enterprise.inject.spi.ManagedBean%0}>
+meth public abstract java.util.Set<javax.enterprise.inject.spi.ObserverMethod<{javax.enterprise.inject.spi.ManagedBean%0},?>> getObserverMethods()
+meth public abstract java.util.Set<javax.enterprise.inject.spi.ProducerBean<{javax.enterprise.inject.spi.ManagedBean%0},?>> getProducerBeans()
+meth public abstract javax.enterprise.inject.spi.AnnotatedType<{javax.enterprise.inject.spi.ManagedBean%0}> getAnnotatedType()
+meth public abstract javax.enterprise.inject.spi.Bean<{javax.enterprise.inject.spi.ManagedBean%0}> getBeanClass()
+meth public abstract javax.enterprise.inject.spi.InjectionTarget<{javax.enterprise.inject.spi.ManagedBean%0}> getInjectionTarget()
+
+CLSS public abstract interface javax.enterprise.inject.spi.ObserverMethod<%0 extends java.lang.Object, %1 extends java.lang.Object>
+intf javax.event.Observer<{javax.enterprise.inject.spi.ObserverMethod%1}>
+meth public abstract java.lang.reflect.Type getObservedEventType()
+meth public abstract java.util.Set<java.lang.annotation.Annotation> getObservedEventBindings()
+meth public abstract java.util.Set<javax.enterprise.inject.spi.InjectionPoint> getInjectionPoints()
+meth public abstract javax.enterprise.inject.spi.AnnotatedMethod<? super {javax.enterprise.inject.spi.ObserverMethod%0}> getAnnotatedMethod()
+meth public abstract javax.enterprise.inject.spi.Bean<{javax.enterprise.inject.spi.ObserverMethod%0}> getBean()
+meth public abstract void notify({javax.enterprise.inject.spi.ObserverMethod%0},{javax.enterprise.inject.spi.ObserverMethod%1})
+
+CLSS public abstract interface javax.enterprise.inject.spi.ProducerBean<%0 extends java.lang.Object, %1 extends java.lang.Object>
+intf javax.enterprise.inject.spi.Bean<{javax.enterprise.inject.spi.ProducerBean%1}>
+meth public abstract javax.enterprise.inject.spi.AnnotatedMember<? super {javax.enterprise.inject.spi.ProducerBean%0}> getAnnotatedProducer()
+meth public abstract javax.enterprise.inject.spi.AnnotatedMethod<? super {javax.enterprise.inject.spi.ProducerBean%0}> getAnnotatedDisposer()
+meth public abstract javax.enterprise.inject.spi.Bean<{javax.enterprise.inject.spi.ProducerBean%0}> getBean()
+meth public abstract javax.enterprise.inject.spi.Bean<{javax.enterprise.inject.spi.ProducerBean%0}> getBeanClass()
+meth public abstract javax.enterprise.inject.spi.InjectionTarget<{javax.enterprise.inject.spi.ProducerBean%1}> getInjectionTarget()
+
CLSS public abstract interface !annotation javax.event.AfterTransactionCompletion
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[PARAMETER])
@@ -273,13 +551,6 @@
meth public abstract !varargs void fire({javax.event.Event%0},java.lang.annotation.Annotation[])
meth public abstract !varargs void observe(javax.event.Observer<{javax.event.Event%0}>,java.lang.annotation.Annotation[])
-CLSS public abstract interface !annotation javax.event.Fires
- anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD, PARAMETER])
- anno 0 javax.inject.BindingType()
-intf java.lang.annotation.Annotation
-
CLSS public abstract interface !annotation javax.event.IfExists
anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
@@ -287,7 +558,7 @@
intf java.lang.annotation.Annotation
CLSS public abstract interface javax.event.Observer<%0 extends java.lang.Object>
-meth public abstract void notify({javax.event.Observer%0})
+meth public abstract boolean notify({javax.event.Observer%0})
CLSS public javax.event.ObserverException
cons public ObserverException()
@@ -303,45 +574,6 @@
anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[PARAMETER])
intf java.lang.annotation.Annotation
-CLSS public javax.inject.AmbiguousDependencyException
-cons public AmbiguousDependencyException()
-cons public AmbiguousDependencyException(java.lang.String)
-cons public AmbiguousDependencyException(java.lang.String,java.lang.Throwable)
-cons public AmbiguousDependencyException(java.lang.Throwable)
-supr javax.inject.DeploymentException
-hfds serialVersionUID
-
-CLSS public abstract javax.inject.AnnotationLiteral<%0 extends java.lang.annotation.Annotation>
-cons protected AnnotationLiteral()
-intf java.lang.annotation.Annotation
-meth public boolean equals(java.lang.Object)
-meth public int hashCode()
-meth public java.lang.Class<? extends java.lang.annotation.Annotation> annotationType()
-meth public java.lang.String toString()
-supr java.lang.Object
-hfds annotationType,members
-
-CLSS public abstract interface !annotation javax.inject.BindingType
- anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE])
-intf java.lang.annotation.Annotation
-
-CLSS public javax.inject.CreationException
-cons public CreationException()
-cons public CreationException(java.lang.String)
-cons public CreationException(java.lang.String,java.lang.Throwable)
-cons public CreationException(java.lang.Throwable)
-supr javax.inject.ExecutionException
-hfds serialVersionUID
-
-CLSS public abstract interface !annotation javax.inject.Current
- anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, PARAMETER, FIELD])
- anno 0 javax.inject.BindingType()
-intf java.lang.annotation.Annotation
-
CLSS public javax.inject.DefinitionException
cons public DefinitionException()
cons public DefinitionException(java.lang.String)
@@ -358,18 +590,6 @@
supr java.lang.RuntimeException
hfds serialVersionUID
-CLSS public abstract interface !annotation javax.inject.DeploymentType
- anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE])
-intf java.lang.annotation.Annotation
-
-CLSS public abstract interface !annotation javax.inject.Disposes
- anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[PARAMETER])
-intf java.lang.annotation.Annotation
-
CLSS public javax.inject.DuplicateBindingTypeException
cons public DuplicateBindingTypeException()
cons public DuplicateBindingTypeException(java.lang.String)
@@ -386,14 +606,6 @@
supr java.lang.RuntimeException
hfds serialVersionUID
-CLSS public javax.inject.IllegalProductException
-cons public IllegalProductException()
-cons public IllegalProductException(java.lang.String)
-cons public IllegalProductException(java.lang.String,java.lang.Throwable)
-cons public IllegalProductException(java.lang.Throwable)
-supr javax.inject.ExecutionException
-hfds serialVersionUID
-
CLSS public javax.inject.InconsistentSpecializationException
cons public InconsistentSpecializationException()
cons public InconsistentSpecializationException(java.lang.String)
@@ -402,22 +614,6 @@
supr javax.inject.DeploymentException
hfds serialVersionUID
-CLSS public abstract interface !annotation javax.inject.Initializer
- anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD, CONSTRUCTOR])
-intf java.lang.annotation.Annotation
-
-CLSS public abstract interface javax.inject.Instance<%0 extends java.lang.Object>
-meth public abstract !varargs {javax.inject.Instance%0} get(java.lang.annotation.Annotation[])
-
-CLSS public abstract interface !annotation javax.inject.New
- anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[FIELD, PARAMETER])
- anno 0 javax.inject.BindingType()
-intf java.lang.annotation.Annotation
-
CLSS public javax.inject.NullableDependencyException
cons public NullableDependencyException()
cons public NullableDependencyException(java.lang.String)
@@ -430,64 +626,15 @@
anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD, PARAMETER])
- anno 0 javax.inject.BindingType()
+ anno 0 javax.enterprise.inject.BindingType()
intf java.lang.annotation.Annotation
-CLSS public abstract interface !annotation javax.inject.Produces
- anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[METHOD, FIELD])
-intf java.lang.annotation.Annotation
-
-CLSS public abstract interface !annotation javax.inject.Production
- anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD])
- anno 0 javax.inject.DeploymentType()
-intf java.lang.annotation.Annotation
-
CLSS public abstract interface !annotation javax.inject.Realizes
anno 0 java.lang.annotation.Documented()
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE])
intf java.lang.annotation.Annotation
-CLSS public abstract interface !annotation javax.inject.Specializes
- anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD])
-intf java.lang.annotation.Annotation
-
-CLSS public abstract interface !annotation javax.inject.Standard
- anno 0 java.lang.annotation.Documented()
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD])
- anno 0 javax.inject.DeploymentType()
-intf java.lang.annotation.Annotation
-
-CLSS public abstract javax.inject.TypeLiteral<%0 extends java.lang.Object>
-cons protected TypeLiteral()
-meth public final java.lang.Class<{javax.inject.TypeLiteral%0}> getRawType()
-meth public final java.lang.reflect.Type getType()
-supr java.lang.Object
-hfds actualType
-
-CLSS public javax.inject.UnproxyableDependencyException
-cons public UnproxyableDependencyException()
-cons public UnproxyableDependencyException(java.lang.String)
-cons public UnproxyableDependencyException(java.lang.String,java.lang.Throwable)
-cons public UnproxyableDependencyException(java.lang.Throwable)
-supr javax.inject.DeploymentException
-hfds serialVersionUID
-
-CLSS public javax.inject.UnsatisfiedDependencyException
-cons public UnsatisfiedDependencyException()
-cons public UnsatisfiedDependencyException(java.lang.String)
-cons public UnsatisfiedDependencyException(java.lang.String,java.lang.Throwable)
-cons public UnsatisfiedDependencyException(java.lang.Throwable)
-supr javax.inject.DeploymentException
-hfds serialVersionUID
-
CLSS public javax.inject.UnserializableDependencyException
cons public UnserializableDependencyException()
cons public UnserializableDependencyException(java.lang.String)
@@ -496,96 +643,10 @@
supr javax.inject.DeploymentException
hfds serialVersionUID
-CLSS public abstract javax.inject.manager.Bean<%0 extends java.lang.Object>
-cons protected Bean(javax.inject.manager.Manager)
-intf javax.context.Contextual<{javax.inject.manager.Bean%0}>
-meth protected javax.inject.manager.Manager getManager()
-meth public abstract boolean isNullable()
-meth public abstract boolean isSerializable()
-meth public abstract java.lang.Class<? extends java.lang.annotation.Annotation> getDeploymentType()
-meth public abstract java.lang.Class<? extends java.lang.annotation.Annotation> getScopeType()
-meth public abstract java.lang.String getName()
-meth public abstract java.util.Set<? extends javax.inject.manager.InjectionPoint> getInjectionPoints()
-meth public abstract java.util.Set<java.lang.annotation.Annotation> getBindings()
-meth public abstract java.util.Set<java.lang.reflect.Type> getTypes()
-supr java.lang.Object
-hfds manager
-
-CLSS public abstract javax.inject.manager.Decorator
-cons protected Decorator(javax.inject.manager.Manager)
-meth public abstract java.lang.Class<?> getDelegateType()
-meth public abstract java.util.Set<java.lang.annotation.Annotation> getDelegateBindings()
-meth public abstract void setDelegate(java.lang.Object,java.lang.Object)
-supr javax.inject.manager.Bean<java.lang.Object>
-
-CLSS public abstract interface !annotation javax.inject.manager.Deployed
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[FIELD, PARAMETER])
- anno 0 javax.inject.BindingType()
-intf java.lang.annotation.Annotation
-
-CLSS public abstract interface !annotation javax.inject.manager.Initialized
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[FIELD, PARAMETER])
- anno 0 javax.inject.BindingType()
-intf java.lang.annotation.Annotation
-
-CLSS public abstract interface javax.inject.manager.InjectionPoint
-meth public abstract <%0 extends java.lang.annotation.Annotation> {%%0} getAnnotation(java.lang.Class<{%%0}>)
-meth public abstract boolean isAnnotationPresent(java.lang.Class<? extends java.lang.annotation.Annotation>)
-meth public abstract java.lang.annotation.Annotation[] getAnnotations()
-meth public abstract java.lang.reflect.Member getMember()
-meth public abstract java.lang.reflect.Type getType()
-meth public abstract java.util.Set<java.lang.annotation.Annotation> getBindings()
-meth public abstract javax.inject.manager.Bean<?> getBean()
-
-CLSS public final !enum javax.inject.manager.InterceptionType
-fld public final static javax.inject.manager.InterceptionType AROUND_INVOKE
-fld public final static javax.inject.manager.InterceptionType POST_ACTIVATE
-fld public final static javax.inject.manager.InterceptionType POST_CONSTRUCT
-fld public final static javax.inject.manager.InterceptionType PRE_DESTROY
-fld public final static javax.inject.manager.InterceptionType PRE_PASSIVATE
-meth public static javax.inject.manager.InterceptionType valueOf(java.lang.String)
-meth public static javax.inject.manager.InterceptionType[] values()
-supr java.lang.Enum<javax.inject.manager.InterceptionType>
-
-CLSS public abstract javax.inject.manager.Interceptor
-cons protected Interceptor(javax.inject.manager.Manager)
-meth public abstract java.lang.reflect.Method getMethod(javax.inject.manager.InterceptionType)
-meth public abstract java.util.Set<java.lang.annotation.Annotation> getInterceptorBindingTypes()
-supr javax.inject.manager.Bean<java.lang.Object>
-
-CLSS public abstract interface javax.inject.manager.Manager
-meth public abstract !varargs <%0 extends java.lang.Object> java.util.Set<javax.event.Observer<{%%0}>> resolveObservers({%%0},java.lang.annotation.Annotation[])
-meth public abstract !varargs <%0 extends java.lang.Object> java.util.Set<javax.inject.manager.Bean<{%%0}>> resolveByType(java.lang.Class<{%%0}>,java.lang.annotation.Annotation[])
-meth public abstract !varargs <%0 extends java.lang.Object> java.util.Set<javax.inject.manager.Bean<{%%0}>> resolveByType(javax.inject.TypeLiteral<{%%0}>,java.lang.annotation.Annotation[])
-meth public abstract !varargs <%0 extends java.lang.Object> javax.inject.manager.Manager addObserver(javax.event.Observer<{%%0}>,java.lang.Class<{%%0}>,java.lang.annotation.Annotation[])
-meth public abstract !varargs <%0 extends java.lang.Object> javax.inject.manager.Manager addObserver(javax.event.Observer<{%%0}>,javax.inject.TypeLiteral<{%%0}>,java.lang.annotation.Annotation[])
-meth public abstract !varargs <%0 extends java.lang.Object> javax.inject.manager.Manager removeObserver(javax.event.Observer<{%%0}>,java.lang.Class<{%%0}>,java.lang.annotation.Annotation[])
-meth public abstract !varargs <%0 extends java.lang.Object> javax.inject.manager.Manager removeObserver(javax.event.Observer<{%%0}>,javax.inject.TypeLiteral<{%%0}>,java.lang.annotation.Annotation[])
-meth public abstract !varargs <%0 extends java.lang.Object> {%%0} getInstanceByType(java.lang.Class<{%%0}>,java.lang.annotation.Annotation[])
-meth public abstract !varargs <%0 extends java.lang.Object> {%%0} getInstanceByType(javax.inject.TypeLiteral<{%%0}>,java.lang.annotation.Annotation[])
-meth public abstract !varargs java.util.List<javax.inject.manager.Decorator> resolveDecorators(java.util.Set<java.lang.reflect.Type>,java.lang.annotation.Annotation[])
-meth public abstract !varargs java.util.List<javax.inject.manager.Interceptor> resolveInterceptors(javax.inject.manager.InterceptionType,java.lang.annotation.Annotation[])
-meth public abstract !varargs void fireEvent(java.lang.Object,java.lang.annotation.Annotation[])
-meth public abstract <%0 extends java.lang.Object> {%%0} getInstance(javax.inject.manager.Bean<{%%0}>)
-meth public abstract <%0 extends java.lang.Object> {%%0} getInstanceToInject(javax.inject.manager.InjectionPoint)
-meth public abstract <%0 extends java.lang.Object> {%%0} getInstanceToInject(javax.inject.manager.InjectionPoint,javax.context.CreationalContext<?>)
-meth public abstract java.lang.Object getInstanceByName(java.lang.String)
-meth public abstract java.util.Set<javax.inject.manager.Bean<?>> resolveByName(java.lang.String)
-meth public abstract javax.context.Context getContext(java.lang.Class<? extends java.lang.annotation.Annotation>)
-meth public abstract javax.inject.manager.Manager addBean(javax.inject.manager.Bean<?>)
-meth public abstract javax.inject.manager.Manager addContext(javax.context.Context)
-meth public abstract javax.inject.manager.Manager addDecorator(javax.inject.manager.Decorator)
-meth public abstract javax.inject.manager.Manager addInterceptor(javax.inject.manager.Interceptor)
-meth public abstract javax.inject.manager.Manager createActivity()
-meth public abstract javax.inject.manager.Manager parse(java.io.InputStream)
-meth public abstract javax.inject.manager.Manager setCurrent(java.lang.Class<? extends java.lang.annotation.Annotation>)
-
CLSS public abstract interface !annotation javax.interceptor.Interceptor
anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE])
- anno 0 javax.annotation.Stereotype(java.lang.Class<? extends java.lang.annotation.Annotation>[] supportedScopes=[], java.lang.Class<?>[] requiredTypes=[])
+ anno 0 javax.enterprise.inject.Stereotype(java.lang.Class<? extends java.lang.annotation.Annotation>[] supportedScopes=[], java.lang.Class<?>[] requiredTypes=[])
intf java.lang.annotation.Annotation
CLSS public abstract interface !annotation javax.interceptor.InterceptorBindingType
@@ -594,11 +655,3 @@
anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[ANNOTATION_TYPE])
intf java.lang.annotation.Annotation
-CLSS public abstract interface !annotation javax.webbeans.Model
- anno 0 java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy value=RUNTIME)
- anno 0 java.lang.annotation.Target(java.lang.annotation.ElementType[] value=[TYPE, METHOD, FIELD])
- anno 0 javax.annotation.Named(java.lang.String value="")
- anno 0 javax.annotation.Stereotype(java.lang.Class<? extends java.lang.annotation.Annotation>[] supportedScopes=[], java.lang.Class<?>[] requiredTypes=[])
- anno 0 javax.context.RequestScoped()
-intf java.lang.annotation.Annotation
-
14 years, 10 months
[webbeans-commits] Webbeans SVN: r2829 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/bean and 7 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-14 16:29:43 -0400 (Sun, 14 Jun 2009)
New Revision: 2829
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableTransformer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotated.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedAdaptor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolovableTransformer.java
Modified:
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Annotated.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedCallable.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedConstructor.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMember.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMethod.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedParameter.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanResolvableTransformer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ForwardingResolvable.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolvable.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableWBClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBConstructor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBField.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMethod.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBConstructor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBField.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMember.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMethod.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBParameter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBType.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ApplicationScopedTest.java
Log:
Start to merge Annotated* into core
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Annotated.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Annotated.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Annotated.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -1,12 +1,79 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package javax.enterprise.inject.spi;
import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Type;
import java.util.Set;
-public interface Annotated {
- public Type getType();
- public <T extends Annotation> T getAnnotation(Class<T> annotationType);
- public Set<Annotation> getAnnotations();
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType);
+/**
+ * The metadata for an annotated element which can be parsed by the
+ * {@link BeanManager}.
+ *
+ * The semantics are similar to {@link AnnotatedElement}.
+ *
+ *
+ * @author Pete Muir
+ * @author Clint Popetz
+ *
+ */
+public interface Annotated
+{
+
+ /**
+ * Get the type of the annotated element
+ *
+ * @return the type
+ */
+ public Type getBaseType();
+
+ /**
+ * Get all types the base type should be considered assignable to
+ *
+ * @return a set of types the base type should be considered assignable to
+ */
+ public Set<Type> getTypeClosure();
+
+ /**
+ * Get the annotation instance on the annoated element for a given annotation
+ * type.
+ *
+ * @param <T> the type of the annotation
+ * @param annotationType the class object of the annotation type
+ * @return the annotation instance, or null if no annotation is present for
+ * the given annotationType
+ */
+ public <T extends Annotation> T getAnnotation(Class<T> annotationType);
+
+ /**
+ * Get all the annotation instances on the annotated element
+ *
+ * @return the annotation instances, or an empty set if no annotations are
+ * present
+ */
+ public Set<Annotation> getAnnotations();
+
+ /**
+ * Determine if an annotation is present on the annotated element
+ *
+ * @param annotationType the annotation type to check for
+ * @return true if the annotation is present
+ */
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType);
}
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedCallable.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedCallable.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedCallable.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -1,7 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package javax.enterprise.inject.spi;
+import java.lang.reflect.Member;
import java.util.List;
-public interface AnnotatedCallable<X> extends AnnotatedMember<X> {
- public List<AnnotatedParameter<X>> getParameters();
+/**
+ * The metadata for a callable member which can be parsed by the
+ * {@link BeanManager}.
+ *
+ * The semantics are similar to {@link Member}
+ *
+ * @author Pete Muir
+ *
+ * @param <X> the type of the member
+ */
+public interface AnnotatedCallable<X> extends AnnotatedMember<X>
+{
+
+ /**
+ * Get the parameters of the callable member
+ *
+ * @return the parameters
+ */
+ public List<AnnotatedParameter<X>> getParameters();
+
}
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedConstructor.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedConstructor.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedConstructor.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -1,3 +1,20 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package javax.enterprise.inject.spi;
import java.lang.reflect.Constructor;
@@ -2,4 +19,22 @@
-public interface AnnotatedConstructor<X> extends AnnotatedCallable<X> {
- public Constructor<X> getJavaMember();
+/**
+ * The metadata for an annotated constructor which can be parsed by the
+ * {@link BeanManager}.
+ *
+ * The semantics are similar to {@link Constructor}
+ *
+ * @author Pete Muir
+ *
+ * @param <X> the type of declaring class
+ */
+public interface AnnotatedConstructor<X> extends AnnotatedCallable<X>
+{
+
+ /**
+ * Get the underlying {@link Constructor} instance
+ *
+ * @return the constructor instance
+ */
+ public Constructor<X> getJavaMember();
+
}
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedField.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -1,7 +1,41 @@
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package javax.enterprise.inject.spi;
import java.lang.reflect.Field;
+import java.lang.reflect.Member;
+/**
+ * The metadata for an annotated field which can be parsed by the {@link BeanManager}
+ *
+ * The semantics are similar to {@link Field}
+ *
+ * @author Pete Muir
+ *
+ * @param <X> the type of the field
+ */
public interface AnnotatedField<X> extends AnnotatedMember<X> {
- public Field getJavaMember();
+
+ /**
+ * Get the underlying {@link Member} instance
+ *
+ * @return the member instance
+ */
+ public Field getJavaMember();
+
}
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMember.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMember.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMember.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -1,3 +1,20 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package javax.enterprise.inject.spi;
import java.lang.reflect.Member;
@@ -2,6 +19,32 @@
-public interface AnnotatedMember<X> extends Annotated {
- public Member getJavaMember();
- public boolean isStatic();
- public AnnotatedType<X> getDeclaringType();
+/**
+ * The metadata for an annotated member which can be parsed by the
+ * {@link BeanManager}.
+ *
+ * The semantics are similar to {@link Member}
+ *
+ * @author Pete Muir
+ *
+ * @param <X> the type of the member
+ */
+public interface AnnotatedMember<X> extends Annotated
+{
+ /**
+ * Get the underlying {@link Member} instance
+ *
+ * @return the member
+ */
+ public Member getJavaMember();
+
+ /**
+ * Determine if the member is static
+ * @return
+ */
+ public boolean isStatic();
+
+ /**
+ * Get the type which declares this member
+ * @return the type of which declares this member
+ */
+ public AnnotatedType<X> getDeclaringType();
}
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMethod.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMethod.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedMethod.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -1,3 +1,19 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package javax.enterprise.inject.spi;
import java.lang.reflect.Method;
@@ -2,4 +18,21 @@
-public interface AnnotatedMethod<X> extends AnnotatedCallable<X> {
- public Method getJavaMember();
+/**
+ * The metadata for an annotated method which can be parsed by the
+ * {@link BeanManager}
+ *
+ * The semantics are similar to {@link Method}
+ *
+ * @author Pete Muir
+ *
+ * @param <X> the return type of the method
+ */
+public interface AnnotatedMethod<X> extends AnnotatedCallable<X>
+{
+
+ /**
+ * Get the underlying {@link Method} instance
+ *
+ * return the method
+ */
+ public Method getJavaMember();
}
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedParameter.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedParameter.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedParameter.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -1,6 +1,45 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package javax.enterprise.inject.spi;
-public interface AnnotatedParameter<X> extends Annotated {
- public int getPosition();
- public AnnotatedCallable<X> getDeclaringCallable();
+/**
+ * The metadata for an annotated parameter which can be parsed by the
+ * {@link BeanManager}
+ *
+ * @author Pete Muir
+ *
+ * @param <X> the type of the parameter
+ */
+public interface AnnotatedParameter<X> extends Annotated
+{
+
+ /**
+ * The position of the parameter in the callable's argument list
+ *
+ * @return the position of the parameter
+ */
+ public int getPosition();
+
+ /**
+ * The declaring callable
+ *
+ * @return the declaring callable
+ */
+ public AnnotatedCallable<X> getDeclaringCallable();
+
}
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/AnnotatedType.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -1,3 +1,20 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
package javax.enterprise.inject.spi;
import java.util.Set;
@@ -2,7 +19,43 @@
+/**
+ * The metadata for an annotated type which can be parsed by the {@link BeanManager}
+ *
+ * The semantics are similar to {@link Class}.
+ *
+ * @author Pete Muir
+ *
+ * @param <X> the type of the class
+ */
public interface AnnotatedType<X> extends Annotated {
- public Class<X> getJavaClass();
- public Set<AnnotatedConstructor<X>> getConstructors();
- public Set<AnnotatedMethod<? super X>> getMethods();
- public Set<AnnotatedField<? super X>> getFields();
+
+ /**
+ * Get the underlying class instance
+ *
+ * @return
+ */
+ public Class<X> getJavaClass();
+
+ /**
+ * Get the constructors belonging to the class
+ *
+ * If an empty set is returned, a default (no-args) constructor will be
+ * assumed.
+ *
+ * @return the constructors, or an empty set if none are defined
+ */
+ public Set<AnnotatedConstructor<X>> getConstructors();
+
+ /**
+ * Get the business methods belonging to the class.
+ *
+ * @return the methods, or an empty set if none are defined
+ */
+ public Set<AnnotatedMethod<? super X>> getMethods();
+
+ /**
+ * Get the fields belonging to the class
+ *
+ * @return the fields, or an empty set if none are defined
+ */
+ public Set<AnnotatedField<? super X>> getFields();
}
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/BeanManager.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -401,7 +401,7 @@
* @param <T>
* The type of the underlying bean
* @param type
- * The metadat for construction of the ManagedBean
+ * The metadata for construction of the ManagedBean
*/
public <T> ManagedBean<T> createManagedBean(AnnotatedType<T> type);
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -40,8 +40,8 @@
import org.jboss.webbeans.context.DependentInstancesStore;
import org.jboss.webbeans.conversation.ConversationImpl;
import org.jboss.webbeans.injection.WBInjectionPoint;
+import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.introspector.WBField;
-import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.literal.AnyLiteral;
import org.jboss.webbeans.literal.CurrentLiteral;
@@ -69,9 +69,9 @@
private static Set<Class<?>> STANDARD_WEB_BEAN_CLASSES = new HashSet<Class<?>>(Arrays.asList(Event.class, BeanManagerImpl.class, ConversationImpl.class));
private boolean proxyable;
-
+
protected final DependentInstancesStore dependentInstancesStore;
-
+
/**
* Helper class for getting deployment type
*
@@ -119,11 +119,11 @@
protected BeanManagerImpl manager;
protected boolean _serializable;
-
+
private boolean initialized;
-
+
private Set<WBInjectionPoint<?, ?>> decoratesInjectionPoint;
-
+
protected boolean isInitialized()
{
return initialized;
@@ -190,7 +190,7 @@
}
}
}
-
+
protected Set<WBInjectionPoint<?, ?>> getDecoratesInjectionPoint()
{
return decoratesInjectionPoint;
@@ -201,7 +201,7 @@
*/
protected void initTypes()
{
- types = getAnnotatedItem().getFlattenedTypeHierarchy();
+ types = getAnnotatedItem().getTypeClosure();
}
/**
@@ -214,7 +214,7 @@
initDefaultBindings();
log.trace("Using binding types " + bindings + " specified by annotations");
}
-
+
protected abstract void initInjectionPoints();
protected void initDefaultBindings()
@@ -336,7 +336,7 @@
return false;
}
}
-
+
/**
* Validates the deployment type
*/
@@ -490,7 +490,7 @@
*
* @return The set of API types
*
- * @see org.jboss.webbeans.bean.BaseBean#getTypes()
+ * @see org.jboss.webbeans.bean.BaseBean#getTypeClosure()
*/
public Set<Type> getTypes()
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -77,7 +77,7 @@
super(manager);
this.declaringBean = declaringBean;
}
-
+
@Override
protected abstract WBMember<T, S> getAnnotatedItem();
@@ -110,7 +110,7 @@
{
Set<Type> types = new HashSet<Type>();
types.add(Object.class);
- types.addAll(getAnnotatedItem().getFlattenedTypeHierarchy());
+ types.addAll(getAnnotatedItem().getTypeClosure());
super.types = types;
}
else
@@ -168,13 +168,13 @@
*/
protected void checkProducerReturnType()
{
- if (getAnnotatedItem().getType() instanceof TypeVariable<?>)
+ if (getAnnotatedItem().getBaseType() instanceof TypeVariable<?>)
{
- throw new DefinitionException("Return type must be concrete " + getAnnotatedItem().getType());
+ throw new DefinitionException("Return type must be concrete " + getAnnotatedItem().getBaseType());
}
- if (getAnnotatedItem().getType() instanceof WildcardType)
+ if (getAnnotatedItem().getBaseType() instanceof WildcardType)
{
- throw new DefinitionException("Return type must be concrete " + getAnnotatedItem().getType());
+ throw new DefinitionException("Return type must be concrete " + getAnnotatedItem().getBaseType());
}
for (Type type : getAnnotatedItem().getActualTypeArguments())
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -14,25 +14,25 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
+import org.jboss.webbeans.injection.MethodInjectionPoint;
import org.jboss.webbeans.injection.WBInjectionPoint;
-import org.jboss.webbeans.injection.MethodInjectionPoint;
+import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.introspector.WBClass;
-import org.jboss.webbeans.introspector.WBAnnotated;
public class DecoratorBean<T> extends SimpleBean<T> implements Decorator<T>
{
-
+
public static <T> Decorator<T> wrapForResolver(final Decorator<T> decorator)
{
return new ForwardingDecorator<T>()
{
-
+
@Override
public Set<Annotation> getBindings()
{
return delegate().getDelegateBindings();
}
-
+
@Override
public Set<Type> getTypes()
{
@@ -44,10 +44,10 @@
{
return decorator;
}
-
+
};
}
-
+
/**
* Creates a decorator bean
*
@@ -70,7 +70,7 @@
{
super(type, manager);
}
-
+
@Override
public void initialize(BeanDeployerEnvironment environment)
{
@@ -83,19 +83,19 @@
initDelegateType();
}
}
-
+
protected void initDecoratedTypes()
{
this.decoratedTypes = new HashSet<Type>();
this.decoratedTypes.addAll(getAnnotatedItem().getInterfaceOnlyFlattenedTypeHierarchy());
this.decoratedTypes.remove(Serializable.class);
}
-
+
protected void initDelegate()
{
this.decorates = getDecoratesInjectionPoint().iterator().next();
}
-
+
@Override
protected void checkDecorates()
{
@@ -115,17 +115,17 @@
throw new DefinitionException("Too many @Decorates injection point defined " + this);
}
}
-
+
protected void initDelegateBindings()
{
this.delegateBindings = this.decorates.getBindings();
}
-
+
protected void initDelegateType()
{
- this.delegateType = this.decorates.getType();
+ this.delegateType = this.decorates.getBaseType();
}
-
+
protected void checkDelegateType()
{
for (Type decoratedType : getDecoratedTypes())
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -35,9 +35,9 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
-import org.jboss.webbeans.injection.WBInjectionPoint;
import org.jboss.webbeans.injection.MethodInjectionPoint;
import org.jboss.webbeans.injection.ParameterInjectionPoint;
+import org.jboss.webbeans.injection.WBInjectionPoint;
import org.jboss.webbeans.introspector.WBMethod;
import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.log.LogProvider;
@@ -65,7 +65,7 @@
this.id = createId("DisposalMethod-" + declaringBean.getName() + "-" + disposalMethod.getSignature().toString());
}
-
+
@SuppressWarnings("unchecked")
protected void initType()
{
@@ -126,7 +126,7 @@
{
Set<Type> types = new HashSet<Type>();
types = new HashSet<Type>();
- types.addAll(disposalMethodInjectionPoint.getAnnotatedParameters(Disposes.class).get(0).getFlattenedTypeHierarchy());
+ types.addAll(disposalMethodInjectionPoint.getAnnotatedParameters(Disposes.class).get(0).getTypeClosure());
types.add(getType());
types.add(Object.class);
super.types = types;
@@ -173,7 +173,7 @@
{
return declaringBean.isSerializable();
}
-
+
@Override
public boolean isProxyable()
{
@@ -260,7 +260,7 @@
}
this.specializedBean = environment.getDisposalMethod(superClassMethod);
}
-
+
@Override
public Class<T> getType()
{
@@ -344,5 +344,5 @@
{
return id;
}
-
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -28,7 +28,7 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.event.EventImpl;
-import org.jboss.webbeans.injection.resolution.ResolovableTransformer;
+import org.jboss.webbeans.injection.resolution.ResolvableTransformer;
import org.jboss.webbeans.literal.AnyLiteral;
public class EventBean extends AbstractFacadeBean<Event<?>>
@@ -38,7 +38,7 @@
private static final Set<Type> DEFAULT_TYPES = new HashSet<Type>(Arrays.asList(TYPE, Object.class));
private static final Annotation ANY = new AnyLiteral();
private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(ANY));
- public static final ResolovableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(Event.class, ANY);
+ public static final ResolvableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(Event.class, ANY);
private static final Set<Class<? extends Annotation>> FILTERED_ANNOTATION_TYPES = new HashSet<Class<? extends Annotation>>(Arrays.asList(Obtains.class));
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanResolvableTransformer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanResolvableTransformer.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanResolvableTransformer.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -24,7 +24,7 @@
import java.util.Set;
import org.jboss.webbeans.injection.resolution.ForwardingResolvable;
-import org.jboss.webbeans.injection.resolution.ResolovableTransformer;
+import org.jboss.webbeans.injection.resolution.ResolvableTransformer;
import org.jboss.webbeans.injection.resolution.Resolvable;
/**
@@ -33,14 +33,14 @@
* @author Pete Muir
*
*/
-public class FacadeBeanResolvableTransformer implements ResolovableTransformer
+public class FacadeBeanResolvableTransformer implements ResolvableTransformer
{
-
+
private final Class<?> clazz;
private final Annotation annotation;
private final Set<Annotation> bindings;
private final HashSet<Type> types;
-
+
public FacadeBeanResolvableTransformer(Class<?> clazz, Annotation annotation)
{
this.clazz = clazz;
@@ -56,7 +56,7 @@
{
if (resolvable.isAnnotationPresent(annotation.annotationType()))
{
-
+
return new ForwardingResolvable()
{
@@ -65,35 +65,35 @@
{
return resolvable;
}
-
+
@Override
public Set<Annotation> getBindings()
{
return Collections.unmodifiableSet(bindings);
}
-
+
@Override
- public Set<Type> getTypes()
+ public Set<Type> getTypeClosure()
{
return Collections.unmodifiableSet(types);
}
-
+
@Override
public boolean isAssignableTo(Class<?> clazz)
{
return clazz.isAssignableFrom(clazz);
}
-
+
@Override
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
{
return annotation.annotationType().equals(annotationType);
}
-
+
};
}
}
return resolvable;
}
-
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -28,7 +28,7 @@
import org.jboss.webbeans.InstanceImpl;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.injection.resolution.ResolovableTransformer;
+import org.jboss.webbeans.injection.resolution.ResolvableTransformer;
import org.jboss.webbeans.literal.ObtainsLiteral;
public class InstanceBean extends AbstractFacadeBean<Instance<?>>
@@ -39,7 +39,7 @@
private static final Obtains OBTAINS = new ObtainsLiteral();
private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(OBTAINS));
private static final Set<Class<? extends Annotation>> FILTERED_ANNOTATION_TYPES = new HashSet<Class<? extends Annotation>>(Arrays.asList(Obtains.class));
- public static final ResolovableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(TYPE, OBTAINS);
+ public static final ResolvableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(TYPE, OBTAINS);
public static AbstractFacadeBean<Instance<?>> of(BeanManagerImpl manager)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -79,13 +79,13 @@
this.manager = manager;
this.observerBean = observerBean;
this.observerMethod = MethodInjectionPoint.of(observerBean, observer);
- this.eventType = observerMethod.getAnnotatedParameters(Observes.class).get(0).getType();
+ this.eventType = observerMethod.getAnnotatedParameters(Observes.class).get(0).getBaseType();
this.bindings = observerMethod.getAnnotatedParameters(Observes.class).get(0).getBindingsAsArray();
this.conditional = !observerMethod.getAnnotatedParameters(IfExists.class).isEmpty();
this.asynchronous = !observerMethod.getAnnotatedParameters(Asynchronously.class).isEmpty();
}
-
+
/**
* Completes initialization of the observer and allows derived types to
* override behavior.
@@ -143,7 +143,7 @@
{
throw new DefinitionException(this + " cannot be annotated with @Initializer");
}
-
+
// We cannot allow asynchronously invoked conditional observers either
if (this.asynchronous && this.conditional)
{
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedAdaptor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedAdaptor.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedAdaptor.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -1,43 +0,0 @@
-package org.jboss.webbeans.injection;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Set;
-
-import javax.enterprise.inject.spi.Annotated;
-
-import org.jboss.webbeans.introspector.WBAnnotated;
-
-public class AnnotatedAdaptor implements Annotated
-{
-
- private final WBAnnotated<?, ?> annotatedItem;
-
- public AnnotatedAdaptor(WBAnnotated<?, ?> annotatedItem)
- {
- this.annotatedItem = annotatedItem;
- }
-
- public <T extends Annotation> T getAnnotation(Class<T> annotationType)
- {
- return annotatedItem.getAnnotation(annotationType);
- }
-
- public Set<Annotation> getAnnotations()
- {
- return annotatedItem.getAnnotations();
- }
-
- public Type getType()
- {
- return annotatedItem.getType();
- }
-
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
- {
- return annotationType.isAnnotationPresent(annotationType);
- }
-
-
-
-}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -32,18 +32,18 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.introspector.ForwardingWBConstructor;
import org.jboss.webbeans.introspector.WBConstructor;
import org.jboss.webbeans.introspector.WBParameter;
-import org.jboss.webbeans.introspector.ForwardingWBConstructor;
public class ConstructorInjectionPoint<T> extends ForwardingWBConstructor<T> implements WBInjectionPoint<T, Constructor<T>>
{
-
+
private abstract class ForwardingParameterInjectionPointList extends AbstractList<ParameterInjectionPoint<?>>
{
-
+
protected abstract List<? extends WBParameter<?>> delegate();
-
+
protected abstract Bean<?> declaringBean();;
@Override
@@ -51,17 +51,17 @@
{
return ParameterInjectionPoint.of(declaringBean, delegate().get(index));
}
-
+
@Override
public int size()
{
return delegate().size();
}
-
+
}
-
+
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
-
+
private final Bean<?> declaringBean;
private final WBConstructor<T> constructor;
@@ -69,13 +69,13 @@
{
return new ConstructorInjectionPoint<T>(declaringBean, constructor);
}
-
+
protected ConstructorInjectionPoint(Bean<?> declaringBean, WBConstructor<T> constructor)
{
this.declaringBean = declaringBean;
this.constructor = constructor;
}
-
+
@Override
protected WBConstructor<T> delegate()
{
@@ -91,7 +91,7 @@
{
return delegate().getBindings();
}
-
+
public T newInstance(BeanManagerImpl manager, CreationalContext<?> creationalContext)
{
try
@@ -116,7 +116,7 @@
}
return null;
}
-
+
@Override
public List<ParameterInjectionPoint<?>> getParameters()
{
@@ -132,13 +132,13 @@
@Override
protected List<? extends WBParameter<?>> delegate()
- {
+ {
return delegate;
- }
-
+ }
+
};
}
-
+
public void inject(Object declaringInstance, Object value)
{
throw new UnsupportedOperationException();
@@ -170,7 +170,7 @@
}
return parameterValues;
}
-
+
public Type getType()
{
return getRawType();
@@ -178,7 +178,7 @@
public Annotated getAnnotated()
{
- return new AnnotatedAdaptor(delegate());
+ return delegate();
}
public boolean isDelegate()
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -20,6 +20,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Field;
+import java.lang.reflect.Type;
import java.util.Set;
import javax.enterprise.context.spi.CreationalContext;
@@ -27,8 +28,8 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.introspector.ForwardingWBField;
import org.jboss.webbeans.introspector.WBField;
-import org.jboss.webbeans.introspector.ForwardingWBField;
public class FieldInjectionPoint<T> extends ForwardingWBField<T> implements WBInjectionPoint<T, Field>
{
@@ -99,7 +100,7 @@
public Annotated getAnnotated()
{
- return new AnnotatedAdaptor(delegate());
+ return delegate();
}
public boolean isDelegate()
@@ -108,4 +109,9 @@
return false;
}
+ public Type getType()
+ {
+ return getBaseType();
+ }
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -21,6 +21,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.lang.reflect.Type;
import java.util.AbstractList;
import java.util.Iterator;
import java.util.List;
@@ -31,18 +32,18 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.introspector.ForwardingWBMethod;
import org.jboss.webbeans.introspector.WBMethod;
import org.jboss.webbeans.introspector.WBParameter;
-import org.jboss.webbeans.introspector.ForwardingWBMethod;
public class MethodInjectionPoint<T> extends ForwardingWBMethod<T> implements WBInjectionPoint<T, Method>
{
-
+
private abstract class ForwardingParameterInjectionPointList extends AbstractList<ParameterInjectionPoint<?>>
{
-
+
protected abstract List<? extends WBParameter<?>> delegate();
-
+
protected abstract Bean<?> declaringBean();;
@Override
@@ -50,17 +51,17 @@
{
return ParameterInjectionPoint.of(declaringBean, delegate().get(index));
}
-
+
@Override
public int size()
{
return delegate().size();
}
-
+
}
-
+
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
-
+
private final Bean<?> declaringBean;
private final WBMethod<T> method;
@@ -68,13 +69,13 @@
{
return new MethodInjectionPoint<T>(declaringBean, method);
}
-
+
protected MethodInjectionPoint(Bean<?> declaringBean, WBMethod<T> method)
{
this.declaringBean = declaringBean;
this.method = method;
}
-
+
@Override
protected WBMethod<T> delegate()
{
@@ -90,7 +91,7 @@
{
return delegate().getBindings();
}
-
+
public T invoke(Object declaringInstance, BeanManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
{
try
@@ -111,7 +112,7 @@
}
return null;
}
-
+
@SuppressWarnings("unchecked")
public T invokeWithSpecialValue(Object declaringInstance, Class<? extends Annotation> annotatedParameter, Object parameter, BeanManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
{
@@ -133,7 +134,7 @@
}
return null;
}
-
+
public T invokeOnInstance(Object declaringInstance, BeanManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
{
try
@@ -162,7 +163,7 @@
}
return null;
}
-
+
@SuppressWarnings("unchecked")
public T invokeOnInstanceWithSpecialValue(Object declaringInstance, Class<? extends Annotation> annotatedParameter, Object parameter, BeanManagerImpl manager, CreationalContext<?> creationalContext, Class<? extends RuntimeException> exceptionTypeToThrow)
{
@@ -192,7 +193,7 @@
}
return null;
}
-
+
@Override
public List<ParameterInjectionPoint<?>> getParameters()
{
@@ -208,13 +209,13 @@
@Override
protected List<? extends WBParameter<?>> delegate()
- {
+ {
return delegate;
- }
-
+ }
+
};
}
-
+
public void inject(Object declaringInstance, Object value)
{
try
@@ -264,7 +265,7 @@
public Annotated getAnnotated()
{
- return new AnnotatedAdaptor(delegate());
+ return delegate();
}
public boolean isDelegate()
@@ -278,5 +279,10 @@
// TODO Auto-generated method stub
return false;
}
-
+
+ public Type getType()
+ {
+ return getBaseType();
+ }
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -18,6 +18,7 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.Member;
+import java.lang.reflect.Type;
import java.util.Set;
import javax.enterprise.context.spi.CreationalContext;
@@ -25,19 +26,19 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.introspector.ForwardingWBParameter;
import org.jboss.webbeans.introspector.WBParameter;
-import org.jboss.webbeans.introspector.ForwardingWBParameter;
public class ParameterInjectionPoint<T> extends ForwardingWBParameter<T> implements WBInjectionPoint<T, Object>
{
-
+
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
-
+
public static <T> ParameterInjectionPoint<T> of(Bean<?> declaringBean, WBParameter<T> parameter)
{
return new ParameterInjectionPoint<T>(declaringBean, parameter);
}
-
+
private final Bean<?> declaringBean;
private final WBParameter<T> parameter;
@@ -67,12 +68,12 @@
{
return delegate().getDeclaringMember().getMember();
}
-
+
public void inject(Object declaringInstance, Object value)
{
throw new UnsupportedOperationException();
}
-
+
@SuppressWarnings("unchecked")
public T getValueToInject(BeanManagerImpl manager, CreationalContext<?> creationalContext)
{
@@ -81,7 +82,7 @@
public Annotated getAnnotated()
{
- return new AnnotatedAdaptor(delegate());
+ return delegate();
}
public boolean isDelegate()
@@ -96,4 +97,9 @@
return false;
}
+ public Type getType()
+ {
+ return getBaseType();
+ }
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ForwardingResolvable.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ForwardingResolvable.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ForwardingResolvable.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -19,9 +19,9 @@
return delegate().isAnnotationPresent(annotationType);
}
- public Set<Type> getTypes()
+ public Set<Type> getTypeClosure()
{
- return delegate().getTypes();
+ return delegate().getTypeClosure();
}
public boolean isAssignableTo(Class<?> clazz)
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolovableTransformer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolovableTransformer.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolovableTransformer.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -1,26 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.injection.resolution;
-
-
-
-public interface ResolovableTransformer
-{
-
- public Resolvable transform(Resolvable element);
-
-}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolvable.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolvable.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolvable.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -19,6 +19,6 @@
public boolean isAssignableTo(Class<?> clazz);
- public Set<Type> getTypes();
+ public Set<Type> getTypeClosure();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -10,7 +10,7 @@
public class ResolvableFactory
{
-
+
public static Resolvable of(WBAnnotated<?, ?> element)
{
if (element instanceof Resolvable)
@@ -20,25 +20,25 @@
else
{
Set<Type> types = new HashSet<Type>();
- types.add(element.getType());
+ types.add(element.getBaseType());
return new ResolvableImpl(element.getBindings(), types);
}
}
-
+
private ResolvableFactory() {}
-
+
private static class ResolvableImpl implements Resolvable
{
-
+
private final Set<Annotation> bindings;
private final Set<Class<? extends Annotation>> annotationTypes;
- private final Set<Type> types;
-
- public ResolvableImpl(Set<Annotation> bindings, Set<Type> types)
+ private final Set<Type> typeClosure;
+
+ public ResolvableImpl(Set<Annotation> bindings, Set<Type> typeClosure)
{
this.bindings = bindings;
this.annotationTypes = new HashSet<Class<? extends Annotation>>();
- this.types = types;
+ this.typeClosure = typeClosure;
for (Annotation annotation : bindings)
{
annotationTypes.add(annotation.annotationType());
@@ -54,17 +54,23 @@
{
return annotationTypes.contains(annotationType);
}
-
- public Set<Type> getTypes()
+
+ public Set<Type> getTypeClosure()
{
- return types;
+ return typeClosure;
}
-
+
public boolean isAssignableTo(Class<?> clazz)
{
- return Reflections.isAssignableFrom(clazz, types);
+ return Reflections.isAssignableFrom(clazz, typeClosure);
}
-
+
+ @Override
+ public String toString()
+ {
+ return "Types: " + getTypeClosure() + "; Bindings: " + getBindings();
+ }
+
}
}
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableTransformer.java (from rev 2827, ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolovableTransformer.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableTransformer.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableTransformer.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -0,0 +1,26 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.injection.resolution;
+
+
+
+public interface ResolvableTransformer
+{
+
+ public Resolvable transform(Resolvable element);
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableTransformer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableWBClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableWBClass.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableWBClass.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -32,31 +32,31 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.injection.WBInjectionPoint;
-import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.introspector.jlr.AbstractWBAnnotated;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
public class ResolvableWBClass<T> extends AbstractWBAnnotated<T, Class<T>> implements Resolvable
{
-
+
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
private static final Set<Annotation> EMPTY_ANNOTATION_SET = Collections.emptySet();
-
+
private final Class<T> rawType;
- private final Set<Type> types;
+ private final Set<Type> typeClosure;
private final Type[] actualTypeArguments;
-
+
private final String _string;
-
+
private final BeanManagerImpl manager;
-
+
public static <T> WBAnnotated<T, Class<T>> of(TypeLiteral<T> typeLiteral, Annotation[] annotations, BeanManagerImpl manager)
{
return new ResolvableWBClass<T>(typeLiteral.getType(), annotations, manager);
}
-
+
public static <T> WBAnnotated<T, Class<T>> of(Type type, Annotation[] annotations, BeanManagerImpl manager)
{
return new ResolvableWBClass<T>(type, annotations, manager);
@@ -75,7 +75,7 @@
return new ResolvableWBClass<T>(injectionPoint.getType(), injectionPoint.getAnnotated().getAnnotations(), manager);
}
}
-
+
public static <T> WBAnnotated<T, Class<T>> of(Member member, Annotation[] annotations, BeanManagerImpl manager)
{
if (member instanceof Field)
@@ -91,13 +91,13 @@
throw new IllegalStateException();
}
}
-
+
private ResolvableWBClass(Type type, AnnotationStore annotationStore, BeanManagerImpl manager)
{
super(annotationStore);
-
+
this.manager = manager;
-
+
if (type instanceof ParameterizedType)
{
ParameterizedType parameterizedType = (ParameterizedType) type;
@@ -122,15 +122,15 @@
{
throw new IllegalArgumentException("Unable to extract type information from " + type);
}
- this.types = new HashSet<Type>();
- types.add(type);
+ this.typeClosure = new HashSet<Type>();
+ typeClosure.add(type);
}
-
+
private ResolvableWBClass(Type type, Annotation[] annotations, BeanManagerImpl manager)
{
this(type, AnnotationStore.of(annotations, EMPTY_ANNOTATION_ARRAY), manager);
}
-
+
private ResolvableWBClass(Type type, Set<Annotation>annotations, BeanManagerImpl manager)
{
this(type, AnnotationStore.of(annotations, EMPTY_ANNOTATION_SET), manager);
@@ -164,12 +164,6 @@
{
return rawType;
}
-
- @Override
- public Type getType()
- {
- return getRawType();
- }
public boolean isFinal()
{
@@ -185,27 +179,27 @@
{
throw new UnsupportedOperationException();
}
-
+
@Override
- public Set<Type> getFlattenedTypeHierarchy()
+ public boolean isProxyable()
{
throw new UnsupportedOperationException();
}
-
- @Override
- public boolean isProxyable()
+
+ public Set<Type> getTypeClosure()
{
- throw new UnsupportedOperationException();
+ return typeClosure;
}
- public Set<Type> getTypes()
+ @Override
+ public Type getBaseType()
{
- return types;
+ return getRawType();
}
public boolean isAssignableTo(Class<?> clazz)
{
- return Reflections.isAssignableFrom(clazz, getType());
+ return Reflections.isAssignableFrom(clazz, getBaseType());
}
}
\ No newline at end of file
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -59,7 +59,7 @@
public boolean matches(Set<Type> types, Set<Annotation> bindings)
{
- return Reflections.isAssignableFrom(this.getTypes(), types) && Beans.containsAllBindings(this.getBindings(), bindings, manager);
+ return Reflections.isAssignableFrom(this.getTypeClosure(), types) && Beans.containsAllBindings(this.getBindings(), bindings, manager);
}
@Override
@@ -68,7 +68,7 @@
if (obj instanceof Resolvable)
{
Resolvable that = (Resolvable) obj;
- return this.matches(that.getTypes(), that.getBindings());
+ return this.matches(that.getTypeClosure(), that.getBindings());
}
else
{
@@ -92,7 +92,7 @@
private final BeanManagerImpl manager;
// Annotation transformers used to mutate annotations during resolution
- private final Set<ResolovableTransformer> transformers;
+ private final Set<ResolvableTransformer> transformers;
/**
* Constructor
@@ -105,7 +105,7 @@
this.injectionPoints = new HashSet<WBAnnotated<?, ?>>();
this.resolvedInjectionPoints = new ConcurrentCache<Resolvable, Set<Bean<?>>>();
this.resolvedNames = new ConcurrentCache<String, Set<Bean<?>>>();
- this.transformers = new HashSet<ResolovableTransformer>();
+ this.transformers = new HashSet<ResolvableTransformer>();
transformers.add(EventBean.TRANSFORMER);
transformers.add(InstanceBean.TRANSFORMER);
}
@@ -187,7 +187,7 @@
private Resolvable transformElement(Resolvable element)
{
- for (ResolovableTransformer transformer : transformers)
+ for (ResolvableTransformer transformer : transformers)
{
element = transformer.transform(element);
}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotated.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotated.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotated.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Annotated;
+
+/**
+ * Base class to allow implementation of the decorator pattern
+ *
+ * @author Pete Muir
+ *
+ * @param <T> the base type
+ * @param <S> the annotated element type
+ */
+public abstract class ForwardingAnnotated<T, S> implements Annotated
+{
+
+ protected abstract Annotated delegate();
+
+ public <A extends Annotation> A getAnnotation(Class<A> annotationType)
+ {
+ return delegate().getAnnotation(annotationType);
+ }
+
+ public Set<Annotation> getAnnotations()
+ {
+ return delegate().getAnnotations();
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return delegate().isAnnotationPresent(annotationType);
+ }
+
+ public Type getBaseType()
+ {
+ return delegate().getBaseType();
+ }
+
+ public Set<Type> getTypeClosure()
+ {
+ return delegate().getTypeClosure();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotated.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -28,104 +28,51 @@
* @param <T>
* @param <S>
*/
-public abstract class ForwardingWBAnnotated<T, S> implements WBAnnotated<T, S>
+public abstract class ForwardingWBAnnotated<T, S> extends ForwardingAnnotated<T, S> implements WBAnnotated<T, S>
{
- /**
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
public Type[] getActualTypeArguments()
{
return delegate().getActualTypeArguments();
}
- /**
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
- public <A extends Annotation> A getAnnotation(Class<A> annotationType)
- {
- return delegate().getAnnotation(annotationType);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
- public Set<Annotation> getAnnotations()
- {
- return delegate().getAnnotations();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
{
return delegate().getMetaAnnotations(metaAnnotationType);
}
- /**
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
{
return delegate().getMetaAnnotationsAsArray(metaAnnotationType);
}
- /**
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
@Deprecated
public Set<Annotation> getBindings()
{
return delegate().getBindings();
}
- /**
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
@Deprecated
public Annotation[] getBindingsAsArray()
{
return delegate().getBindingsAsArray();
}
-
- /**
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
- {
- return delegate().isAnnotationPresent(annotationType);
- }
-
+
public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
{
return delegate().getDeclaredMetaAnnotations(metaAnnotationType);
}
- /**
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
public String getName()
{
return delegate().getName();
}
- /**
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
public Class<T> getRawType()
{
return delegate().getRawType();
}
-
- public Type getType()
- {
- return delegate().getType();
- }
- /**
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
public boolean isAssignableFrom(WBAnnotated<?, ?> that)
{
return delegate().isAssignableFrom(that);
@@ -136,95 +83,43 @@
return delegate().isAssignableFrom(type, actualTypeArguments);
}
- /**
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
public boolean isFinal()
{
return delegate().isFinal();
}
- /**
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
public boolean isStatic()
{
return delegate().isStatic();
}
- /**
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
public boolean isProxyable()
{
return delegate().isProxyable();
}
-
+
public boolean isPublic()
{
return delegate().isPublic();
}
- /**
- * Overridden method into delegate
- *
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
- @Override
- public boolean equals(Object obj)
- {
- return delegate().equals(obj);
- }
-
- /**
- * Overridden method into delegate
- *
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
- @Override
- public int hashCode()
- {
- return delegate().hashCode();
- }
-
- /**
- * Overridden method into delegate
- *
- * @see org.jboss.webbeans.introspector.WBAnnotated
- */
- @Override
- public String toString()
- {
- return delegate().toString();
- }
-
- /**
- * Gets the annotated item
- *
- * @return The annotated item
- */
protected abstract WBAnnotated<T, S> delegate();
-
+
public AnnotationStore getAnnotationStore()
{
return delegate().getAnnotationStore();
}
-
+
public boolean isDeclaredAnnotationPresent(Class<? extends Annotation> annotationType)
{
return delegate().isDeclaredAnnotationPresent(annotationType);
}
-
- public Set<Type> getFlattenedTypeHierarchy()
- {
- return delegate().getFlattenedTypeHierarchy();
- }
-
+
public Set<Type> getInterfaceOnlyFlattenedTypeHierarchy()
{
return delegate().getInterfaceOnlyFlattenedTypeHierarchy();
}
-
+
public boolean isParameterizedType()
{
return delegate().isParameterizedType();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBConstructor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBConstructor.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBConstructor.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -32,9 +32,9 @@
return delegate().getAnnotatedParameters(annotationType);
}
- public WBType<T> getDeclaringClass()
+ public WBType<T> getDeclaringType()
{
- return delegate().getDeclaringClass();
+ return delegate().getDeclaringType();
}
public List<? extends WBParameter<?>> getParameters()
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBField.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBField.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBField.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -34,9 +34,9 @@
return delegate().getAnnotatedField();
}
- public WBType<?> getDeclaringClass()
+ public WBType<?> getDeclaringType()
{
- return delegate().getDeclaringClass();
+ return delegate().getDeclaringType();
}
public String getPropertyName()
@@ -53,5 +53,5 @@
{
return delegate().isTransient();
}
-
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMethod.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMethod.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMethod.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -23,23 +23,23 @@
public abstract class ForwardingWBMethod<T> extends ForwardingWBMember<T, Method> implements WBMethod<T>
{
-
+
@Override
protected abstract WBMethod<T> delegate();
-
+
public Method getAnnotatedMethod()
{
return delegate().getAnnotatedMethod();
}
-
+
public List<WBParameter<?>> getAnnotatedParameters(Class<? extends Annotation> metaAnnotationType)
{
return delegate().getAnnotatedParameters(metaAnnotationType);
}
- public WBType<?> getDeclaringClass()
+ public WBType<?> getDeclaringType()
{
- return delegate().getDeclaringClass();
+ return delegate().getDeclaringType();
}
public Class<?>[] getParameterTypesAsArray()
@@ -48,9 +48,9 @@
}
public List<? extends WBParameter<?>> getParameters()
- {
+ {
return delegate().getParameters();
- }
+ }
public String getPropertyName()
{
@@ -71,10 +71,10 @@
{
return delegate().isEquivalent(method);
}
-
+
public MethodSignature getSignature()
{
return delegate().getSignature();
}
-
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -26,6 +26,7 @@
import javax.enterprise.inject.BindingType;
import javax.enterprise.inject.Stereotype;
import javax.enterprise.inject.deployment.DeploymentType;
+import javax.enterprise.inject.spi.Annotated;
/**
* AnnotatedItem provides a uniform access to the annotations on an annotated
@@ -34,20 +35,12 @@
* @author Pete Muir
*
*/
-public interface WBAnnotated<T, S>
+public interface WBAnnotated<T, S> extends Annotated
{
-
-// The set of meta-annotations to map
+
+ // The set of meta-annotations to map
@SuppressWarnings("unchecked")
public static final Set<Class<? extends Annotation>> MAPPED_METAANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(BindingType.class, DeploymentType.class, Stereotype.class, ScopeType.class));
-
- /**
- * Gets all annotations on the item
- *
- * @return A set of annotations. Returns an empty set if there are no
- * matches.
- */
- public <A extends Annotation> Set<A> getAnnotations();
/**
* Gets all annotations which are annotated with the given meta annotation
@@ -58,7 +51,7 @@
* are no matches.
*/
public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType);
-
+
/**
* Gets all annotations which are declared on this annotated item
* with the given meta annotation type
@@ -100,24 +93,6 @@
public Annotation[] getBindingsAsArray();
/**
- * Gets an annotation for the annotation type specified.
- *
- * @param annotationType The annotation to match
- * @return An annotation if found, null if the annotation wasn't present.
- */
- public <A extends Annotation> A getAnnotation(Class<A> annotationType);
-
- /**
- * Get the whole type hierarchy as a set of flattened types.
- *
- * The returned types should have any type parameters resolved to their
- * actual types.
- *
- * @return the type hierarchy
- */
- public Set<Type> getFlattenedTypeHierarchy();
-
- /**
* Get the type hierarchy of any interfaces implemented by this class.
*
* Interface hierarchies from super classes are not included.
@@ -135,14 +110,6 @@
* @param annotationType The annotation to match
* @return True if present, false if not
*/
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType);
-
- /**
- * Indicates if an annotation type specified is present
- *
- * @param annotationType The annotation to match
- * @return True if present, false if not
- */
public boolean isDeclaredAnnotationPresent(Class<? extends Annotation> annotationType);
/**
@@ -151,8 +118,6 @@
* @return The type of the element
*/
public Class<T> getRawType();
-
- public Type getType();
/**
* Extends Java Class assignability such that actual type parameters are also
@@ -162,7 +127,7 @@
* @return True if assignable, false otherwise.
*/
public boolean isAssignableFrom(WBAnnotated<?, ?> that);
-
+
/**
* Extends Java Class assignability such that actual type parameters are also
* considered
@@ -200,7 +165,7 @@
* @return True if proxyable, false otherwise
*/
public boolean isProxyable();
-
+
/**
* Indicates if this annotated item is public
*
@@ -217,9 +182,9 @@
* @return The name
*/
public String getName();
-
+
public AnnotationStore getAnnotationStore();
-
+
public boolean isParameterizedType();
}
\ No newline at end of file
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBClass.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBClass.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -35,7 +35,7 @@
* @return A set of abstracted fields
*/
public Set<WBField<?>> getFields();
-
+
/**
* Get a field by name
*
@@ -55,7 +55,7 @@
* empty set if there are no matches
*/
public Set<WBField<?>> getAnnotatedFields(Class<? extends Annotation> annotationType);
-
+
/**
* Gets all fields which are annotated with the given annotation type on this
* class only.
@@ -97,7 +97,7 @@
* @return The no-args constructor, or null if not defined
*/
public WBConstructor<T> getNoArgsConstructor();
-
+
/**
* Get the constructor which matches the argument list provided
*
@@ -114,7 +114,7 @@
* empty set if there are no matches
*/
public Set<WBMethod<?>> getAnnotatedMethods(Class<? extends Annotation> annotationType);
-
+
/**
* Gets all methods annotated with annotationType
*
@@ -123,7 +123,7 @@
* empty set if there are no matches
*/
public Set<WBMethod<?>> getDeclaredAnnotatedMethods(Class<? extends Annotation> annotationType);
-
+
/**
* Find the annotated method for a given methodDescriptor
*
@@ -134,7 +134,7 @@
*/
@Deprecated
public WBMethod<?> getMethod(Method method);
-
+
/**
* Get a method by name
*
@@ -144,11 +144,11 @@
* @return the method, or null if it doesn't exist
*/
public <M> WBMethod<M> getDeclaredMethod(MethodSignature signature, WBClass<M> expectedReturnType);
-
+
// TODO Replace with AnnotatedMethod variant
@Deprecated
public WBMethod<?> getDeclaredMethod(Method method);
-
+
/**
* Gets all with parameters annotated with annotationType
*
@@ -157,7 +157,7 @@
* empty set if there are no matches
*/
public Set<WBMethod<?>> getMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType);
-
+
/**
* Gets all with constructors annotated with annotationType
*
@@ -166,7 +166,7 @@
* empty set if there are no matches
*/
public Set<WBConstructor<?>> getConstructorsWithAnnotatedParameters(Class<? extends Annotation> annotationType);
-
+
/**
* Gets all with parameters annotated with annotationType
*
@@ -182,22 +182,22 @@
* @return The abstracted superclass, null if there is no superclass
*/
public WBClass<?> getSuperclass();
-
+
/**
* Determine if this is a non-static member class
*
* @return true if this is a non-static member
*/
public boolean isNonStaticMemberClass();
-
+
public boolean isParameterizedType();
-
+
public boolean isAbstract();
-
+
public boolean isEnum();
-
+
public <S> S cast(Object object);
-
+
public <U> WBClass<? extends U> asSubclass(WBClass<U> clazz);
}
\ No newline at end of file
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBConstructor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBConstructor.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBConstructor.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -34,7 +34,7 @@
*/
public interface WBConstructor<T> extends WBMember<T, Constructor<T>>
{
-
+
@SuppressWarnings("unchecked")
public static final Set<Class<? extends Annotation>> MAPPED_PARAMETER_ANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(Decorates.class));
@@ -68,8 +68,8 @@
*
* @return An abstraction of the declaring class
*/
- public WBType<T> getDeclaringClass();
-
+ public WBType<T> getDeclaringType();
+
public ConstructorSignature getSignature();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBField.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBField.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBField.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -27,14 +27,14 @@
*/
public interface WBField<T> extends WBMember<T, Field>
{
-
+
/**
* Gets the annotated field
*
* @return The annotated field
*/
public Field getAnnotatedField();
-
+
/**
* Injects an instance
*
@@ -43,16 +43,16 @@
* @param value The value to inject
*/
public void set(Object declaringInstance, Object value) throws IllegalArgumentException, IllegalAccessException;
-
+
public T get(Object instance);
-
+
/**
* Gets an abstraction of the declaring class
*
* @return The declaring class
*/
- public WBType<?> getDeclaringClass();
-
+ public WBType<?> getDeclaringType();
+
/**
* Gets the property name of the field
*
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMember.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMember.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMember.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -25,14 +25,14 @@
*/
public interface WBMember<T, S extends Member> extends WBAnnotated<T, S>
{
-
+
public S getMember();
-
+
/**
* Gets an abstraction of the declaring class
*
* @return The declaring class
*/
- public WBType<?> getDeclaringClass();
-
+ public WBType<?> getDeclaringType();
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMethod.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMethod.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMethod.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -61,7 +61,7 @@
* there are no matches.
*/
public List<WBParameter<?>> getAnnotatedParameters(Class<? extends Annotation> metaAnnotationType);
-
+
/**
* Get the parameter types as an array
*/
@@ -75,7 +75,7 @@
* @return A reference to the instance
*/
public T invoke(Object instance, Object... parameters) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException;
-
+
/**
* Invokes the method on the class of the passed instance, not the declaring
* class. Useful with proxies
@@ -91,7 +91,7 @@
*
* @return An abstraction of the declaring class
*/
- public WBType<?> getDeclaringClass();
+ public WBType<?> getDeclaringType();
/**
* Gets the property name
@@ -99,7 +99,7 @@
* @return The name
*/
public String getPropertyName();
-
+
/**
* Checks if a this is equivalent to a JLR method
*
@@ -109,7 +109,7 @@
public boolean isEquivalent(Method method);
public Method getAnnotatedMethod();
-
+
public MethodSignature getSignature();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBParameter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBParameter.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBParameter.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -18,6 +18,7 @@
+
/**
* AnnotatedParameter provides a uniform access to a method parameter defined
* either in Java or XML
@@ -27,7 +28,7 @@
*/
public interface WBParameter<T> extends WBAnnotated<T, Object>
{
-
+
public WBMember<?, ?> getDeclaringMember();
-
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBType.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBType.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBType.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -17,6 +17,7 @@
package org.jboss.webbeans.introspector;
+
/**
* AnnotatedType provides a uniform access to a type defined either in Java or
* XML
@@ -33,14 +34,14 @@
* @return The abstracted superclass
*/
public WBType<?> getSuperclass();
-
+
/**
* Check if this is equivalent to a java class
* @param clazz The Java class
* @return true if equivalent
*/
public boolean isEquivalent(Class<?> clazz);
-
+
public String getSimpleName();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -23,8 +23,8 @@
import java.util.HashSet;
import java.util.Set;
+import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.introspector.WBAnnotated;
-import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.util.Proxies;
import org.jboss.webbeans.util.Reflections;
@@ -44,14 +44,14 @@
*/
public abstract class AbstractWBAnnotated<T, S> implements WBAnnotated<T, S>
{
-
+
interface WrappableAnnotatedItem<T, S> extends WBAnnotated<T, S>
{
-
+
AnnotationStore getAnnotationStore();
-
+
}
-
+
// Cached string representation
private String toString;
private final AnnotationStore annotationStore;
@@ -94,7 +94,7 @@
}
this.proxyable = Proxies.isTypesProxyable(flattenedTypes);
}
-
+
public AbstractWBAnnotated(AnnotationStore annotatedItemHelper)
{
this.annotationStore = annotatedItemHelper;
@@ -106,7 +106,7 @@
this.interfaceOnlyFlattenedTypes = null;
this.proxyable = false;
}
-
+
public AnnotationStore getAnnotationStore()
{
return annotationStore;
@@ -121,7 +121,7 @@
{
return getAnnotationStore().getMetaAnnotations(metaAnnotationType);
}
-
+
public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
{
return getAnnotationStore().getDeclaredMetaAnnotations(metaAnnotationType);
@@ -185,10 +185,10 @@
{
return Reflections.isAssignableFrom(getRawType(), getActualTypeArguments(), type, actualTypeArguments);
}
-
+
public boolean isAssignableFrom(Type type)
{
- return Reflections.isAssignableFrom(getType(), type);
+ return Reflections.isAssignableFrom(getBaseType(), type);
}
/**
@@ -217,7 +217,7 @@
toString = "Abstract annotated item " + getName();
return toString;
}
-
+
@Deprecated
public Set<Annotation> getBindings()
{
@@ -251,42 +251,42 @@
{
return proxyable;
}
-
+
public Class<T> getRawType()
{
return rawType;
}
-
- public Type getType()
- {
- return type;
- }
-
+
public Type[] getActualTypeArguments()
{
return actualTypeArguments;
}
-
- public Set<Type> getFlattenedTypeHierarchy()
- {
- return Collections.unmodifiableSet(flattenedTypes);
- }
-
+
public Set<Type> getInterfaceOnlyFlattenedTypeHierarchy()
{
return Collections.unmodifiableSet(interfaceOnlyFlattenedTypes);
}
public abstract S getDelegate();
-
+
public boolean isDeclaredAnnotationPresent(Class<? extends Annotation> annotationType)
{
return getAnnotationStore().isDeclaredAnnotationPresent(annotationType);
}
-
+
public boolean isParameterizedType()
{
return _parameterizedType;
}
+ public Type getBaseType()
+ {
+ return type;
+ }
+
+ public Set<Type> getTypeClosure()
+ {
+ return Collections.unmodifiableSet(flattenedTypes);
+ }
+
}
\ No newline at end of file
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -203,7 +203,7 @@
if (super.equals(other) && other instanceof WBConstructor)
{
WBConstructor<?> that = (WBConstructor<?>) other;
- return this.getDeclaringClass().equals(that.getDeclaringClass()) && this.getParameters().equals(that.getParameters());
+ return this.getDeclaringType().equals(that.getDeclaringType()) && this.getParameters().equals(that.getParameters());
}
return false;
}
@@ -226,7 +226,7 @@
*
* @return The declaring class
*/
- public WBType<T> getDeclaringClass()
+ public WBType<T> getDeclaringType()
{
return declaringClass;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -18,9 +18,9 @@
import java.lang.reflect.Field;
+import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.introspector.WBField;
import org.jboss.webbeans.introspector.WBType;
-import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
@@ -35,7 +35,7 @@
*/
public class WBFieldImpl<T> extends AbstractWBMember<T, Field> implements WBField<T>
{
-
+
// The underlying field
private final Field field;
// The abstraction of the declaring class
@@ -75,12 +75,12 @@
{
return field;
}
-
+
public void set(Object instance, Object value) throws IllegalArgumentException, IllegalAccessException
{
field.set(instance, value);
}
-
+
public void setOnInstance(Object instance, Object value) throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException
{
instance.getClass().getField(getName()).set(instance, value);
@@ -109,9 +109,9 @@
*
* @return The declaring class
*
- * @see org.jboss.webbeans.introspector.WBField#getDeclaringClass()
+ * @see org.jboss.webbeans.introspector.WBField#getDeclaringType()
*/
- public WBType<?> getDeclaringClass()
+ public WBType<?> getDeclaringType()
{
return declaringClass;
}
@@ -128,7 +128,7 @@
{
return toString;
}
- toString = Names.fieldToString(field) + " on " + getDeclaringClass();
+ toString = Names.fieldToString(field) + " on " + getDeclaringType();
return toString;
}
@@ -138,7 +138,7 @@
if (other instanceof WBField)
{
WBField<?> that = (WBField<?>) other;
- return this.getDeclaringClass().equals(that.getDeclaringClass()) && this.getName().equals(that.getName());
+ return this.getDeclaringType().equals(that.getDeclaringType()) && this.getName().equals(that.getName());
}
else
{
@@ -152,5 +152,5 @@
{
return getDelegate().hashCode();
}
-
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -25,11 +25,11 @@
import java.util.Collections;
import java.util.List;
+import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.introspector.MethodSignature;
import org.jboss.webbeans.introspector.WBMethod;
import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.introspector.WBType;
-import org.jboss.webbeans.introspector.AnnotationStore;
-import org.jboss.webbeans.introspector.MethodSignature;
import org.jboss.webbeans.util.Names;
import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.collections.multi.ListHashMultiMap;
@@ -64,9 +64,9 @@
// Cached string representation
private String toString;
-
+
private final MethodSignature signature;
-
+
public static <T> WBMethodImpl<T> of(Method method, WBType<?> declaringClass)
{
return new WBMethodImpl<T>(method, declaringClass);
@@ -90,7 +90,7 @@
this.declaringClass = declaringClass;
this.parameters = new ArrayList<WBParameter<?>>();
this.annotatedParameters = new ListHashMultiMap<Class<? extends Annotation>, WBParameter<?>>();
-
+
for (int i = 0; i < method.getParameterTypes().length; i++)
{
if (method.getParameterAnnotations()[i].length > 0)
@@ -142,7 +142,7 @@
{
return Collections.unmodifiableList(parameters);
}
-
+
public Class<?>[] getParameterTypesAsArray()
{
return method.getParameterTypes();
@@ -159,17 +159,17 @@
if (other instanceof WBMethod)
{
WBMethod<?> that = (WBMethod<?>) other;
- return this.getDeclaringClass().equals(that.getDeclaringClass()) && this.getName().equals(that.getName()) && this.getParameters().equals(that.getParameters());
+ return this.getDeclaringType().equals(that.getDeclaringType()) && this.getName().equals(that.getName()) && this.getParameters().equals(that.getParameters());
}
else
{
return false;
}
}
-
+
public boolean isEquivalent(Method method)
{
- return this.getDeclaringClass().isEquivalent(method.getDeclaringClass()) && this.getName().equals(method.getName()) && Arrays.equals(this.getParameterTypesAsArray(), method.getParameterTypes());
+ return this.getDeclaringType().isEquivalent(method.getDeclaringClass()) && this.getName().equals(method.getName()) && Arrays.equals(this.getParameterTypesAsArray(), method.getParameterTypes());
}
@Override
@@ -177,7 +177,7 @@
{
return getDelegate().hashCode();
}
-
+
public T invokeOnInstance(Object instance, Object...parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException
{
Method method = Reflections.lookupMethod(getName(), getParameterTypesAsArray(), instance);
@@ -198,7 +198,7 @@
return propertyName;
}
- public WBType<?> getDeclaringClass()
+ public WBType<?> getDeclaringType()
{
return declaringClass;
}
@@ -210,13 +210,13 @@
{
return toString;
}
- toString = "Annotated method on class " + getDeclaringClass().getName() + Names.methodToString(method);
+ toString = "Annotated method on class " + getDeclaringType().getName() + Names.methodToString(method);
return toString;
}
-
+
public MethodSignature getSignature()
{
return signature;
}
-
+
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ApplicationScopedTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ApplicationScopedTest.java 2009-06-12 22:38:33 UTC (rev 2828)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/context/ApplicationScopedTest.java 2009-06-14 20:29:43 UTC (rev 2829)
@@ -33,7 +33,6 @@
}
latch.await();
int value = getCurrentManager().getInstanceByType(ApplictionScopedObject.class).getValue();
- System.out.println(value);
assert value == 10;
}
14 years, 10 months
[webbeans-commits] Webbeans SVN: r2828 - in ri/trunk: impl/src/main/java/org/jboss/webbeans/bean and 14 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-12 18:38:33 -0400 (Fri, 12 Jun 2009)
New Revision: 2828
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/WBInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableWBClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotation.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBConstructor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBField.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMember.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMethod.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBParameter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBType.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotation.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBConstructor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBField.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMember.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMethod.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBParameter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBType.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBField.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBMethod.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBParameter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBMember.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBType.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableAnnotatedClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedAnnotation.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMember.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedType.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedAnnotation.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedConstructor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedField.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMember.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMethod.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedParameter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedType.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedAdaptor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/AnnotationModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/BindingTypeModel.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/resources/ClassTransformer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java
Log:
Rename Annotated*
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -80,10 +80,10 @@
import org.jboss.webbeans.event.EventObserver;
import org.jboss.webbeans.event.ObserverImpl;
import org.jboss.webbeans.injection.NonContextualInjector;
-import org.jboss.webbeans.injection.resolution.ResolvableAnnotatedClass;
+import org.jboss.webbeans.injection.resolution.ResolvableWBClass;
import org.jboss.webbeans.injection.resolution.ResolvableFactory;
import org.jboss.webbeans.injection.resolution.Resolver;
-import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.manager.api.WebBeansManager;
@@ -450,10 +450,10 @@
public Set<Bean<?>> getBeans(Type beanType, Annotation... bindings)
{
- return getBeans(ResolvableAnnotatedClass.of(beanType, bindings, this), bindings);
+ return getBeans(ResolvableWBClass.of(beanType, bindings, this), bindings);
}
- public Set<Bean<?>> getBeans(AnnotatedItem<?, ?> element, Annotation... bindings)
+ public Set<Bean<?>> getBeans(WBAnnotated<?, ?> element, Annotation... bindings)
{
for (Annotation annotation : element.getAnnotations())
{
@@ -490,7 +490,7 @@
currentInjectionPoint.get().push(injectionPoint);
}
// TODO Do this properly
- return getBeans(ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]), this));
+ return getBeans(ResolvableWBClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]), this));
}
finally
{
@@ -743,7 +743,7 @@
{
currentInjectionPoint.get().push(injectionPoint);
}
- AnnotatedItem<?, ?> element = ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]), this);
+ WBAnnotated<?, ?> element = ResolvableWBClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]), this);
Bean<?> resolvedBean = getBean(element, element.getBindingsAsArray());
if (getServices().get(MetaDataCache.class).getScopeModel(resolvedBean.getScopeType()).isNormal() && !Proxies.isTypeProxyable(injectionPoint.getType()))
{
@@ -788,11 +788,11 @@
@Deprecated
public <T> T getInstanceByType(Class<T> type, Annotation... bindings)
{
- AnnotatedItem<T, ?> element = ResolvableAnnotatedClass.of(type, bindings, this);
+ WBAnnotated<T, ?> element = ResolvableWBClass.of(type, bindings, this);
return (T) getReference(getBean(element, bindings), type);
}
- public <T> Bean<T> getBean(AnnotatedItem<T, ?> element, Annotation... bindings)
+ public <T> Bean<T> getBean(WBAnnotated<T, ?> element, Annotation... bindings)
{
Set<Bean<?>> beans = getBeans(element, bindings);
if (beans.size() == 0)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -45,8 +45,8 @@
import org.jboss.webbeans.bean.NewEnterpriseBean;
import org.jboss.webbeans.bean.NewSimpleBean;
import org.jboss.webbeans.bean.RIBean;
-import org.jboss.webbeans.injection.resolution.ResolvableAnnotatedClass;
-import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.injection.resolution.ResolvableWBClass;
+import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.metadata.MetaDataCache;
import org.jboss.webbeans.util.Beans;
import org.jboss.webbeans.util.ListComparator;
@@ -104,7 +104,7 @@
checkFacadeInjectionPoint(injectionPoint, Obtains.class, Instance.class);
checkFacadeInjectionPoint(injectionPoint, Any.class, Event.class);
Annotation[] bindings = injectionPoint.getBindings().toArray(new Annotation[0]);
- AnnotatedItem<?, ?> annotatedItem = ResolvableAnnotatedClass.of(injectionPoint.getType(), bindings, manager);
+ WBAnnotated<?, ?> annotatedItem = ResolvableWBClass.of(injectionPoint.getType(), bindings, manager);
Set<?> resolvedBeans = manager.getBeans(injectionPoint);
if (resolvedBeans.isEmpty())
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -24,7 +24,7 @@
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.webbeans.injection.resolution.ResolvableAnnotatedClass;
+import org.jboss.webbeans.injection.resolution.ResolvableWBClass;
/**
* Helper implementation for Instance for getting instances
@@ -51,7 +51,7 @@
public T get(Annotation... bindings)
{
Annotation[] annotations = mergeInBindings(bindings);
- Bean<T> bean = getManager().getBean(ResolvableAnnotatedClass.<T>of(getType(), annotations, getManager()), annotations);
+ Bean<T> bean = getManager().getBean(ResolvableWBClass.<T>of(getType(), annotations, getManager()), annotations);
@SuppressWarnings("unchecked")
T instance = (T) getManager().getReference(bean, getType());
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -39,10 +39,10 @@
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
import org.jboss.webbeans.context.DependentInstancesStore;
import org.jboss.webbeans.conversation.ConversationImpl;
-import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
-import org.jboss.webbeans.introspector.AnnotatedField;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.introspector.AnnotatedParameter;
+import org.jboss.webbeans.injection.WBInjectionPoint;
+import org.jboss.webbeans.introspector.WBField;
+import org.jboss.webbeans.introspector.WBAnnotated;
+import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.literal.AnyLiteral;
import org.jboss.webbeans.literal.CurrentLiteral;
import org.jboss.webbeans.log.LogProvider;
@@ -112,7 +112,7 @@
// The API types
protected Set<Type> types;
// The injection points
- protected Set<AnnotatedInjectionPoint<?, ?>> injectionPoints;
+ protected Set<WBInjectionPoint<?, ?>> injectionPoints;
// If the type a primitive?
private boolean primitive;
// The Web Beans manager
@@ -122,7 +122,7 @@
private boolean initialized;
- private Set<AnnotatedInjectionPoint<?, ?>> decoratesInjectionPoint;
+ private Set<WBInjectionPoint<?, ?>> decoratesInjectionPoint;
protected boolean isInitialized()
{
@@ -138,7 +138,7 @@
{
super(manager);
this.manager = manager;
- injectionPoints = new HashSet<AnnotatedInjectionPoint<?, ?>>();
+ injectionPoints = new HashSet<WBInjectionPoint<?, ?>>();
dependentInstancesStore = new DependentInstancesStore();
}
@@ -181,8 +181,8 @@
protected void initDecorates()
{
- this.decoratesInjectionPoint = new HashSet<AnnotatedInjectionPoint<?,?>>();
- for (AnnotatedInjectionPoint<?, ?> injectionPoint : getAnnotatedInjectionPoints())
+ this.decoratesInjectionPoint = new HashSet<WBInjectionPoint<?,?>>();
+ for (WBInjectionPoint<?, ?> injectionPoint : getAnnotatedInjectionPoints())
{
if (injectionPoint.isAnnotationPresent(Decorates.class))
{
@@ -191,7 +191,7 @@
}
}
- protected Set<AnnotatedInjectionPoint<?, ?>> getDecoratesInjectionPoint()
+ protected Set<WBInjectionPoint<?, ?>> getDecoratesInjectionPoint()
{
return decoratesInjectionPoint;
}
@@ -297,13 +297,13 @@
private boolean checkInjectionPointsAreSerializable()
{
boolean passivating = manager.getServices().get(MetaDataCache.class).getScopeModel(this.getScopeType()).isPassivating();
- for (AnnotatedInjectionPoint<?, ?> injectionPoint : getAnnotatedInjectionPoints())
+ for (WBInjectionPoint<?, ?> injectionPoint : getAnnotatedInjectionPoints())
{
Annotation[] bindings = injectionPoint.getMetaAnnotationsAsArray(BindingType.class);
Bean<?> resolvedBean = manager.getBeans(injectionPoint.getRawType(), bindings).iterator().next();
if (passivating)
{
- if (Dependent.class.equals(resolvedBean.getScopeType()) && !resolvedBean.isSerializable() && (((injectionPoint instanceof AnnotatedField) && !((AnnotatedField<?>) injectionPoint).isTransient()) || (injectionPoint instanceof AnnotatedParameter)) )
+ if (Dependent.class.equals(resolvedBean.getScopeType()) && !resolvedBean.isSerializable() && (((injectionPoint instanceof WBField) && !((WBField<?>) injectionPoint).isTransient()) || (injectionPoint instanceof WBParameter)) )
{
return false;
}
@@ -398,7 +398,7 @@
*
* @return The annotated item
*/
- protected abstract AnnotatedItem<T, E> getAnnotatedItem();
+ protected abstract WBAnnotated<T, E> getAnnotatedItem();
/**
* Gets the binding types
@@ -435,7 +435,7 @@
}
@Override
- public Set<AnnotatedInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
+ public Set<WBInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
{
return injectionPoints;
}
@@ -504,7 +504,7 @@
* @param annotatedItem The other annotation to check
* @return True if assignable, otherwise false
*/
- public boolean isAssignableFrom(AnnotatedItem<?, ?> annotatedItem)
+ public boolean isAssignableFrom(WBAnnotated<?, ?> annotatedItem)
{
return this.getAnnotatedItem().isAssignableFrom(annotatedItem);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -37,9 +37,9 @@
import org.jboss.webbeans.injection.FieldInjectionPoint;
import org.jboss.webbeans.injection.MethodInjectionPoint;
import org.jboss.webbeans.injection.ParameterInjectionPoint;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
-import org.jboss.webbeans.introspector.AnnotatedParameter;
+import org.jboss.webbeans.introspector.WBClass;
+import org.jboss.webbeans.introspector.WBMethod;
+import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.util.Beans;
@@ -58,7 +58,7 @@
// Logger
private static final LogProvider log = Logging.getLogProvider(AbstractClassBean.class);
// The item representation
- protected AnnotatedClass<T> annotatedItem;
+ protected WBClass<T> annotatedItem;
// The injectable fields
private Set<FieldInjectionPoint<?>> injectableFields;
// The initializer methods
@@ -73,7 +73,7 @@
* @param type The type
* @param manager The Web Beans manager
*/
- protected AbstractClassBean(AnnotatedClass<T> type, BeanManagerImpl manager)
+ protected AbstractClassBean(WBClass<T> type, BeanManagerImpl manager)
{
super(manager);
this.annotatedItem = type;
@@ -139,9 +139,9 @@
{
injectableFields = new HashSet<FieldInjectionPoint<?>>(Beans.getFieldInjectionPoints(annotatedItem, this));
super.injectionPoints.addAll(injectableFields);
- for (AnnotatedMethod<?> initializer : getInitializerMethods())
+ for (WBMethod<?> initializer : getInitializerMethods())
{
- for (AnnotatedParameter<?> parameter : initializer.getParameters())
+ for (WBParameter<?> parameter : initializer.getParameters())
{
injectionPoints.add(ParameterInjectionPoint.of(this, parameter));
}
@@ -154,7 +154,7 @@
protected void initInitializerMethods()
{
initializerMethods = new HashSet<MethodInjectionPoint<?>>();
- for (AnnotatedMethod<?> method : annotatedItem.getAnnotatedMethods(Initializer.class))
+ for (WBMethod<?> method : annotatedItem.getAnnotatedMethods(Initializer.class))
{
if (method.isStatic())
{
@@ -182,7 +182,7 @@
@Override
protected void initScopeType()
{
- for (AnnotatedClass<?> clazz = getAnnotatedItem(); clazz != null; clazz = clazz.getSuperclass())
+ for (WBClass<?> clazz = getAnnotatedItem(); clazz != null; clazz = clazz.getSuperclass())
{
Set<Annotation> scopeTypes = clazz.getDeclaredMetaAnnotations(ScopeType.class);
scopeTypes = clazz.getDeclaredMetaAnnotations(ScopeType.class);
@@ -216,7 +216,7 @@
@Override
protected void initDeploymentType()
{
- for (AnnotatedClass<?> clazz = getAnnotatedItem(); clazz != null; clazz = clazz.getSuperclass())
+ for (WBClass<?> clazz = getAnnotatedItem(); clazz != null; clazz = clazz.getSuperclass())
{
Set<Annotation> deploymentTypes = clazz.getDeclaredMetaAnnotations(DeploymentType.class);
if (deploymentTypes.size() == 1)
@@ -284,7 +284,7 @@
* @return The annotated item
*/
@Override
- public AnnotatedClass<T> getAnnotatedItem()
+ public WBClass<T> getAnnotatedItem()
{
return annotatedItem;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractProducerBean.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -43,7 +43,7 @@
import org.jboss.webbeans.context.CreationalContextImpl;
import org.jboss.webbeans.context.DependentContext;
import org.jboss.webbeans.context.DependentStorageRequest;
-import org.jboss.webbeans.introspector.AnnotatedMember;
+import org.jboss.webbeans.introspector.WBMember;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.metadata.MetaDataCache;
@@ -79,7 +79,7 @@
}
@Override
- protected abstract AnnotatedMember<T, S> getAnnotatedItem();
+ protected abstract WBMember<T, S> getAnnotatedItem();
/**
* Gets the deployment types
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -14,10 +14,10 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
-import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
+import org.jboss.webbeans.injection.WBInjectionPoint;
import org.jboss.webbeans.injection.MethodInjectionPoint;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.WBClass;
+import org.jboss.webbeans.introspector.WBAnnotated;
public class DecoratorBean<T> extends SimpleBean<T> implements Decorator<T>
{
@@ -56,17 +56,17 @@
* @param manager the current manager
* @return a Bean
*/
- public static <T> DecoratorBean<T> of(AnnotatedClass<T> clazz, BeanManagerImpl manager)
+ public static <T> DecoratorBean<T> of(WBClass<T> clazz, BeanManagerImpl manager)
{
return new DecoratorBean<T>(clazz, manager);
}
- private AnnotatedItem<?, ?> decorates;
+ private WBAnnotated<?, ?> decorates;
private Set<Annotation> delegateBindings;
private Type delegateType;
private Set<Type> decoratedTypes;
- protected DecoratorBean(AnnotatedClass<T> type, BeanManagerImpl manager)
+ protected DecoratorBean(WBClass<T> type, BeanManagerImpl manager)
{
super(type, manager);
}
@@ -99,7 +99,7 @@
@Override
protected void checkDecorates()
{
- for (AnnotatedInjectionPoint<?, ?> injectionPoint : getDecoratesInjectionPoint())
+ for (WBInjectionPoint<?, ?> injectionPoint : getDecoratesInjectionPoint())
{
if (injectionPoint instanceof MethodInjectionPoint && !injectionPoint.isAnnotationPresent(Initializer.class))
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -35,11 +35,11 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
-import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
+import org.jboss.webbeans.injection.WBInjectionPoint;
import org.jboss.webbeans.injection.MethodInjectionPoint;
import org.jboss.webbeans.injection.ParameterInjectionPoint;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
-import org.jboss.webbeans.introspector.AnnotatedParameter;
+import org.jboss.webbeans.introspector.WBMethod;
+import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -50,10 +50,10 @@
protected AbstractClassBean<?> declaringBean;
private DisposalMethodBean<?> specializedBean;
protected MethodInjectionPoint<T> disposalMethodInjectionPoint;
- protected Set<AnnotatedInjectionPoint<?, ?>> disposalInjectionPoints;
+ protected Set<WBInjectionPoint<?, ?>> disposalInjectionPoints;
private final String id;
- protected DisposalMethodBean(BeanManagerImpl manager, AnnotatedMethod<T> disposalMethod, AbstractClassBean<?> declaringBean)
+ protected DisposalMethodBean(BeanManagerImpl manager, WBMethod<T> disposalMethod, AbstractClassBean<?> declaringBean)
{
super(manager);
this.disposalMethodInjectionPoint = MethodInjectionPoint.of(this, disposalMethod);
@@ -73,28 +73,28 @@
}
@Override
- public AnnotatedMethod<T> getAnnotatedItem()
+ public WBMethod<T> getAnnotatedItem()
{
return disposalMethodInjectionPoint;
}
- public static <T> DisposalMethodBean<T> of(BeanManagerImpl manager, AnnotatedMethod<T> disposalMethod, AbstractClassBean<?> declaringBean)
+ public static <T> DisposalMethodBean<T> of(BeanManagerImpl manager, WBMethod<T> disposalMethod, AbstractClassBean<?> declaringBean)
{
return new DisposalMethodBean<T>(manager, disposalMethod, declaringBean);
}
protected void initInjectionPoints()
{
- disposalInjectionPoints = new HashSet<AnnotatedInjectionPoint<?, ?>>();
+ disposalInjectionPoints = new HashSet<WBInjectionPoint<?, ?>>();
- List<? extends AnnotatedParameter<?>> disposalMethodParameters = disposalMethodInjectionPoint.getParameters();
+ List<? extends WBParameter<?>> disposalMethodParameters = disposalMethodInjectionPoint.getParameters();
// First one must be @Disposes, if more, register injectionpoints
if (disposalMethodParameters.size() > 1)
{
for (int i = 1; i < disposalMethodParameters.size(); i++)
{
- AnnotatedParameter<?> parameter = disposalMethodParameters.get(i);
+ WBParameter<?> parameter = disposalMethodParameters.get(i);
disposalInjectionPoints.add(ParameterInjectionPoint.of(declaringBean, parameter));
}
}
@@ -133,7 +133,7 @@
}
@Override
- public Set<AnnotatedInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
+ public Set<WBInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
{
return injectionPoints;
}
@@ -253,7 +253,7 @@
@Override
protected void specialize(BeanDeployerEnvironment environment)
{
- AnnotatedMethod<?> superClassMethod = declaringBean.getAnnotatedItem().getSuperclass().getMethod(getAnnotatedItem().getAnnotatedMethod());
+ WBMethod<?> superClassMethod = declaringBean.getAnnotatedItem().getSuperclass().getMethod(getAnnotatedItem().getAnnotatedMethod());
if (environment.getProducerMethod(superClassMethod) == null)
{
throw new IllegalStateException(toString() + " does not specialize a bean");
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/EnterpriseBean.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -45,8 +45,8 @@
import org.jboss.webbeans.ejb.api.SessionObjectReference;
import org.jboss.webbeans.ejb.spi.BusinessInterfaceDescriptor;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.WBClass;
+import org.jboss.webbeans.introspector.WBMethod;
import org.jboss.webbeans.log.Log;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.util.Proxies;
@@ -77,7 +77,7 @@
* @param manager the current manager
* @return An Enterprise Web Bean
*/
- public static <T> EnterpriseBean<T> of(AnnotatedClass<T> clazz, BeanManagerImpl manager, BeanDeployerEnvironment environment)
+ public static <T> EnterpriseBean<T> of(WBClass<T> clazz, BeanManagerImpl manager, BeanDeployerEnvironment environment)
{
return new EnterpriseBean<T>(clazz, manager, environment);
}
@@ -88,7 +88,7 @@
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- protected EnterpriseBean(AnnotatedClass<T> type, BeanManagerImpl manager, BeanDeployerEnvironment environment)
+ protected EnterpriseBean(WBClass<T> type, BeanManagerImpl manager, BeanDeployerEnvironment environment)
{
super(type, manager);
initType();
@@ -370,7 +370,7 @@
*/
protected void checkObserverMethods()
{
- for (AnnotatedMethod<?> method : this.annotatedItem.getDeclaredMethodsWithAnnotatedParameters(Observes.class))
+ for (WBMethod<?> method : this.annotatedItem.getDeclaredMethodsWithAnnotatedParameters(Observes.class))
{
if (!method.isStatic())
{
@@ -383,7 +383,7 @@
}
// TODO must be a nicer way to do this!
- public boolean isMethodExistsOnTypes(AnnotatedMethod<?> method)
+ public boolean isMethodExistsOnTypes(WBMethod<?> method)
{
for (Type type : getTypes())
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewEnterpriseBean.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -26,7 +26,7 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
-import org.jboss.webbeans.introspector.AnnotatedClass;
+import org.jboss.webbeans.introspector.WBClass;
import org.jboss.webbeans.literal.NewLiteral;
/**
@@ -45,7 +45,7 @@
* @param manager The Web Beans manager
* @return a new NewEnterpriseBean instance
*/
- public static <T> NewEnterpriseBean<T> of(AnnotatedClass<T> clazz, BeanManagerImpl manager, BeanDeployerEnvironment environment)
+ public static <T> NewEnterpriseBean<T> of(WBClass<T> clazz, BeanManagerImpl manager, BeanDeployerEnvironment environment)
{
return new NewEnterpriseBean<T>(clazz, manager, environment);
}
@@ -56,7 +56,7 @@
* @param type An annotated class
* @param manager The Web Beans manager
*/
- protected NewEnterpriseBean(AnnotatedClass<T> type, BeanManagerImpl manager, BeanDeployerEnvironment environment)
+ protected NewEnterpriseBean(WBClass<T> type, BeanManagerImpl manager, BeanDeployerEnvironment environment)
{
super(type, manager, environment);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/NewSimpleBean.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -25,7 +25,7 @@
import javax.enterprise.inject.deployment.Standard;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.introspector.AnnotatedClass;
+import org.jboss.webbeans.introspector.WBClass;
import org.jboss.webbeans.literal.NewLiteral;
/**
@@ -44,7 +44,7 @@
* @param manager The Web Beans manager
* @return a new NewSimpleBean instance
*/
- public static <T> NewSimpleBean<T> of(AnnotatedClass<T> clazz, BeanManagerImpl manager)
+ public static <T> NewSimpleBean<T> of(WBClass<T> clazz, BeanManagerImpl manager)
{
return new NewSimpleBean<T>(clazz, manager);
}
@@ -55,7 +55,7 @@
* @param type An annotated class
* @param manager The Web Beans manager
*/
- protected NewSimpleBean(AnnotatedClass<T> type, BeanManagerImpl manager)
+ protected NewSimpleBean(WBClass<T> type, BeanManagerImpl manager)
{
super(type, manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerFieldBean.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -22,7 +22,7 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
-import org.jboss.webbeans.introspector.AnnotatedField;
+import org.jboss.webbeans.introspector.WBField;
import org.jboss.webbeans.util.Names;
/**
@@ -35,7 +35,7 @@
public class ProducerFieldBean<T> extends AbstractProducerBean<T, Field>
{
// The underlying field
- private AnnotatedField<T> field;
+ private WBField<T> field;
private final String id;
/**
@@ -46,7 +46,7 @@
* @param manager the current manager
* @return A producer Web Bean
*/
- public static <T> ProducerFieldBean<T> of(AnnotatedField<T> field, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
+ public static <T> ProducerFieldBean<T> of(WBField<T> field, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
return new ProducerFieldBean<T>(field, declaringBean, manager);
}
@@ -58,7 +58,7 @@
* @param declaringBean The declaring bean
* @param manager The Web Beans manager
*/
- protected ProducerFieldBean(AnnotatedField<T> field, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
+ protected ProducerFieldBean(WBField<T> field, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
super(declaringBean, manager);
this.field = field;
@@ -97,7 +97,7 @@
* @return The annotated item
*/
@Override
- protected AnnotatedField<T> getAnnotatedItem()
+ protected WBField<T> getAnnotatedItem()
{
return field;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -32,8 +32,8 @@
import org.jboss.webbeans.context.DependentStorageRequest;
import org.jboss.webbeans.injection.MethodInjectionPoint;
import org.jboss.webbeans.injection.ParameterInjectionPoint;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
-import org.jboss.webbeans.introspector.AnnotatedParameter;
+import org.jboss.webbeans.introspector.WBMethod;
+import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.util.Names;
/**
@@ -62,12 +62,12 @@
* @param manager the current manager
* @return A producer Web Bean
*/
- public static <T> ProducerMethodBean<T> of(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
+ public static <T> ProducerMethodBean<T> of(WBMethod<T> method, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
return new ProducerMethodBean<T>(method, declaringBean, manager);
}
- protected ProducerMethodBean(AnnotatedMethod<T> method, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
+ protected ProducerMethodBean(WBMethod<T> method, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
super(declaringBean, manager);
this.method = MethodInjectionPoint.of(this, method);
@@ -109,7 +109,7 @@
*/
protected void initInjectionPoints()
{
- for (AnnotatedParameter<?> parameter : method.getParameters())
+ for (WBParameter<?> parameter : method.getParameters())
{
injectionPoints.add(ParameterInjectionPoint.of(this, parameter));
}
@@ -205,7 +205,7 @@
* @return The annotated item
*/
@Override
- public AnnotatedMethod<T> getAnnotatedItem()
+ public WBMethod<T> getAnnotatedItem()
{
return method;
}
@@ -272,7 +272,7 @@
@Override
protected void specialize(BeanDeployerEnvironment environment)
{
- AnnotatedMethod<?> superClassMethod = declaringBean.getAnnotatedItem().getSuperclass().getMethod(getAnnotatedItem().getAnnotatedMethod());
+ WBMethod<?> superClassMethod = declaringBean.getAnnotatedItem().getSuperclass().getMethod(getAnnotatedItem().getAnnotatedMethod());
if (environment.getProducerMethod(superClassMethod) == null)
{
throw new IllegalStateException(toString() + " does not specialize a bean");
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/RIBean.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -27,7 +27,7 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
-import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
+import org.jboss.webbeans.injection.WBInjectionPoint;
/**
* Abstract base class with functions specific to RI built-in beans
@@ -73,7 +73,7 @@
public abstract boolean isPrimitive();
- public abstract Set<AnnotatedInjectionPoint<?, ?>> getAnnotatedInjectionPoints();
+ public abstract Set<WBInjectionPoint<?, ?>> getAnnotatedInjectionPoints();
public Set<InjectionPoint> getInjectionPoints()
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/SimpleBean.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -32,16 +32,16 @@
import org.jboss.webbeans.context.DependentStorageRequest;
import org.jboss.webbeans.ejb.EJBApiAbstraction;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
+import org.jboss.webbeans.injection.WBInjectionPoint;
import org.jboss.webbeans.injection.ConstructorInjectionPoint;
import org.jboss.webbeans.injection.FieldInjectionPoint;
import org.jboss.webbeans.injection.MethodInjectionPoint;
import org.jboss.webbeans.injection.ParameterInjectionPoint;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.AnnotatedConstructor;
-import org.jboss.webbeans.introspector.AnnotatedField;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
-import org.jboss.webbeans.introspector.AnnotatedParameter;
+import org.jboss.webbeans.introspector.WBClass;
+import org.jboss.webbeans.introspector.WBConstructor;
+import org.jboss.webbeans.introspector.WBField;
+import org.jboss.webbeans.introspector.WBMethod;
+import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.metadata.MetaDataCache;
@@ -66,13 +66,13 @@
// The constructor
private ConstructorInjectionPoint<T> constructor;
// The post-construct method
- private AnnotatedMethod<?> postConstruct;
+ private WBMethod<?> postConstruct;
// The pre-destroy method
- private AnnotatedMethod<?> preDestroy;
+ private WBMethod<?> preDestroy;
- private Set<AnnotatedInjectionPoint<?, ?>> ejbInjectionPoints;
- private Set<AnnotatedInjectionPoint<?, ?>> persistenceUnitInjectionPoints;
- private Set<AnnotatedInjectionPoint<?, ?>> resourceInjectionPoints;
+ private Set<WBInjectionPoint<?, ?>> ejbInjectionPoints;
+ private Set<WBInjectionPoint<?, ?>> persistenceUnitInjectionPoints;
+ private Set<WBInjectionPoint<?, ?>> resourceInjectionPoints;
private SimpleBean<?> specializedBean;
@@ -84,7 +84,7 @@
* @param manager the current manager
* @return A Web Bean
*/
- public static <T> SimpleBean<T> of(AnnotatedClass<T> clazz, BeanManagerImpl manager)
+ public static <T> SimpleBean<T> of(WBClass<T> clazz, BeanManagerImpl manager)
{
return new SimpleBean<T>(clazz, manager);
}
@@ -95,7 +95,7 @@
* @param type The type of the bean
* @param manager The Web Beans manager
*/
- protected SimpleBean(AnnotatedClass<T> type, BeanManagerImpl manager)
+ protected SimpleBean(WBClass<T> type, BeanManagerImpl manager)
{
super(type, manager);
initType();
@@ -168,7 +168,7 @@
*/
protected void callPreDestroy(T instance)
{
- AnnotatedMethod<?> preDestroy = getPreDestroy();
+ WBMethod<?> preDestroy = getPreDestroy();
if (preDestroy != null)
{
try
@@ -190,7 +190,7 @@
*/
protected void callPostConstruct(T instance)
{
- AnnotatedMethod<?> postConstruct = getPostConstruct();
+ WBMethod<?> postConstruct = getPostConstruct();
if (postConstruct != null)
{
try
@@ -207,13 +207,13 @@
protected void initEjbInjectionPoints()
{
Class<? extends Annotation> ejbAnnotationType = manager.getServices().get(EJBApiAbstraction.class).EJB_ANNOTATION_CLASS;
- this.ejbInjectionPoints = new HashSet<AnnotatedInjectionPoint<?, ?>>();
- for (AnnotatedField<?> field : annotatedItem.getAnnotatedFields(ejbAnnotationType))
+ this.ejbInjectionPoints = new HashSet<WBInjectionPoint<?, ?>>();
+ for (WBField<?> field : annotatedItem.getAnnotatedFields(ejbAnnotationType))
{
this.ejbInjectionPoints.add(FieldInjectionPoint.of(this, field));
}
- for (AnnotatedMethod<?> method : annotatedItem.getAnnotatedMethods(ejbAnnotationType))
+ for (WBMethod<?> method : annotatedItem.getAnnotatedMethods(ejbAnnotationType))
{
this.ejbInjectionPoints.add(MethodInjectionPoint.of(this, method));
}
@@ -221,11 +221,11 @@
protected void initPersistenceUnitInjectionPoints()
{
- this.persistenceUnitInjectionPoints = new HashSet<AnnotatedInjectionPoint<?, ?>>();
+ this.persistenceUnitInjectionPoints = new HashSet<WBInjectionPoint<?, ?>>();
Class<? extends Annotation> persistenceContextAnnotationType = manager.getServices().get(PersistenceApiAbstraction.class).PERSISTENCE_CONTEXT_ANNOTATION_CLASS;
Object extendedPersistenceContextEnum = manager.getServices().get(PersistenceApiAbstraction.class).EXTENDED_PERSISTENCE_CONTEXT_ENUM_VALUE;
- for (AnnotatedField<?> field : annotatedItem.getAnnotatedFields(persistenceContextAnnotationType))
+ for (WBField<?> field : annotatedItem.getAnnotatedFields(persistenceContextAnnotationType))
{
if (extendedPersistenceContextEnum.equals(Reflections.invokeAndWrap("type", field.getAnnotation(persistenceContextAnnotationType))))
{
@@ -234,7 +234,7 @@
this.persistenceUnitInjectionPoints.add(FieldInjectionPoint.of(this, field));
}
- for (AnnotatedMethod<?> method : annotatedItem.getAnnotatedMethods(persistenceContextAnnotationType))
+ for (WBMethod<?> method : annotatedItem.getAnnotatedMethods(persistenceContextAnnotationType))
{
if (extendedPersistenceContextEnum.equals(Reflections.invokeAndWrap("type", method.getAnnotation(persistenceContextAnnotationType))))
{
@@ -247,8 +247,8 @@
protected void initResourceInjectionPoints()
{
Class<? extends Annotation> resourceAnnotationType = manager.getServices().get(EJBApiAbstraction.class).RESOURCE_ANNOTATION_CLASS;
- this.resourceInjectionPoints = new HashSet<AnnotatedInjectionPoint<?, ?>>();
- for (AnnotatedField<?> field : annotatedItem.getAnnotatedFields(resourceAnnotationType))
+ this.resourceInjectionPoints = new HashSet<WBInjectionPoint<?, ?>>();
+ for (WBField<?> field : annotatedItem.getAnnotatedFields(resourceAnnotationType))
{
this.resourceInjectionPoints.add(FieldInjectionPoint.of(this, field));
}
@@ -265,7 +265,7 @@
if (ejbServices != null)
{
- for (AnnotatedInjectionPoint<?, ?> injectionPoint : ejbInjectionPoints)
+ for (WBInjectionPoint<?, ?> injectionPoint : ejbInjectionPoints)
{
Object ejbInstance = ejbServices.resolveEjb(injectionPoint);
injectionPoint.inject(beanInstance, ejbInstance);
@@ -274,7 +274,7 @@
if (jpaServices != null)
{
- for (AnnotatedInjectionPoint<?, ?> injectionPoint : persistenceUnitInjectionPoints)
+ for (WBInjectionPoint<?, ?> injectionPoint : persistenceUnitInjectionPoints)
{
Object puInstance = jpaServices.resolvePersistenceContext(injectionPoint);
injectionPoint.inject(beanInstance, puInstance);
@@ -283,7 +283,7 @@
if (resourceServices != null)
{
- for (AnnotatedInjectionPoint<?, ?> injectionPoint : resourceInjectionPoints)
+ for (WBInjectionPoint<?, ?> injectionPoint : resourceInjectionPoints)
{
Object resourceInstance = resourceServices.resolveResource(injectionPoint);
injectionPoint.inject(beanInstance, resourceInstance);
@@ -326,7 +326,7 @@
protected void initInjectionPoints()
{
super.initInjectionPoints();
- for (AnnotatedParameter<?> parameter : constructor.getParameters())
+ for (WBParameter<?> parameter : constructor.getParameters())
{
injectionPoints.add(ParameterInjectionPoint.of(this, parameter));
}
@@ -358,7 +358,7 @@
super.checkBeanImplementation();
if (!isDependent())
{
- for (AnnotatedField<?> field : getAnnotatedItem().getFields())
+ for (WBField<?> field : getAnnotatedItem().getFields())
{
if (field.isPublic() && !field.isStatic())
{
@@ -402,7 +402,7 @@
*/
protected void initConstructor()
{
- Set<AnnotatedConstructor<T>> initializerAnnotatedConstructors = getAnnotatedItem().getAnnotatedConstructors(Initializer.class);
+ Set<WBConstructor<T>> initializerAnnotatedConstructors = getAnnotatedItem().getAnnotatedConstructors(Initializer.class);
log.trace("Found " + initializerAnnotatedConstructors + " constructors annotated with @Initializer for " + getType());
if (initializerAnnotatedConstructors.size() > 1)
{
@@ -434,7 +434,7 @@
*/
protected void initPostConstruct()
{
- Set<AnnotatedMethod<?>> postConstructMethods = getAnnotatedItem().getAnnotatedMethods(PostConstruct.class);
+ Set<WBMethod<?>> postConstructMethods = getAnnotatedItem().getAnnotatedMethods(PostConstruct.class);
log.trace("Found " + postConstructMethods + " constructors annotated with @Initializer for " + getType());
if (postConstructMethods.size() > 1)
{
@@ -456,7 +456,7 @@
*/
protected void initPreDestroy()
{
- Set<AnnotatedMethod<?>> preDestroyMethods = getAnnotatedItem().getAnnotatedMethods(PreDestroy.class);
+ Set<WBMethod<?>> preDestroyMethods = getAnnotatedItem().getAnnotatedMethods(PreDestroy.class);
log.trace("Found " + preDestroyMethods + " constructors annotated with @Initializer for " + getType());
if (preDestroyMethods.size() > 1)
{
@@ -477,7 +477,7 @@
*
* @return The constructor
*/
- public AnnotatedConstructor<T> getConstructor()
+ public WBConstructor<T> getConstructor()
{
return constructor;
}
@@ -487,7 +487,7 @@
*
* @return The post-construct method
*/
- public AnnotatedMethod<?> getPostConstruct()
+ public WBMethod<?> getPostConstruct()
{
return postConstruct;
}
@@ -497,7 +497,7 @@
*
* @return The pre-destroy method
*/
- public AnnotatedMethod<?> getPreDestroy()
+ public WBMethod<?> getPreDestroy()
{
return preDestroy;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ee/AbstractJavaEEResourceBean.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -34,7 +34,7 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
-import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
+import org.jboss.webbeans.injection.WBInjectionPoint;
import org.jboss.webbeans.literal.CurrentLiteral;
import org.jboss.webbeans.util.Proxies;
@@ -165,7 +165,7 @@
}
@Override
- public Set<AnnotatedInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
+ public Set<WBInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
{
return Collections.emptySet();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/AbstractStandardBean.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -28,7 +28,7 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.bootstrap.BeanDeployerEnvironment;
-import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
+import org.jboss.webbeans.injection.WBInjectionPoint;
import org.jboss.webbeans.literal.AnyLiteral;
import org.jboss.webbeans.literal.CurrentLiteral;
@@ -80,7 +80,7 @@
}
@Override
- public Set<AnnotatedInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
+ public Set<WBInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
{
return Collections.emptySet();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -46,11 +46,11 @@
import org.jboss.webbeans.ejb.EjbDescriptorCache;
import org.jboss.webbeans.event.ObserverFactory;
import org.jboss.webbeans.event.ObserverImpl;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.AnnotatedField;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
-import org.jboss.webbeans.introspector.WrappedAnnotatedField;
-import org.jboss.webbeans.introspector.WrappedAnnotatedMethod;
+import org.jboss.webbeans.introspector.WBClass;
+import org.jboss.webbeans.introspector.WBField;
+import org.jboss.webbeans.introspector.WBMethod;
+import org.jboss.webbeans.introspector.WrappedWBField;
+import org.jboss.webbeans.introspector.WrappedWBMethod;
import org.jboss.webbeans.jsf.JsfApiAbstraction;
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
@@ -64,7 +64,7 @@
private static final LogProvider log = Logging.getLogProvider(BeanDeployer.class);
private final BeanDeployerEnvironment environment;
- private final Set<AnnotatedClass<?>> classes;
+ private final Set<WBClass<?>> classes;
private final BeanManagerImpl manager;
private final ClassTransformer classTransformer;
@@ -73,7 +73,7 @@
{
this.manager = manager;
this.environment = new BeanDeployerEnvironment(ejbDescriptors, manager);
- this.classes = new HashSet<AnnotatedClass<?>>();
+ this.classes = new HashSet<WBClass<?>>();
this.classTransformer = new ClassTransformer();
}
@@ -110,7 +110,7 @@
return this;
}
- public BeanDeployer addClasses(Collection<AnnotatedClass<?>> classes)
+ public BeanDeployer addClasses(Collection<WBClass<?>> classes)
{
classes.addAll(classes);
return this;
@@ -118,7 +118,7 @@
public BeanDeployer createBeans()
{
- for (AnnotatedClass<?> clazz : classes)
+ for (WBClass<?> clazz : classes)
{
if (environment.getEjbDescriptors().containsKey(clazz.getRawType()))
{
@@ -191,7 +191,7 @@
* @param bean
* The bean representation
*/
- protected <T> void createBean(AbstractClassBean<T> bean, final AnnotatedClass<T> annotatedClass)
+ protected <T> void createBean(AbstractClassBean<T> bean, final WBClass<T> annotatedClass)
{
addBean(bean);
@@ -211,95 +211,95 @@
}
}
- private void createProducerMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
+ private void createProducerMethods(AbstractClassBean<?> declaringBean, WBClass<?> annotatedClass)
{
- for (AnnotatedMethod<?> method : annotatedClass.getDeclaredAnnotatedMethods(Produces.class))
+ for (WBMethod<?> method : annotatedClass.getDeclaredAnnotatedMethods(Produces.class))
{
createProducerMethod(declaringBean, method);
}
}
- private void createDisposalMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
+ private void createDisposalMethods(AbstractClassBean<?> declaringBean, WBClass<?> annotatedClass)
{
- for (AnnotatedMethod<?> method : annotatedClass.getDeclaredMethodsWithAnnotatedParameters(Disposes.class))
+ for (WBMethod<?> method : annotatedClass.getDeclaredMethodsWithAnnotatedParameters(Disposes.class))
{
DisposalMethodBean<?> disposalBean = DisposalMethodBean.of(manager, method, declaringBean);
environment.addDisposalBean(disposalBean);
}
}
- private <T> void createProducerMethod(AbstractClassBean<?> declaringBean, AnnotatedMethod<T> annotatedMethod)
+ private <T> void createProducerMethod(AbstractClassBean<?> declaringBean, WBMethod<T> annotatedMethod)
{
ProducerMethodBean<T> bean = ProducerMethodBean.of(annotatedMethod, declaringBean, manager);
addBean(bean);
manager.getResolver().addInjectionPoints(bean.getAnnotatedInjectionPoints());
}
- private void createRealizedProducerMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> realizingClass)
+ private void createRealizedProducerMethods(AbstractClassBean<?> declaringBean, WBClass<?> realizingClass)
{
- AnnotatedClass<?> realizedClass = realizingClass.getSuperclass();
- for (AnnotatedMethod<?> realizedMethod : realizedClass.getDeclaredAnnotatedMethods(Produces.class))
+ WBClass<?> realizedClass = realizingClass.getSuperclass();
+ for (WBMethod<?> realizedMethod : realizedClass.getDeclaredAnnotatedMethods(Produces.class))
{
createProducerMethod(declaringBean, realizeProducerMethod(realizedMethod, realizingClass));
}
}
- private void createRealizedProducerFields(AbstractClassBean<?> declaringBean, AnnotatedClass<?> realizingClass)
+ private void createRealizedProducerFields(AbstractClassBean<?> declaringBean, WBClass<?> realizingClass)
{
- AnnotatedClass<?> realizedClass = realizingClass.getSuperclass();
- for (final AnnotatedField<?> realizedField : realizedClass.getDeclaredAnnotatedFields(Produces.class))
+ WBClass<?> realizedClass = realizingClass.getSuperclass();
+ for (final WBField<?> realizedField : realizedClass.getDeclaredAnnotatedFields(Produces.class))
{
createProducerField(declaringBean, realizeProducerField(realizedField, realizingClass));
}
}
- private <T> void createProducerField(AbstractClassBean<?> declaringBean, AnnotatedField<T> field)
+ private <T> void createProducerField(AbstractClassBean<?> declaringBean, WBField<T> field)
{
ProducerFieldBean<T> bean = ProducerFieldBean.of(field, declaringBean, manager);
addBean(bean);
}
- private void createProducerFields(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
+ private void createProducerFields(AbstractClassBean<?> declaringBean, WBClass<?> annotatedClass)
{
- for (AnnotatedField<?> field : annotatedClass.getDeclaredAnnotatedFields(Produces.class))
+ for (WBField<?> field : annotatedClass.getDeclaredAnnotatedFields(Produces.class))
{
createProducerField(declaringBean, field);
}
}
- private void createObserverMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> annotatedClass)
+ private void createObserverMethods(AbstractClassBean<?> declaringBean, WBClass<?> annotatedClass)
{
- for (AnnotatedMethod<?> method : annotatedClass.getDeclaredMethodsWithAnnotatedParameters(Observes.class))
+ for (WBMethod<?> method : annotatedClass.getDeclaredMethodsWithAnnotatedParameters(Observes.class))
{
createObserverMethod(declaringBean, method);
}
}
- private void createRealizedObserverMethods(AbstractClassBean<?> declaringBean, AnnotatedClass<?> realizingClass)
+ private void createRealizedObserverMethods(AbstractClassBean<?> declaringBean, WBClass<?> realizingClass)
{
createObserverMethods(declaringBean, realizingClass.getSuperclass());
}
- private void createObserverMethod(AbstractClassBean<?> declaringBean, AnnotatedMethod<?> method)
+ private void createObserverMethod(AbstractClassBean<?> declaringBean, WBMethod<?> method)
{
ObserverImpl<?> observer = ObserverFactory.create(method, declaringBean, manager);
environment.getObservers().add(observer);
}
- private <T> void createSimpleBean(AnnotatedClass<T> annotatedClass)
+ private <T> void createSimpleBean(WBClass<T> annotatedClass)
{
SimpleBean<T> bean = SimpleBean.of(annotatedClass, manager);
createBean(bean, annotatedClass);
addBean(NewSimpleBean.of(annotatedClass, manager));
}
- private <T> void createDecorator(AnnotatedClass<T> annotatedClass)
+ private <T> void createDecorator(WBClass<T> annotatedClass)
{
DecoratorBean<T> bean = DecoratorBean.of(annotatedClass, manager);
addBean(bean);
}
- private <T> void createEnterpriseBean(AnnotatedClass<T> annotatedClass)
+ private <T> void createEnterpriseBean(WBClass<T> annotatedClass)
{
// TODO Don't create enterprise bean if it has no local interfaces!
EnterpriseBean<T> bean = EnterpriseBean.of(annotatedClass, manager, environment);
@@ -314,7 +314,7 @@
* The type to inspect
* @return True if simple Web Bean, false otherwise
*/
- private boolean isTypeManagedBeanOrDecorator(AnnotatedClass<?> clazz)
+ private boolean isTypeManagedBeanOrDecorator(WBClass<?> clazz)
{
Class<?> rawType = clazz.getRawType();
EJBApiAbstraction ejbApiAbstraction = manager.getServices().get(EJBApiAbstraction.class);
@@ -332,14 +332,14 @@
hasSimpleWebBeanConstructor(clazz);
}
- private static boolean hasSimpleWebBeanConstructor(AnnotatedClass<?> type)
+ private static boolean hasSimpleWebBeanConstructor(WBClass<?> type)
{
return type.getNoArgsConstructor() != null || type.getAnnotatedConstructors(Initializer.class).size() > 0;
}
- private static <T> AnnotatedMethod<T> realizeProducerMethod(final AnnotatedMethod<T> method, final AnnotatedClass<?> realizingClass)
+ private static <T> WBMethod<T> realizeProducerMethod(final WBMethod<T> method, final WBClass<?> realizingClass)
{
- return new WrappedAnnotatedMethod<T>(method, realizingClass.getMetaAnnotations(BindingType.class))
+ return new WrappedWBMethod<T>(method, realizingClass.getMetaAnnotations(BindingType.class))
{
@Override
@@ -371,9 +371,9 @@
};
}
- private static <T> AnnotatedField<T> realizeProducerField(final AnnotatedField<T> field, final AnnotatedClass<?> realizingClass)
+ private static <T> WBField<T> realizeProducerField(final WBField<T> field, final WBClass<?> realizingClass)
{
- return new WrappedAnnotatedField<T>(field, realizingClass.getMetaAnnotations(BindingType.class))
+ return new WrappedWBField<T>(field, realizingClass.getMetaAnnotations(BindingType.class))
{
@Override
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -36,16 +36,16 @@
import org.jboss.webbeans.event.ObserverImpl;
import org.jboss.webbeans.injection.resolution.ResolvableFactory;
import org.jboss.webbeans.injection.resolution.Resolver;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.WBClass;
+import org.jboss.webbeans.introspector.WBAnnotated;
+import org.jboss.webbeans.introspector.WBMethod;
public class BeanDeployerEnvironment
{
- private final Map<AnnotatedClass<?>, AbstractClassBean<?>> classBeanMap;
- private final Map<AnnotatedMethod<?>, ProducerMethodBean<?>> producerMethodBeanMap;
- private final Map<AnnotatedMethod<?>, DisposalMethodBean<?>> disposalMethodBeanMap;
+ private final Map<WBClass<?>, AbstractClassBean<?>> classBeanMap;
+ private final Map<WBMethod<?>, ProducerMethodBean<?>> producerMethodBeanMap;
+ private final Map<WBMethod<?>, DisposalMethodBean<?>> disposalMethodBeanMap;
private final Set<RIBean<?>> beans;
private final Set<ObserverImpl<?>> observers;
private final List<DisposalMethodBean<?>> allDisposalBeans;
@@ -56,9 +56,9 @@
public BeanDeployerEnvironment(EjbDescriptorCache ejbDescriptors, BeanManagerImpl manager)
{
- this.classBeanMap = new HashMap<AnnotatedClass<?>, AbstractClassBean<?>>();
- this.producerMethodBeanMap = new HashMap<AnnotatedMethod<?>, ProducerMethodBean<?>>();
- this.disposalMethodBeanMap = new HashMap<AnnotatedMethod<?>, DisposalMethodBean<?>>();
+ this.classBeanMap = new HashMap<WBClass<?>, AbstractClassBean<?>>();
+ this.producerMethodBeanMap = new HashMap<WBMethod<?>, ProducerMethodBean<?>>();
+ this.disposalMethodBeanMap = new HashMap<WBMethod<?>, DisposalMethodBean<?>>();
this.allDisposalBeans = new ArrayList<DisposalMethodBean<?>>();
this.resolvedDisposalBeans = new HashSet<DisposalMethodBean<?>>();
this.beans = new HashSet<RIBean<?>>();
@@ -68,7 +68,7 @@
this.manager = manager;
}
- public ProducerMethodBean<?> getProducerMethod(AnnotatedMethod<?> method)
+ public ProducerMethodBean<?> getProducerMethod(WBMethod<?> method)
{
if (!producerMethodBeanMap.containsKey(method))
{
@@ -83,7 +83,7 @@
}
- public DisposalMethodBean<?> getDisposalMethod(AnnotatedMethod<?> method)
+ public DisposalMethodBean<?> getDisposalMethod(WBMethod<?> method)
{
if (!producerMethodBeanMap.containsKey(method))
{
@@ -97,7 +97,7 @@
}
}
- public AbstractClassBean<?> getClassBean(AnnotatedClass<?> clazz)
+ public AbstractClassBean<?> getClassBean(WBClass<?> clazz)
{
if (!classBeanMap.containsKey(clazz))
{
@@ -175,7 +175,7 @@
* @param bindings The binding types to match
* @return The set of matching disposal methods
*/
- public <T> Set<DisposalMethodBean<T>> resolveDisposalBeans(AnnotatedItem<T, ?> annotatedItem)
+ public <T> Set<DisposalMethodBean<T>> resolveDisposalBeans(WBAnnotated<T, ?> annotatedItem)
{
// Correct?
Set<Bean<?>> beans = disposalMethodResolver.get(ResolvableFactory.of(annotatedItem));
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverFactory.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -18,7 +18,7 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.AbstractClassBean;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.WBMethod;
import org.jboss.webbeans.transaction.spi.TransactionServices;
/**
@@ -37,7 +37,7 @@
* @param manager The Web Beans manager
* @return An observer implementation built from the method abstraction
*/
- public static <T> ObserverImpl<T> create(AnnotatedMethod<?> method, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
+ public static <T> ObserverImpl<T> create(WBMethod<?> method, AbstractClassBean<?> declaringBean, BeanManagerImpl manager)
{
ObserverImpl<T> result = null;
if (manager.getServices().contains(TransactionServices.class) && TransactionalObserverImpl.isObserverMethodTransactional(method))
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/ObserverImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -41,8 +41,8 @@
import org.jboss.webbeans.context.DependentInstancesStore;
import org.jboss.webbeans.context.DependentStorageRequest;
import org.jboss.webbeans.injection.MethodInjectionPoint;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
-import org.jboss.webbeans.introspector.AnnotatedParameter;
+import org.jboss.webbeans.introspector.WBMethod;
+import org.jboss.webbeans.introspector.WBParameter;
import org.jboss.webbeans.util.Names;
/**
@@ -74,7 +74,7 @@
* @param observerBean The observer bean
* @param manager The Web Beans manager
*/
- protected ObserverImpl(final AnnotatedMethod<?> observer, final RIBean<?> observerBean, final BeanManagerImpl manager)
+ protected ObserverImpl(final WBMethod<?> observer, final RIBean<?> observerBean, final BeanManagerImpl manager)
{
this.manager = manager;
this.observerBean = observerBean;
@@ -102,7 +102,7 @@
private void checkObserverMethod()
{
// Make sure exactly one and only one parameter is annotated with Observes
- List<AnnotatedParameter<?>> eventObjects = this.observerMethod.getAnnotatedParameters(Observes.class);
+ List<WBParameter<?>> eventObjects = this.observerMethod.getAnnotatedParameters(Observes.class);
if (eventObjects.size() > 1)
{
throw new DefinitionException(this + " is invalid because it contains more than event parameter annotated @Observes");
@@ -111,7 +111,7 @@
// variable or wildcard
if (eventObjects.size() > 0)
{
- AnnotatedParameter<?> eventParam = eventObjects.iterator().next();
+ WBParameter<?> eventParam = eventObjects.iterator().next();
if (eventParam.isParameterizedType())
{
for (Type type : eventParam.getActualTypeArguments())
@@ -128,7 +128,7 @@
}
}
// Check for parameters annotated with @Disposes
- List<AnnotatedParameter<?>> disposeParams = this.observerMethod.getAnnotatedParameters(Disposes.class);
+ List<WBParameter<?>> disposeParams = this.observerMethod.getAnnotatedParameters(Disposes.class);
if (disposeParams.size() > 0)
{
throw new DefinitionException(this + " cannot have any parameters annotated with @Disposes");
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/event/TransactionalObserverImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -29,7 +29,7 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.RIBean;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.WBMethod;
import org.jboss.webbeans.transaction.spi.TransactionServices;
/**
@@ -55,7 +55,7 @@
* @param observer The observer method
* @return true if the observer method is annotated as transactional
*/
- public static boolean isObserverMethodTransactional(AnnotatedMethod<?> observer)
+ public static boolean isObserverMethodTransactional(WBMethod<?> observer)
{
boolean transactional = true;
if ((observer.getAnnotatedParameters(BeforeTransactionCompletion.class).isEmpty()) && (observer.getAnnotatedParameters(AfterTransactionCompletion.class).isEmpty()) && (observer.getAnnotatedParameters(AfterTransactionSuccess.class).isEmpty()) && (observer.getAnnotatedParameters(AfterTransactionFailure.class).isEmpty()))
@@ -72,7 +72,7 @@
* @param observerBean The bean declaring the observer method
* @param manager The JCDI manager in use
*/
- protected TransactionalObserverImpl(AnnotatedMethod<?> observer, RIBean<?> observerBean, BeanManagerImpl manager)
+ protected TransactionalObserverImpl(WBMethod<?> observer, RIBean<?> observerBean, BeanManagerImpl manager)
{
super(observer, observerBean, manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedAdaptor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedAdaptor.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedAdaptor.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -6,14 +6,14 @@
import javax.enterprise.inject.spi.Annotated;
-import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.WBAnnotated;
public class AnnotatedAdaptor implements Annotated
{
- private final AnnotatedItem<?, ?> annotatedItem;
+ private final WBAnnotated<?, ?> annotatedItem;
- public AnnotatedAdaptor(AnnotatedItem<?, ?> annotatedItem)
+ public AnnotatedAdaptor(WBAnnotated<?, ?> annotatedItem)
{
this.annotatedItem = annotatedItem;
}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedInjectionPoint.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedInjectionPoint.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.injection;
-
-import javax.enterprise.inject.spi.InjectionPoint;
-
-import org.jboss.webbeans.introspector.AnnotatedItem;
-
-public interface AnnotatedInjectionPoint<T, S> extends InjectionPoint, AnnotatedItem<T, S>
-{
-
- /**
- * Injects an instance
- *
- *
- * @param declaringInstance The instance to inject into
- * @param value The value to inject
- */
- public void inject(Object declaringInstance, Object value);
-
-}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -32,17 +32,17 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.introspector.AnnotatedConstructor;
-import org.jboss.webbeans.introspector.AnnotatedParameter;
-import org.jboss.webbeans.introspector.ForwardingAnnotatedConstructor;
+import org.jboss.webbeans.introspector.WBConstructor;
+import org.jboss.webbeans.introspector.WBParameter;
+import org.jboss.webbeans.introspector.ForwardingWBConstructor;
-public class ConstructorInjectionPoint<T> extends ForwardingAnnotatedConstructor<T> implements AnnotatedInjectionPoint<T, Constructor<T>>
+public class ConstructorInjectionPoint<T> extends ForwardingWBConstructor<T> implements WBInjectionPoint<T, Constructor<T>>
{
private abstract class ForwardingParameterInjectionPointList extends AbstractList<ParameterInjectionPoint<?>>
{
- protected abstract List<? extends AnnotatedParameter<?>> delegate();
+ protected abstract List<? extends WBParameter<?>> delegate();
protected abstract Bean<?> declaringBean();;
@@ -63,21 +63,21 @@
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
private final Bean<?> declaringBean;
- private final AnnotatedConstructor<T> constructor;
+ private final WBConstructor<T> constructor;
- public static <T> ConstructorInjectionPoint<T> of(Bean<?> declaringBean, AnnotatedConstructor<T> constructor)
+ public static <T> ConstructorInjectionPoint<T> of(Bean<?> declaringBean, WBConstructor<T> constructor)
{
return new ConstructorInjectionPoint<T>(declaringBean, constructor);
}
- protected ConstructorInjectionPoint(Bean<?> declaringBean, AnnotatedConstructor<T> constructor)
+ protected ConstructorInjectionPoint(Bean<?> declaringBean, WBConstructor<T> constructor)
{
this.declaringBean = declaringBean;
this.constructor = constructor;
}
@Override
- protected AnnotatedConstructor<T> delegate()
+ protected WBConstructor<T> delegate()
{
return constructor;
}
@@ -120,7 +120,7 @@
@Override
public List<ParameterInjectionPoint<?>> getParameters()
{
- final List<? extends AnnotatedParameter<?>> delegate = super.getParameters();
+ final List<? extends WBParameter<?>> delegate = super.getParameters();
return new ForwardingParameterInjectionPointList()
{
@@ -131,7 +131,7 @@
}
@Override
- protected List<? extends AnnotatedParameter<?>> delegate()
+ protected List<? extends WBParameter<?>> delegate()
{
return delegate;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -27,30 +27,30 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.introspector.AnnotatedField;
-import org.jboss.webbeans.introspector.ForwardingAnnotatedField;
+import org.jboss.webbeans.introspector.WBField;
+import org.jboss.webbeans.introspector.ForwardingWBField;
-public class FieldInjectionPoint<T> extends ForwardingAnnotatedField<T> implements AnnotatedInjectionPoint<T, Field>
+public class FieldInjectionPoint<T> extends ForwardingWBField<T> implements WBInjectionPoint<T, Field>
{
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
private final Bean<?> declaringBean;
- private final AnnotatedField<T> field;
+ private final WBField<T> field;
- public static <T> FieldInjectionPoint<T> of(Bean<?> declaringBean, AnnotatedField<T> field)
+ public static <T> FieldInjectionPoint<T> of(Bean<?> declaringBean, WBField<T> field)
{
return new FieldInjectionPoint<T>(declaringBean, field);
}
- protected FieldInjectionPoint(Bean<?> declaringBean, AnnotatedField<T> field)
+ protected FieldInjectionPoint(Bean<?> declaringBean, WBField<T> field)
{
this.declaringBean = declaringBean;
this.field = field;
}
@Override
- protected AnnotatedField<T> delegate()
+ protected WBField<T> delegate()
{
return field;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -31,17 +31,17 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
-import org.jboss.webbeans.introspector.AnnotatedParameter;
-import org.jboss.webbeans.introspector.ForwardingAnnotatedMethod;
+import org.jboss.webbeans.introspector.WBMethod;
+import org.jboss.webbeans.introspector.WBParameter;
+import org.jboss.webbeans.introspector.ForwardingWBMethod;
-public class MethodInjectionPoint<T> extends ForwardingAnnotatedMethod<T> implements AnnotatedInjectionPoint<T, Method>
+public class MethodInjectionPoint<T> extends ForwardingWBMethod<T> implements WBInjectionPoint<T, Method>
{
private abstract class ForwardingParameterInjectionPointList extends AbstractList<ParameterInjectionPoint<?>>
{
- protected abstract List<? extends AnnotatedParameter<?>> delegate();
+ protected abstract List<? extends WBParameter<?>> delegate();
protected abstract Bean<?> declaringBean();;
@@ -62,21 +62,21 @@
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
private final Bean<?> declaringBean;
- private final AnnotatedMethod<T> method;
+ private final WBMethod<T> method;
- public static <T> MethodInjectionPoint<T> of(Bean<?> declaringBean, AnnotatedMethod<T> method)
+ public static <T> MethodInjectionPoint<T> of(Bean<?> declaringBean, WBMethod<T> method)
{
return new MethodInjectionPoint<T>(declaringBean, method);
}
- protected MethodInjectionPoint(Bean<?> declaringBean, AnnotatedMethod<T> method)
+ protected MethodInjectionPoint(Bean<?> declaringBean, WBMethod<T> method)
{
this.declaringBean = declaringBean;
this.method = method;
}
@Override
- protected AnnotatedMethod<T> delegate()
+ protected WBMethod<T> delegate()
{
return method;
}
@@ -196,7 +196,7 @@
@Override
public List<ParameterInjectionPoint<?>> getParameters()
{
- final List<? extends AnnotatedParameter<?>> delegate = super.getParameters();
+ final List<? extends WBParameter<?>> delegate = super.getParameters();
return new ForwardingParameterInjectionPointList()
{
@@ -207,7 +207,7 @@
}
@Override
- protected List<? extends AnnotatedParameter<?>> delegate()
+ protected List<? extends WBParameter<?>> delegate()
{
return delegate;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -25,30 +25,30 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.introspector.AnnotatedParameter;
-import org.jboss.webbeans.introspector.ForwardingAnnotatedParameter;
+import org.jboss.webbeans.introspector.WBParameter;
+import org.jboss.webbeans.introspector.ForwardingWBParameter;
-public class ParameterInjectionPoint<T> extends ForwardingAnnotatedParameter<T> implements AnnotatedInjectionPoint<T, Object>
+public class ParameterInjectionPoint<T> extends ForwardingWBParameter<T> implements WBInjectionPoint<T, Object>
{
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
- public static <T> ParameterInjectionPoint<T> of(Bean<?> declaringBean, AnnotatedParameter<T> parameter)
+ public static <T> ParameterInjectionPoint<T> of(Bean<?> declaringBean, WBParameter<T> parameter)
{
return new ParameterInjectionPoint<T>(declaringBean, parameter);
}
private final Bean<?> declaringBean;
- private final AnnotatedParameter<T> parameter;
+ private final WBParameter<T> parameter;
- private ParameterInjectionPoint(Bean<?> declaringBean, AnnotatedParameter<T> parameter)
+ private ParameterInjectionPoint(Bean<?> declaringBean, WBParameter<T> parameter)
{
this.declaringBean = declaringBean;
this.parameter = parameter;
}
@Override
- protected AnnotatedParameter<T> delegate()
+ protected WBParameter<T> delegate()
{
return parameter;
}
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/WBInjectionPoint.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedInjectionPoint.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/WBInjectionPoint.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/WBInjectionPoint.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.injection;
+
+import javax.enterprise.inject.spi.InjectionPoint;
+
+import org.jboss.webbeans.introspector.WBAnnotated;
+
+public interface WBInjectionPoint<T, S> extends InjectionPoint, WBAnnotated<T, S>
+{
+
+ /**
+ * Injects an instance
+ *
+ *
+ * @param declaringInstance The instance to inject into
+ * @param value The value to inject
+ */
+ public void inject(Object declaringInstance, Object value);
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/WBInjectionPoint.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableAnnotatedClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableAnnotatedClass.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableAnnotatedClass.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,211 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.injection.resolution;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.enterprise.inject.TypeLiteral;
-import javax.enterprise.inject.spi.InjectionPoint;
-
-import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.introspector.AnnotationStore;
-import org.jboss.webbeans.introspector.jlr.AbstractAnnotatedItem;
-import org.jboss.webbeans.util.Names;
-import org.jboss.webbeans.util.Reflections;
-
-public class ResolvableAnnotatedClass<T> extends AbstractAnnotatedItem<T, Class<T>> implements Resolvable
-{
-
- private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
- private static final Set<Annotation> EMPTY_ANNOTATION_SET = Collections.emptySet();
-
- private final Class<T> rawType;
- private final Set<Type> types;
- private final Type[] actualTypeArguments;
-
- private final String _string;
-
- private final BeanManagerImpl manager;
-
- public static <T> AnnotatedItem<T, Class<T>> of(TypeLiteral<T> typeLiteral, Annotation[] annotations, BeanManagerImpl manager)
- {
- return new ResolvableAnnotatedClass<T>(typeLiteral.getType(), annotations, manager);
- }
-
- public static <T> AnnotatedItem<T, Class<T>> of(Type type, Annotation[] annotations, BeanManagerImpl manager)
- {
- return new ResolvableAnnotatedClass<T>(type, annotations, manager);
- }
-
- public static <T> AnnotatedItem<T, Class<T>> of(InjectionPoint injectionPoint, BeanManagerImpl manager)
- {
- if (injectionPoint instanceof AnnotatedInjectionPoint)
- {
- @SuppressWarnings("unchecked")
- AnnotatedItem<T, Class<T>> ip = (AnnotatedItem<T, Class<T>>) injectionPoint;
- return ip;
- }
- else
- {
- return new ResolvableAnnotatedClass<T>(injectionPoint.getType(), injectionPoint.getAnnotated().getAnnotations(), manager);
- }
- }
-
- public static <T> AnnotatedItem<T, Class<T>> of(Member member, Annotation[] annotations, BeanManagerImpl manager)
- {
- if (member instanceof Field)
- {
- return new ResolvableAnnotatedClass<T>(((Field) member).getGenericType(), annotations, manager);
- }
- else if (member instanceof Method)
- {
- return new ResolvableAnnotatedClass<T>(((Method) member).getGenericReturnType(), annotations, manager);
- }
- else
- {
- throw new IllegalStateException();
- }
- }
-
- private ResolvableAnnotatedClass(Type type, AnnotationStore annotationStore, BeanManagerImpl manager)
- {
- super(annotationStore);
-
- this.manager = manager;
-
- if (type instanceof ParameterizedType)
- {
- ParameterizedType parameterizedType = (ParameterizedType) type;
- if (parameterizedType.getRawType() instanceof Class)
- {
- this.rawType = (Class<T>) parameterizedType.getRawType();
- }
- else
- {
- throw new IllegalArgumentException("Cannot extract rawType from " + type);
- }
- this.actualTypeArguments = ((ParameterizedType) type).getActualTypeArguments();
- this._string = rawType.toString() + "<" + Arrays.asList(actualTypeArguments).toString() + ">; binding types = " + Names.annotationsToString(annotationStore.getBindings());
- }
- else if (type instanceof Class)
- {
- this.rawType = (Class<T>) type;
- this.actualTypeArguments = new Type[0];
- this._string = rawType.toString() +"; binding types = " + Names.annotationsToString(annotationStore.getBindings());
- }
- else
- {
- throw new IllegalArgumentException("Unable to extract type information from " + type);
- }
- this.types = new HashSet<Type>();
- types.add(type);
- }
-
- private ResolvableAnnotatedClass(Type type, Annotation[] annotations, BeanManagerImpl manager)
- {
- this(type, AnnotationStore.of(annotations, EMPTY_ANNOTATION_ARRAY), manager);
- }
-
- private ResolvableAnnotatedClass(Type type, Set<Annotation>annotations, BeanManagerImpl manager)
- {
- this(type, AnnotationStore.of(annotations, EMPTY_ANNOTATION_SET), manager);
- }
-
- @Override
- public String toString()
- {
- return _string;
- }
-
- @Override
- public Class<T> getDelegate()
- {
- return rawType;
- }
-
- @Override
- public Type[] getActualTypeArguments()
- {
- return actualTypeArguments;
- }
-
- public String getName()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Class<T> getRawType()
- {
- return rawType;
- }
-
- @Override
- public Type getType()
- {
- return getRawType();
- }
-
- public boolean isFinal()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isPublic()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isStatic()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Set<Type> getFlattenedTypeHierarchy()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isProxyable()
- {
- throw new UnsupportedOperationException();
- }
-
- public Set<Type> getTypes()
- {
- return types;
- }
-
- public boolean isAssignableTo(Class<?> clazz)
- {
- return Reflections.isAssignableFrom(clazz, getType());
- }
-
-}
\ No newline at end of file
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -5,13 +5,13 @@
import java.util.HashSet;
import java.util.Set;
-import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.util.Reflections;
public class ResolvableFactory
{
- public static Resolvable of(AnnotatedItem<?, ?> element)
+ public static Resolvable of(WBAnnotated<?, ?> element)
{
if (element instanceof Resolvable)
{
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableWBClass.java (from rev 2827, ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableAnnotatedClass.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableWBClass.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableWBClass.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,211 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.injection.resolution;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Field;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.inject.TypeLiteral;
+import javax.enterprise.inject.spi.InjectionPoint;
+
+import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.injection.WBInjectionPoint;
+import org.jboss.webbeans.introspector.WBAnnotated;
+import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.introspector.jlr.AbstractWBAnnotated;
+import org.jboss.webbeans.util.Names;
+import org.jboss.webbeans.util.Reflections;
+
+public class ResolvableWBClass<T> extends AbstractWBAnnotated<T, Class<T>> implements Resolvable
+{
+
+ private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
+ private static final Set<Annotation> EMPTY_ANNOTATION_SET = Collections.emptySet();
+
+ private final Class<T> rawType;
+ private final Set<Type> types;
+ private final Type[] actualTypeArguments;
+
+ private final String _string;
+
+ private final BeanManagerImpl manager;
+
+ public static <T> WBAnnotated<T, Class<T>> of(TypeLiteral<T> typeLiteral, Annotation[] annotations, BeanManagerImpl manager)
+ {
+ return new ResolvableWBClass<T>(typeLiteral.getType(), annotations, manager);
+ }
+
+ public static <T> WBAnnotated<T, Class<T>> of(Type type, Annotation[] annotations, BeanManagerImpl manager)
+ {
+ return new ResolvableWBClass<T>(type, annotations, manager);
+ }
+
+ public static <T> WBAnnotated<T, Class<T>> of(InjectionPoint injectionPoint, BeanManagerImpl manager)
+ {
+ if (injectionPoint instanceof WBInjectionPoint)
+ {
+ @SuppressWarnings("unchecked")
+ WBAnnotated<T, Class<T>> ip = (WBAnnotated<T, Class<T>>) injectionPoint;
+ return ip;
+ }
+ else
+ {
+ return new ResolvableWBClass<T>(injectionPoint.getType(), injectionPoint.getAnnotated().getAnnotations(), manager);
+ }
+ }
+
+ public static <T> WBAnnotated<T, Class<T>> of(Member member, Annotation[] annotations, BeanManagerImpl manager)
+ {
+ if (member instanceof Field)
+ {
+ return new ResolvableWBClass<T>(((Field) member).getGenericType(), annotations, manager);
+ }
+ else if (member instanceof Method)
+ {
+ return new ResolvableWBClass<T>(((Method) member).getGenericReturnType(), annotations, manager);
+ }
+ else
+ {
+ throw new IllegalStateException();
+ }
+ }
+
+ private ResolvableWBClass(Type type, AnnotationStore annotationStore, BeanManagerImpl manager)
+ {
+ super(annotationStore);
+
+ this.manager = manager;
+
+ if (type instanceof ParameterizedType)
+ {
+ ParameterizedType parameterizedType = (ParameterizedType) type;
+ if (parameterizedType.getRawType() instanceof Class)
+ {
+ this.rawType = (Class<T>) parameterizedType.getRawType();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Cannot extract rawType from " + type);
+ }
+ this.actualTypeArguments = ((ParameterizedType) type).getActualTypeArguments();
+ this._string = rawType.toString() + "<" + Arrays.asList(actualTypeArguments).toString() + ">; binding types = " + Names.annotationsToString(annotationStore.getBindings());
+ }
+ else if (type instanceof Class)
+ {
+ this.rawType = (Class<T>) type;
+ this.actualTypeArguments = new Type[0];
+ this._string = rawType.toString() +"; binding types = " + Names.annotationsToString(annotationStore.getBindings());
+ }
+ else
+ {
+ throw new IllegalArgumentException("Unable to extract type information from " + type);
+ }
+ this.types = new HashSet<Type>();
+ types.add(type);
+ }
+
+ private ResolvableWBClass(Type type, Annotation[] annotations, BeanManagerImpl manager)
+ {
+ this(type, AnnotationStore.of(annotations, EMPTY_ANNOTATION_ARRAY), manager);
+ }
+
+ private ResolvableWBClass(Type type, Set<Annotation>annotations, BeanManagerImpl manager)
+ {
+ this(type, AnnotationStore.of(annotations, EMPTY_ANNOTATION_SET), manager);
+ }
+
+ @Override
+ public String toString()
+ {
+ return _string;
+ }
+
+ @Override
+ public Class<T> getDelegate()
+ {
+ return rawType;
+ }
+
+ @Override
+ public Type[] getActualTypeArguments()
+ {
+ return actualTypeArguments;
+ }
+
+ public String getName()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Class<T> getRawType()
+ {
+ return rawType;
+ }
+
+ @Override
+ public Type getType()
+ {
+ return getRawType();
+ }
+
+ public boolean isFinal()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isPublic()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isStatic()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Set<Type> getFlattenedTypeHierarchy()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isProxyable()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Set<Type> getTypes()
+ {
+ return types;
+ }
+
+ public boolean isAssignableTo(Class<?> clazz)
+ {
+ return Reflections.isAssignableFrom(clazz, getType());
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableWBClass.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -32,7 +32,7 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.standard.EventBean;
import org.jboss.webbeans.bean.standard.InstanceBean;
-import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.util.Beans;
import org.jboss.webbeans.util.ListComparator;
import org.jboss.webbeans.util.Reflections;
@@ -81,7 +81,7 @@
// The resolved injection points
private ConcurrentCache<Resolvable, Set<Bean<?>>> resolvedInjectionPoints;
// The registerd injection points
- private Set<AnnotatedItem<?, ?>> injectionPoints;
+ private Set<WBAnnotated<?, ?>> injectionPoints;
// The resolved names
private ConcurrentCache<String, Set<Bean<?>>> resolvedNames;
@@ -102,7 +102,7 @@
{
this.manager = manager;
this.beans = beans;
- this.injectionPoints = new HashSet<AnnotatedItem<?, ?>>();
+ this.injectionPoints = new HashSet<WBAnnotated<?, ?>>();
this.resolvedInjectionPoints = new ConcurrentCache<Resolvable, Set<Bean<?>>>();
this.resolvedNames = new ConcurrentCache<String, Set<Bean<?>>>();
this.transformers = new HashSet<ResolovableTransformer>();
@@ -111,11 +111,11 @@
}
/**
* Add multiple injection points for later resolving using
- * {@link #registerInjectionPoint(AnnotatedItem)}. Useful during bootstrap.
+ * {@link #registerInjectionPoint(WBAnnotated)}. Useful during bootstrap.
*
* @param elements The injection points to add
*/
- public void addInjectionPoints(Collection<? extends AnnotatedItem<?, ?>> elements)
+ public void addInjectionPoints(Collection<? extends WBAnnotated<?, ?>> elements)
{
injectionPoints.addAll(elements);
}
@@ -167,7 +167,7 @@
*/
public void resolveInjectionPoints()
{
- for (final AnnotatedItem<? extends Object, ? extends Object> injectable : injectionPoints)
+ for (final WBAnnotated<? extends Object, ? extends Object> injectable : injectionPoints)
{
registerInjectionPoint(ResolvableFactory.of(injectable));
}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedAnnotation.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedAnnotation.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedAnnotation.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,55 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
-/**
- * Represents a meta annotation
- *
- * @author Pete Muir
- *
- */
-public interface AnnotatedAnnotation<T extends Annotation> extends AnnotatedType<T>
-{
- /**
- * Gets all members
- *
- * @return A set of abstracted members
- */
- public Set<AnnotatedMethod<?>> getMembers();
-
- /**
- * Gets all the members annotated with annotationType
- *
- * @param annotationType The annotation type to match
- * @return A set of abstracted members with the annotation type
- */
- public Set<AnnotatedMethod<?>> getAnnotatedMembers(Class<? extends Annotation> annotationType);
-
- /**
- * Get an annotation member by name
- *
- * @param memberName
- * @return
- */
- public <A> AnnotatedMethod<A> getMember(String memberName, AnnotatedClass<A> expectedType);
-
- public Class<T> getRawType();
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,203 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.Set;
-
-/**
- * Represents a Class
- *
- * @author Pete Muir
- *
- */
-public interface AnnotatedClass<T> extends AnnotatedType<T>
-{
-
- /**
- * Gets all fields on the type
- *
- * @return A set of abstracted fields
- */
- public Set<AnnotatedField<?>> getFields();
-
- /**
- * Get a field by name
- *
- * @param <F> the expected type of the field
- * @param fieldName the field name
- * @param expectedType the expected type of the field
- * @return the field
- */
- public <F> AnnotatedField<F> getDeclaredField(String fieldName, AnnotatedClass<F> expectedType);
-
- /**
- * Gets all fields which are annotated with the given annotation type on this
- * class and all super classes
- *
- * @param annotationType The annotation to match
- * @return A set of abstracted fields with the given annotation. Returns an
- * empty set if there are no matches
- */
- public Set<AnnotatedField<?>> getAnnotatedFields(Class<? extends Annotation> annotationType);
-
- /**
- * Gets all fields which are annotated with the given annotation type on this
- * class only.
- *
- * @param annotationType The annotation to match
- * @return A set of abstracted fields with the given annotation. Returns an
- * empty set if there are no matches
- */
- public Set<AnnotatedField<?>> getDeclaredAnnotatedFields(Class<? extends Annotation> annotationType);
-
- /**
- * Gets all fields which are meta-annotated with metaAnnotationType
- *
- * @param metaAnnotationType The meta annotation to match
- * @return A set of abstracted fields with the given meta-annotation. Returns
- * an empty set if there are no matches
- */
- public Set<AnnotatedField<?>> getMetaAnnotatedFields(Class<? extends Annotation> metaAnnotationType);
-
- /**
- * Gets all constructors which are annotated with annotationType
- *
- * @param annotationType The annotation type to match
- * @return A set of abstracted fields with the given annotation. Returns an
- * empty set if there are no matches
- */
- public Set<AnnotatedConstructor<T>> getAnnotatedConstructors(Class<? extends Annotation> annotationType);
-
- /**
- * Gets all constructors
- *
- * @return A set of abstracted constructors
- */
- public Set<AnnotatedConstructor<T>> getConstructors();
-
- /**
- * Gets the no-args constructor
- *
- * @return The no-args constructor, or null if not defined
- */
- public AnnotatedConstructor<T> getNoArgsConstructor();
-
- /**
- * Get the constructor which matches the argument list provided
- *
- * @param parameterTypes the parameters of the constructor
- * @return the matching constructor, or null if not defined
- */
- public AnnotatedConstructor<T> getDeclaredConstructor(ConstructorSignature signature);
-
- /**
- * Gets all methods annotated with annotationType
- *
- * @param annotationType The annotation to match
- * @return A set of abstracted methods with the given annotation. Returns an
- * empty set if there are no matches
- */
- public Set<AnnotatedMethod<?>> getAnnotatedMethods(Class<? extends Annotation> annotationType);
-
- /**
- * Gets all methods annotated with annotationType
- *
- * @param annotationType The annotation to match
- * @return A set of abstracted methods with the given annotation. Returns an
- * empty set if there are no matches
- */
- public Set<AnnotatedMethod<?>> getDeclaredAnnotatedMethods(Class<? extends Annotation> annotationType);
-
- /**
- * Find the annotated method for a given methodDescriptor
- *
- * @param methodDescriptor
- * @return
- *
- * TODO Replace with AnnotatedMethod variant
- */
- @Deprecated
- public AnnotatedMethod<?> getMethod(Method method);
-
- /**
- * Get a method by name
- *
- * @param <M> the expected return type
- * @param signature the name of the method
- * @param expectedReturnType the expected return type
- * @return the method, or null if it doesn't exist
- */
- public <M> AnnotatedMethod<M> getDeclaredMethod(MethodSignature signature, AnnotatedClass<M> expectedReturnType);
-
- // TODO Replace with AnnotatedMethod variant
- @Deprecated
- public AnnotatedMethod<?> getDeclaredMethod(Method method);
-
- /**
- * Gets all with parameters annotated with annotationType
- *
- * @param annotationType The annotation to match
- * @return A set of abstracted methods with the given annotation. Returns an
- * empty set if there are no matches
- */
- public Set<AnnotatedMethod<?>> getMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType);
-
- /**
- * Gets all with constructors annotated with annotationType
- *
- * @param annotationType The annotation to match
- * @return A set of abstracted constructors with the given annotation. Returns an
- * empty set if there are no matches
- */
- public Set<AnnotatedConstructor<?>> getConstructorsWithAnnotatedParameters(Class<? extends Annotation> annotationType);
-
- /**
- * Gets all with parameters annotated with annotationType
- *
- * @param annotationType The annotation to match
- * @return A set of abstracted methods with the given annotation. Returns an
- * empty set if there are no matches
- */
- public Set<AnnotatedMethod<?>> getDeclaredMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType);
-
- /**
- * Gets the superclass.
- *
- * @return The abstracted superclass, null if there is no superclass
- */
- public AnnotatedClass<?> getSuperclass();
-
- /**
- * Determine if this is a non-static member class
- *
- * @return true if this is a non-static member
- */
- public boolean isNonStaticMemberClass();
-
- public boolean isParameterizedType();
-
- public boolean isAbstract();
-
- public boolean isEnum();
-
- public <S> S cast(Object object);
-
- public <U> AnnotatedClass<? extends U> asSubclass(AnnotatedClass<U> clazz);
-
-}
\ No newline at end of file
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,75 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.decorator.Decorates;
-
-/**
- * Represents a Class Constructor
- *
- * @author Pete Muir
- *
- */
-public interface AnnotatedConstructor<T> extends AnnotatedMember<T, Constructor<T>>
-{
-
- @SuppressWarnings("unchecked")
- public static final Set<Class<? extends Annotation>> MAPPED_PARAMETER_ANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(Decorates.class));
-
- /**
- * Gets all parameters to the constructor
- *
- * @return A set of abstracted parameters. Returns an empty set if there are
- * no parameters
- */
- public List<? extends AnnotatedParameter<?>> getParameters();
-
- /**
- * Gets all parameters to the constructor which are annotated with
- * annotationType
- *
- * @param annotationType A annotation to match
- * @return A list of abstracted parameters with the given annotation type.
- * Returns an empty set if there are no matches.
- */
- public List<AnnotatedParameter<?>> getAnnotatedParameters(Class<? extends Annotation> annotationType);
-
- /**
- * Creates a new instance of the class, using this constructor
- *
- * @return The created instance
- */
- public T newInstance(Object... parameters) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException;
-
- /**
- * Gets the declaring class of the annotation
- *
- * @return An abstraction of the declaring class
- */
- public AnnotatedType<T> getDeclaringClass();
-
- public ConstructorSignature getSignature();
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,65 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.reflect.Field;
-
-/**
- * AnnotatedField provides a uniform access to the annotations on an annotated
- * field
- *
- * @author Pete Muir
- *
- */
-public interface AnnotatedField<T> extends AnnotatedMember<T, Field>
-{
-
- /**
- * Gets the annotated field
- *
- * @return The annotated field
- */
- public Field getAnnotatedField();
-
- /**
- * Injects an instance
- *
- *
- * @param declaringInstance The instance to inject into
- * @param value The value to inject
- */
- public void set(Object declaringInstance, Object value) throws IllegalArgumentException, IllegalAccessException;
-
- public T get(Object instance);
-
- /**
- * Gets an abstraction of the declaring class
- *
- * @return The declaring class
- */
- public AnnotatedType<?> getDeclaringClass();
-
- /**
- * Gets the property name of the field
- *
- * @return The name
- */
- public String getPropertyName();
-
- public boolean isTransient();
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,225 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.enterprise.context.ScopeType;
-import javax.enterprise.inject.BindingType;
-import javax.enterprise.inject.Stereotype;
-import javax.enterprise.inject.deployment.DeploymentType;
-
-/**
- * AnnotatedItem provides a uniform access to the annotations on an annotated
- * item defined either in Java or XML
- *
- * @author Pete Muir
- *
- */
-public interface AnnotatedItem<T, S>
-{
-
-// The set of meta-annotations to map
- @SuppressWarnings("unchecked")
- public static final Set<Class<? extends Annotation>> MAPPED_METAANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(BindingType.class, DeploymentType.class, Stereotype.class, ScopeType.class));
-
- /**
- * Gets all annotations on the item
- *
- * @return A set of annotations. Returns an empty set if there are no
- * matches.
- */
- public <A extends Annotation> Set<A> getAnnotations();
-
- /**
- * Gets all annotations which are annotated with the given meta annotation
- * type
- *
- * @param The meta annotation to match
- * @return A set of matching meta-annotations. Returns an empty set if there
- * are no matches.
- */
- public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType);
-
- /**
- * Gets all annotations which are declared on this annotated item
- * with the given meta annotation type
- *
- * @param The meta annotation to match
- * @return A set of matching meta-annotations. Returns an empty set if there
- * are no matches.
- */
- public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType);
-
- /**
- * Gets all annotations which are annotated with the given meta annotation
- * type
- *
- * @param The meta annotation to match
- * @return An array of matching meta-annotations. Returns an empty array if
- * there are no matches.
- */
- public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType);
-
- /**
- * Gets the binding types for this element
- *
- * @returns A set of binding types present on the type. Returns an empty set
- * if there are no matches.
- * @deprecated This reflection type should not know about JSR-299 binding types
- */
- @Deprecated
- public Set<Annotation> getBindings();
-
- /**
- * Gets the binding types for this element
- *
- * @returns An array of binding types present on the type. Returns an empty
- * array if there are no matches.
- * @deprecated This reflection type should not know about JSR-299 binding types
- */
- @Deprecated
- public Annotation[] getBindingsAsArray();
-
- /**
- * Gets an annotation for the annotation type specified.
- *
- * @param annotationType The annotation to match
- * @return An annotation if found, null if the annotation wasn't present.
- */
- public <A extends Annotation> A getAnnotation(Class<A> annotationType);
-
- /**
- * Get the whole type hierarchy as a set of flattened types.
- *
- * The returned types should have any type parameters resolved to their
- * actual types.
- *
- * @return the type hierarchy
- */
- public Set<Type> getFlattenedTypeHierarchy();
-
- /**
- * Get the type hierarchy of any interfaces implemented by this class.
- *
- * Interface hierarchies from super classes are not included.
- *
- * The returned types should have any type parameters resolved to their
- * actual types.
- *
- * @return the type hierarchy
- */
- public Set<Type> getInterfaceOnlyFlattenedTypeHierarchy();
-
- /**
- * Indicates if an annotation type specified is present
- *
- * @param annotationType The annotation to match
- * @return True if present, false if not
- */
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType);
-
- /**
- * Indicates if an annotation type specified is present
- *
- * @param annotationType The annotation to match
- * @return True if present, false if not
- */
- public boolean isDeclaredAnnotationPresent(Class<? extends Annotation> annotationType);
-
- /**
- * Gets the type of the element
- *
- * @return The type of the element
- */
- public Class<T> getRawType();
-
- public Type getType();
-
- /**
- * Extends Java Class assignability such that actual type parameters are also
- * considered
- *
- * @param that The other item to check assignability against
- * @return True if assignable, false otherwise.
- */
- public boolean isAssignableFrom(AnnotatedItem<?, ?> that);
-
- /**
- * Extends Java Class assignability such that actual type parameters are also
- * considered
- *
- * @param type The type to compare against
- * @param actualTypeArguments The type arguments
- * @return True is assignable, false otherwise
- */
- public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments);
-
- /**
- * Gets the actual type arguments for any parameterized types that this
- * AnnotatedItem represents.
- *
- * @return An array of type arguments
- */
- public Type[] getActualTypeArguments();
-
- /**
- * Indicates if this AnnotatedItem represents a static element
- *
- * @return True if static, false otherwise
- */
- public boolean isStatic();
-
- /**
- * Indicates if this AnnotatedItem represents a final element
- * @return True if final, false otherwise
- */
- public boolean isFinal();
-
- /**
- * Indicates if this AnnotatedItem can be proxyed
- *
- * @return True if proxyable, false otherwise
- */
- public boolean isProxyable();
-
- /**
- * Indicates if this annotated item is public
- *
- * @return if public, returns true
- */
- public boolean isPublic();
-
- /**
- * Gets the name of this AnnotatedItem
- *
- * If it is not possible to determine the name of the underling element, a
- * IllegalArgumentException is thrown
- *
- * @return The name
- */
- public String getName();
-
- public AnnotationStore getAnnotationStore();
-
- public boolean isParameterizedType();
-
-}
\ No newline at end of file
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMember.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMember.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMember.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.reflect.Member;
-/**
- * AnnotedMember provides enhanced access to an annotated member
- *
- * @author Pete Muir
- *
- */
-public interface AnnotatedMember<T, S extends Member> extends AnnotatedItem<T, S>
-{
-
- public S getMember();
-
- /**
- * Gets an abstraction of the declaring class
- *
- * @return The declaring class
- */
- public AnnotatedType<?> getDeclaringClass();
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,115 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.enterprise.inject.Disposes;
-import javax.event.AfterTransactionCompletion;
-import javax.event.AfterTransactionFailure;
-import javax.event.AfterTransactionSuccess;
-import javax.event.Asynchronously;
-import javax.event.BeforeTransactionCompletion;
-import javax.event.IfExists;
-import javax.event.Observes;
-
-/**
- * AnnotatedType provides a uniform access to the annotations on an annotated
- * class defined either in Java or XML
- *
- * @author Pete Muir
- *
- */
-public interface AnnotatedMethod<T> extends AnnotatedMember<T, Method>
-{
- @SuppressWarnings("unchecked")
- public static final Set<Class<? extends Annotation>> MAPPED_PARAMETER_ANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(Disposes.class, Observes.class, IfExists.class, BeforeTransactionCompletion.class, AfterTransactionCompletion.class, AfterTransactionFailure.class, AfterTransactionSuccess.class, Asynchronously.class, Disposes.class));
-
- /**
- * Gets the abstracted parameters of the method
- *
- * @return A list of parameters. Returns an empty list if no parameters are
- * present.
- */
- public List<? extends AnnotatedParameter<?>> getParameters();
-
- /**
- * Gets the list of annotated parameters for a given annotation
- *
- * @param metaAnnotationType The annotation to match
- * @return A set of matching parameter abstractions. Returns an empty list if
- * there are no matches.
- */
- public List<AnnotatedParameter<?>> getAnnotatedParameters(Class<? extends Annotation> metaAnnotationType);
-
- /**
- * Get the parameter types as an array
- */
- public Class<?>[] getParameterTypesAsArray();
-
- /**
- * Invokes the method
- *
- * @param instance The instance to invoke
- * @param parameters The method parameters
- * @return A reference to the instance
- */
- public T invoke(Object instance, Object... parameters) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException;
-
- /**
- * Invokes the method on the class of the passed instance, not the declaring
- * class. Useful with proxies
- *
- * @param instance The instance to invoke
- * @param manager The Web Beans manager
- * @return A reference to the instance
- */
- public T invokeOnInstance(Object instance, Object... parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException;
-
- /**
- * Gets the declaring class
- *
- * @return An abstraction of the declaring class
- */
- public AnnotatedType<?> getDeclaringClass();
-
- /**
- * Gets the property name
- *
- * @return The name
- */
- public String getPropertyName();
-
- /**
- * Checks if a this is equivalent to a JLR method
- *
- * @param method The JLR method
- * @return true if equivalent
- */
- public boolean isEquivalent(Method method);
-
- public Method getAnnotatedMethod();
-
- public MethodSignature getSignature();
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-
-
-/**
- * AnnotatedParameter provides a uniform access to a method parameter defined
- * either in Java or XML
- *
- * @author Pete Muir
- * @param <T>
- */
-public interface AnnotatedParameter<T> extends AnnotatedItem<T, Object>
-{
-
- public AnnotatedMember<?, ?> getDeclaringMember();
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedType.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedType.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedType.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-
-/**
- * AnnotatedType provides a uniform access to a type defined either in Java or
- * XML
- *
- * @author Pete Muir
- * @param <T>
- */
-public interface AnnotatedType<T> extends AnnotatedItem<T, Class<T>>
-{
-
- /**
- * Gets the superclass of the type
- *
- * @return The abstracted superclass
- */
- public AnnotatedType<?> getSuperclass();
-
- /**
- * Check if this is equivalent to a java class
- * @param clazz The Java class
- * @return true if equivalent
- */
- public boolean isEquivalent(Class<?> clazz);
-
- public String getSimpleName();
-
-}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -16,7 +16,7 @@
*/
package org.jboss.webbeans.introspector;
-import static org.jboss.webbeans.introspector.AnnotatedItem.MAPPED_METAANNOTATIONS;
+import static org.jboss.webbeans.introspector.WBAnnotated.MAPPED_METAANNOTATIONS;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedAnnotation.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedAnnotation.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedAnnotation.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,38 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
-public abstract class ForwardingAnnotatedAnnotation<T extends Annotation> extends ForwardingAnnotatedType<T> implements AnnotatedAnnotation<T>
-{
-
- @Override
- protected abstract AnnotatedAnnotation<T> delegate();
-
- public Set<AnnotatedMethod<?>> getAnnotatedMembers(Class<? extends Annotation> annotationType)
- {
- return delegate().getAnnotatedMembers(annotationType);
- }
-
- public Set<AnnotatedMethod<?>> getMembers()
- {
- return delegate().getMembers();
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,152 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.Set;
-
-public abstract class ForwardingAnnotatedClass<T> extends ForwardingAnnotatedType<T> implements AnnotatedClass<T>
-{
-
- protected abstract AnnotatedClass<T> delegate();
-
- public Set<AnnotatedConstructor<T>> getAnnotatedConstructors(Class<? extends Annotation> annotationType)
- {
- return delegate().getAnnotatedConstructors(annotationType);
- }
-
- public Set<AnnotatedField<?>> getAnnotatedFields(Class<? extends Annotation> annotationType)
- {
- return delegate().getAnnotatedFields(annotationType);
- }
-
- public Set<AnnotatedMethod<?>> getAnnotatedMethods(Class<? extends Annotation> annotationType)
- {
- return delegate().getAnnotatedMethods(annotationType);
- }
-
- public AnnotatedConstructor<T> getNoArgsConstructor()
- {
- return delegate().getNoArgsConstructor();
- }
-
- public Set<AnnotatedConstructor<T>> getConstructors()
- {
- return delegate().getConstructors();
- }
-
- public Set<AnnotatedField<?>> getDeclaredAnnotatedFields(Class<? extends Annotation> annotationType)
- {
- return delegate().getDeclaredAnnotatedFields(annotationType);
- }
-
- public Set<AnnotatedMethod<?>> getDeclaredAnnotatedMethods(Class<? extends Annotation> annotationType)
- {
- return delegate().getDeclaredAnnotatedMethods(annotationType);
- }
-
- public Set<AnnotatedMethod<?>> getDeclaredMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
- {
- return delegate().getDeclaredMethodsWithAnnotatedParameters(annotationType);
- }
-
- public Set<AnnotatedField<?>> getFields()
- {
- return delegate().getFields();
- }
-
- public Set<AnnotatedField<?>> getMetaAnnotatedFields(Class<? extends Annotation> metaAnnotationType)
- {
- return delegate().getMetaAnnotatedFields(metaAnnotationType);
- }
-
- @Deprecated
- public AnnotatedMethod<?> getMethod(Method method)
- {
- return delegate().getMethod(method);
- }
-
- public Set<AnnotatedMethod<?>> getMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
- {
- return delegate().getMethodsWithAnnotatedParameters(annotationType);
- }
-
- public Set<AnnotatedConstructor<?>> getConstructorsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
- {
- return delegate().getConstructorsWithAnnotatedParameters(annotationType);
- }
-
- public AnnotatedClass<?> getSuperclass()
- {
- return delegate().getSuperclass();
- }
-
- public boolean isNonStaticMemberClass()
- {
- return delegate().isNonStaticMemberClass();
- }
-
- public boolean isParameterizedType()
- {
- return delegate().isParameterizedType();
- }
-
- public boolean isAbstract()
- {
- return delegate().isAbstract();
- }
-
- public boolean isEnum()
- {
- return delegate().isEnum();
- }
-
- @Deprecated
- public AnnotatedMethod<?> getDeclaredMethod(Method method)
- {
- return delegate().getDeclaredMethod(method);
- }
-
- public <F> AnnotatedField<F> getDeclaredField(String fieldName, AnnotatedClass<F> expectedType)
- {
- return delegate().getDeclaredField(fieldName, expectedType);
- }
-
- public <M> AnnotatedMethod<M> getDeclaredMethod(MethodSignature signature, AnnotatedClass<M> expectedReturnType)
- {
- return delegate().getDeclaredMethod(signature, expectedReturnType);
- }
-
- public AnnotatedConstructor<T> getDeclaredConstructor(ConstructorSignature signature)
- {
- return delegate().getDeclaredConstructor(signature);
- }
-
- public <U> AnnotatedClass<? extends U> asSubclass(AnnotatedClass<U> clazz)
- {
- return delegate().asSubclass(clazz);
- }
-
- public <S> S cast(Object object)
- {
- return delegate().<S>cast(object);
- }
-
-
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedConstructor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedConstructor.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedConstructor.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,56 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
-public abstract class ForwardingAnnotatedConstructor<T> extends ForwardingAnnotatedMember<T, Constructor<T>> implements AnnotatedConstructor<T>
-{
-
- @Override
- protected abstract AnnotatedConstructor<T> delegate();
-
- public List<AnnotatedParameter<?>> getAnnotatedParameters(Class<? extends Annotation> annotationType)
- {
- return delegate().getAnnotatedParameters(annotationType);
- }
-
- public AnnotatedType<T> getDeclaringClass()
- {
- return delegate().getDeclaringClass();
- }
-
- public List<? extends AnnotatedParameter<?>> getParameters()
- {
- return delegate().getParameters();
- }
-
- public T newInstance(Object... parameters) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
- {
- return delegate().newInstance(parameters);
- }
-
- public ConstructorSignature getSignature()
- {
- return delegate().getSignature();
- }
-
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedField.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedField.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedField.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,57 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.reflect.Field;
-
-public abstract class ForwardingAnnotatedField<T> extends ForwardingAnnotatedMember<T, Field> implements AnnotatedField<T>
-{
-
- @Override
- protected abstract AnnotatedField<T> delegate();
-
- public T get(Object instance)
- {
- return delegate().get(instance);
- }
-
- public Field getAnnotatedField()
- {
- return delegate().getAnnotatedField();
- }
-
- public AnnotatedType<?> getDeclaringClass()
- {
- return delegate().getDeclaringClass();
- }
-
- public String getPropertyName()
- {
- return delegate().getPropertyName();
- }
-
- public void set(Object declaringInstance, Object value) throws IllegalArgumentException, IllegalAccessException
- {
- delegate().set(declaringInstance, value);
- }
-
- public boolean isTransient()
- {
- return delegate().isTransient();
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,233 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Set;
-
-/**
- * Provides an abstraction for delegating access to an annotated item
- *
- * @author Pete Muir
- *
- * @param <T>
- * @param <S>
- */
-public abstract class ForwardingAnnotatedItem<T, S> implements AnnotatedItem<T, S>
-{
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public Type[] getActualTypeArguments()
- {
- return delegate().getActualTypeArguments();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public <A extends Annotation> A getAnnotation(Class<A> annotationType)
- {
- return delegate().getAnnotation(annotationType);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public Set<Annotation> getAnnotations()
- {
- return delegate().getAnnotations();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return delegate().getMetaAnnotations(metaAnnotationType);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
- {
- return delegate().getMetaAnnotationsAsArray(metaAnnotationType);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- @Deprecated
- public Set<Annotation> getBindings()
- {
- return delegate().getBindings();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- @Deprecated
- public Annotation[] getBindingsAsArray()
- {
- return delegate().getBindingsAsArray();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
- {
- return delegate().isAnnotationPresent(annotationType);
- }
-
- public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return delegate().getDeclaredMetaAnnotations(metaAnnotationType);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public String getName()
- {
- return delegate().getName();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public Class<T> getRawType()
- {
- return delegate().getRawType();
- }
-
- public Type getType()
- {
- return delegate().getType();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public boolean isAssignableFrom(AnnotatedItem<?, ?> that)
- {
- return delegate().isAssignableFrom(that);
- }
-
- public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
- {
- return delegate().isAssignableFrom(type, actualTypeArguments);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public boolean isFinal()
- {
- return delegate().isFinal();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public boolean isStatic()
- {
- return delegate().isStatic();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public boolean isProxyable()
- {
- return delegate().isProxyable();
- }
-
- public boolean isPublic()
- {
- return delegate().isPublic();
- }
-
- /**
- * Overridden method into delegate
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- @Override
- public boolean equals(Object obj)
- {
- return delegate().equals(obj);
- }
-
- /**
- * Overridden method into delegate
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- @Override
- public int hashCode()
- {
- return delegate().hashCode();
- }
-
- /**
- * Overridden method into delegate
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- @Override
- public String toString()
- {
- return delegate().toString();
- }
-
- /**
- * Gets the annotated item
- *
- * @return The annotated item
- */
- protected abstract AnnotatedItem<T, S> delegate();
-
- public AnnotationStore getAnnotationStore()
- {
- return delegate().getAnnotationStore();
- }
-
- public boolean isDeclaredAnnotationPresent(Class<? extends Annotation> annotationType)
- {
- return delegate().isDeclaredAnnotationPresent(annotationType);
- }
-
- public Set<Type> getFlattenedTypeHierarchy()
- {
- return delegate().getFlattenedTypeHierarchy();
- }
-
- public Set<Type> getInterfaceOnlyFlattenedTypeHierarchy()
- {
- return delegate().getInterfaceOnlyFlattenedTypeHierarchy();
- }
-
- public boolean isParameterizedType()
- {
- return delegate().isParameterizedType();
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMember.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMember.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMember.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.reflect.Member;
-
-public abstract class ForwardingAnnotatedMember<T, S extends Member> extends ForwardingAnnotatedItem<T, S> implements AnnotatedMember<T, S>
-{
-
- @Override
- protected abstract AnnotatedMember<T, S> delegate();
-
- public S getMember()
- {
- return delegate().getMember();
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMethod.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMethod.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMethod.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,80 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.List;
-
-public abstract class ForwardingAnnotatedMethod<T> extends ForwardingAnnotatedMember<T, Method> implements AnnotatedMethod<T>
-{
-
- @Override
- protected abstract AnnotatedMethod<T> delegate();
-
- public Method getAnnotatedMethod()
- {
- return delegate().getAnnotatedMethod();
- }
-
- public List<AnnotatedParameter<?>> getAnnotatedParameters(Class<? extends Annotation> metaAnnotationType)
- {
- return delegate().getAnnotatedParameters(metaAnnotationType);
- }
-
- public AnnotatedType<?> getDeclaringClass()
- {
- return delegate().getDeclaringClass();
- }
-
- public Class<?>[] getParameterTypesAsArray()
- {
- return delegate().getParameterTypesAsArray();
- }
-
- public List<? extends AnnotatedParameter<?>> getParameters()
- {
- return delegate().getParameters();
- }
-
- public String getPropertyName()
- {
- return delegate().getPropertyName();
- }
-
- public T invoke(Object instance, Object... parameters) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
- {
- return delegate().invoke(instance, parameters);
- }
-
- public T invokeOnInstance(Object instance, Object... parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException
- {
- return delegate().invokeOnInstance(instance, parameters);
- }
-
- public boolean isEquivalent(Method method)
- {
- return delegate().isEquivalent(method);
- }
-
- public MethodSignature getSignature()
- {
- return delegate().getSignature();
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedParameter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedParameter.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedParameter.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,32 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-
-public abstract class ForwardingAnnotatedParameter<T> extends ForwardingAnnotatedItem<T, Object> implements AnnotatedParameter<T>
-{
-
- @Override
- protected abstract AnnotatedParameter<T> delegate();
-
- public AnnotatedMember<?, ?> getDeclaringMember()
- {
- return delegate().getDeclaringMember();
- }
-
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedType.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedType.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedType.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,40 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-public abstract class ForwardingAnnotatedType<T> extends ForwardingAnnotatedItem<T, Class<T>> implements AnnotatedType<T>
-{
-
- @Override
- protected abstract AnnotatedType<T> delegate();
-
- public AnnotatedType<?> getSuperclass()
- {
- return delegate().getSuperclass();
- }
-
- public boolean isEquivalent(Class<?> clazz)
- {
- return delegate().isEquivalent(clazz);
- }
-
- public String getSimpleName()
- {
- return delegate().getSimpleName();
- }
-
-}
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java (from rev 2827, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,233 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+/**
+ * Provides an abstraction for delegating access to an annotated item
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ * @param <S>
+ */
+public abstract class ForwardingWBAnnotated<T, S> implements WBAnnotated<T, S>
+{
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public Type[] getActualTypeArguments()
+ {
+ return delegate().getActualTypeArguments();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public <A extends Annotation> A getAnnotation(Class<A> annotationType)
+ {
+ return delegate().getAnnotation(annotationType);
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public Set<Annotation> getAnnotations()
+ {
+ return delegate().getAnnotations();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return delegate().getMetaAnnotations(metaAnnotationType);
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
+ {
+ return delegate().getMetaAnnotationsAsArray(metaAnnotationType);
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ @Deprecated
+ public Set<Annotation> getBindings()
+ {
+ return delegate().getBindings();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ @Deprecated
+ public Annotation[] getBindingsAsArray()
+ {
+ return delegate().getBindingsAsArray();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return delegate().isAnnotationPresent(annotationType);
+ }
+
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return delegate().getDeclaredMetaAnnotations(metaAnnotationType);
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public String getName()
+ {
+ return delegate().getName();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public Class<T> getRawType()
+ {
+ return delegate().getRawType();
+ }
+
+ public Type getType()
+ {
+ return delegate().getType();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public boolean isAssignableFrom(WBAnnotated<?, ?> that)
+ {
+ return delegate().isAssignableFrom(that);
+ }
+
+ public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
+ {
+ return delegate().isAssignableFrom(type, actualTypeArguments);
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public boolean isFinal()
+ {
+ return delegate().isFinal();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public boolean isStatic()
+ {
+ return delegate().isStatic();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public boolean isProxyable()
+ {
+ return delegate().isProxyable();
+ }
+
+ public boolean isPublic()
+ {
+ return delegate().isPublic();
+ }
+
+ /**
+ * Overridden method into delegate
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ /**
+ * Overridden method into delegate
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+ /**
+ * Overridden method into delegate
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+ /**
+ * Gets the annotated item
+ *
+ * @return The annotated item
+ */
+ protected abstract WBAnnotated<T, S> delegate();
+
+ public AnnotationStore getAnnotationStore()
+ {
+ return delegate().getAnnotationStore();
+ }
+
+ public boolean isDeclaredAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return delegate().isDeclaredAnnotationPresent(annotationType);
+ }
+
+ public Set<Type> getFlattenedTypeHierarchy()
+ {
+ return delegate().getFlattenedTypeHierarchy();
+ }
+
+ public Set<Type> getInterfaceOnlyFlattenedTypeHierarchy()
+ {
+ return delegate().getInterfaceOnlyFlattenedTypeHierarchy();
+ }
+
+ public boolean isParameterizedType()
+ {
+ return delegate().isParameterizedType();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotated.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotation.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedAnnotation.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotation.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotation.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+public abstract class ForwardingWBAnnotation<T extends Annotation> extends ForwardingWBType<T> implements WBAnnotation<T>
+{
+
+ @Override
+ protected abstract WBAnnotation<T> delegate();
+
+ public Set<WBMethod<?>> getAnnotatedMembers(Class<? extends Annotation> annotationType)
+ {
+ return delegate().getAnnotatedMembers(annotationType);
+ }
+
+ public Set<WBMethod<?>> getMembers()
+ {
+ return delegate().getMembers();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBAnnotation.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBClass.java (from rev 2823, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedClass.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBClass.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBClass.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,152 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.Set;
+
+public abstract class ForwardingWBClass<T> extends ForwardingWBType<T> implements WBClass<T>
+{
+
+ protected abstract WBClass<T> delegate();
+
+ public Set<WBConstructor<T>> getAnnotatedConstructors(Class<? extends Annotation> annotationType)
+ {
+ return delegate().getAnnotatedConstructors(annotationType);
+ }
+
+ public Set<WBField<?>> getAnnotatedFields(Class<? extends Annotation> annotationType)
+ {
+ return delegate().getAnnotatedFields(annotationType);
+ }
+
+ public Set<WBMethod<?>> getAnnotatedMethods(Class<? extends Annotation> annotationType)
+ {
+ return delegate().getAnnotatedMethods(annotationType);
+ }
+
+ public WBConstructor<T> getNoArgsConstructor()
+ {
+ return delegate().getNoArgsConstructor();
+ }
+
+ public Set<WBConstructor<T>> getConstructors()
+ {
+ return delegate().getConstructors();
+ }
+
+ public Set<WBField<?>> getDeclaredAnnotatedFields(Class<? extends Annotation> annotationType)
+ {
+ return delegate().getDeclaredAnnotatedFields(annotationType);
+ }
+
+ public Set<WBMethod<?>> getDeclaredAnnotatedMethods(Class<? extends Annotation> annotationType)
+ {
+ return delegate().getDeclaredAnnotatedMethods(annotationType);
+ }
+
+ public Set<WBMethod<?>> getDeclaredMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
+ {
+ return delegate().getDeclaredMethodsWithAnnotatedParameters(annotationType);
+ }
+
+ public Set<WBField<?>> getFields()
+ {
+ return delegate().getFields();
+ }
+
+ public Set<WBField<?>> getMetaAnnotatedFields(Class<? extends Annotation> metaAnnotationType)
+ {
+ return delegate().getMetaAnnotatedFields(metaAnnotationType);
+ }
+
+ @Deprecated
+ public WBMethod<?> getMethod(Method method)
+ {
+ return delegate().getMethod(method);
+ }
+
+ public Set<WBMethod<?>> getMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
+ {
+ return delegate().getMethodsWithAnnotatedParameters(annotationType);
+ }
+
+ public Set<WBConstructor<?>> getConstructorsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
+ {
+ return delegate().getConstructorsWithAnnotatedParameters(annotationType);
+ }
+
+ public WBClass<?> getSuperclass()
+ {
+ return delegate().getSuperclass();
+ }
+
+ public boolean isNonStaticMemberClass()
+ {
+ return delegate().isNonStaticMemberClass();
+ }
+
+ public boolean isParameterizedType()
+ {
+ return delegate().isParameterizedType();
+ }
+
+ public boolean isAbstract()
+ {
+ return delegate().isAbstract();
+ }
+
+ public boolean isEnum()
+ {
+ return delegate().isEnum();
+ }
+
+ @Deprecated
+ public WBMethod<?> getDeclaredMethod(Method method)
+ {
+ return delegate().getDeclaredMethod(method);
+ }
+
+ public <F> WBField<F> getDeclaredField(String fieldName, WBClass<F> expectedType)
+ {
+ return delegate().getDeclaredField(fieldName, expectedType);
+ }
+
+ public <M> WBMethod<M> getDeclaredMethod(MethodSignature signature, WBClass<M> expectedReturnType)
+ {
+ return delegate().getDeclaredMethod(signature, expectedReturnType);
+ }
+
+ public WBConstructor<T> getDeclaredConstructor(ConstructorSignature signature)
+ {
+ return delegate().getDeclaredConstructor(signature);
+ }
+
+ public <U> WBClass<? extends U> asSubclass(WBClass<U> clazz)
+ {
+ return delegate().asSubclass(clazz);
+ }
+
+ public <S> S cast(Object object)
+ {
+ return delegate().<S>cast(object);
+ }
+
+
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBClass.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBConstructor.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedConstructor.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBConstructor.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBConstructor.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
+
+public abstract class ForwardingWBConstructor<T> extends ForwardingWBMember<T, Constructor<T>> implements WBConstructor<T>
+{
+
+ @Override
+ protected abstract WBConstructor<T> delegate();
+
+ public List<WBParameter<?>> getAnnotatedParameters(Class<? extends Annotation> annotationType)
+ {
+ return delegate().getAnnotatedParameters(annotationType);
+ }
+
+ public WBType<T> getDeclaringClass()
+ {
+ return delegate().getDeclaringClass();
+ }
+
+ public List<? extends WBParameter<?>> getParameters()
+ {
+ return delegate().getParameters();
+ }
+
+ public T newInstance(Object... parameters) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
+ {
+ return delegate().newInstance(parameters);
+ }
+
+ public ConstructorSignature getSignature()
+ {
+ return delegate().getSignature();
+ }
+
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBConstructor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBField.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedField.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBField.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBField.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,57 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.reflect.Field;
+
+public abstract class ForwardingWBField<T> extends ForwardingWBMember<T, Field> implements WBField<T>
+{
+
+ @Override
+ protected abstract WBField<T> delegate();
+
+ public T get(Object instance)
+ {
+ return delegate().get(instance);
+ }
+
+ public Field getAnnotatedField()
+ {
+ return delegate().getAnnotatedField();
+ }
+
+ public WBType<?> getDeclaringClass()
+ {
+ return delegate().getDeclaringClass();
+ }
+
+ public String getPropertyName()
+ {
+ return delegate().getPropertyName();
+ }
+
+ public void set(Object declaringInstance, Object value) throws IllegalArgumentException, IllegalAccessException
+ {
+ delegate().set(declaringInstance, value);
+ }
+
+ public boolean isTransient()
+ {
+ return delegate().isTransient();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBField.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMember.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMember.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMember.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMember.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.reflect.Member;
+
+public abstract class ForwardingWBMember<T, S extends Member> extends ForwardingWBAnnotated<T, S> implements WBMember<T, S>
+{
+
+ @Override
+ protected abstract WBMember<T, S> delegate();
+
+ public S getMember()
+ {
+ return delegate().getMember();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMember.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMethod.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedMethod.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMethod.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMethod.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.List;
+
+public abstract class ForwardingWBMethod<T> extends ForwardingWBMember<T, Method> implements WBMethod<T>
+{
+
+ @Override
+ protected abstract WBMethod<T> delegate();
+
+ public Method getAnnotatedMethod()
+ {
+ return delegate().getAnnotatedMethod();
+ }
+
+ public List<WBParameter<?>> getAnnotatedParameters(Class<? extends Annotation> metaAnnotationType)
+ {
+ return delegate().getAnnotatedParameters(metaAnnotationType);
+ }
+
+ public WBType<?> getDeclaringClass()
+ {
+ return delegate().getDeclaringClass();
+ }
+
+ public Class<?>[] getParameterTypesAsArray()
+ {
+ return delegate().getParameterTypesAsArray();
+ }
+
+ public List<? extends WBParameter<?>> getParameters()
+ {
+ return delegate().getParameters();
+ }
+
+ public String getPropertyName()
+ {
+ return delegate().getPropertyName();
+ }
+
+ public T invoke(Object instance, Object... parameters) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
+ {
+ return delegate().invoke(instance, parameters);
+ }
+
+ public T invokeOnInstance(Object instance, Object... parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException
+ {
+ return delegate().invokeOnInstance(instance, parameters);
+ }
+
+ public boolean isEquivalent(Method method)
+ {
+ return delegate().isEquivalent(method);
+ }
+
+ public MethodSignature getSignature()
+ {
+ return delegate().getSignature();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBMethod.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBParameter.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedParameter.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBParameter.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBParameter.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,32 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+
+public abstract class ForwardingWBParameter<T> extends ForwardingWBAnnotated<T, Object> implements WBParameter<T>
+{
+
+ @Override
+ protected abstract WBParameter<T> delegate();
+
+ public WBMember<?, ?> getDeclaringMember()
+ {
+ return delegate().getDeclaringMember();
+ }
+
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBType.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedType.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBType.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBType.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,40 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+public abstract class ForwardingWBType<T> extends ForwardingWBAnnotated<T, Class<T>> implements WBType<T>
+{
+
+ @Override
+ protected abstract WBType<T> delegate();
+
+ public WBType<?> getSuperclass()
+ {
+ return delegate().getSuperclass();
+ }
+
+ public boolean isEquivalent(Class<?> clazz)
+ {
+ return delegate().isEquivalent(clazz);
+ }
+
+ public String getSimpleName()
+ {
+ return delegate().getSimpleName();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingWBType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java (from rev 2827, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotated.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,225 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.enterprise.context.ScopeType;
+import javax.enterprise.inject.BindingType;
+import javax.enterprise.inject.Stereotype;
+import javax.enterprise.inject.deployment.DeploymentType;
+
+/**
+ * AnnotatedItem provides a uniform access to the annotations on an annotated
+ * item defined either in Java or XML
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WBAnnotated<T, S>
+{
+
+// The set of meta-annotations to map
+ @SuppressWarnings("unchecked")
+ public static final Set<Class<? extends Annotation>> MAPPED_METAANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(BindingType.class, DeploymentType.class, Stereotype.class, ScopeType.class));
+
+ /**
+ * Gets all annotations on the item
+ *
+ * @return A set of annotations. Returns an empty set if there are no
+ * matches.
+ */
+ public <A extends Annotation> Set<A> getAnnotations();
+
+ /**
+ * Gets all annotations which are annotated with the given meta annotation
+ * type
+ *
+ * @param The meta annotation to match
+ * @return A set of matching meta-annotations. Returns an empty set if there
+ * are no matches.
+ */
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType);
+
+ /**
+ * Gets all annotations which are declared on this annotated item
+ * with the given meta annotation type
+ *
+ * @param The meta annotation to match
+ * @return A set of matching meta-annotations. Returns an empty set if there
+ * are no matches.
+ */
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType);
+
+ /**
+ * Gets all annotations which are annotated with the given meta annotation
+ * type
+ *
+ * @param The meta annotation to match
+ * @return An array of matching meta-annotations. Returns an empty array if
+ * there are no matches.
+ */
+ public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType);
+
+ /**
+ * Gets the binding types for this element
+ *
+ * @returns A set of binding types present on the type. Returns an empty set
+ * if there are no matches.
+ * @deprecated This reflection type should not know about JSR-299 binding types
+ */
+ @Deprecated
+ public Set<Annotation> getBindings();
+
+ /**
+ * Gets the binding types for this element
+ *
+ * @returns An array of binding types present on the type. Returns an empty
+ * array if there are no matches.
+ * @deprecated This reflection type should not know about JSR-299 binding types
+ */
+ @Deprecated
+ public Annotation[] getBindingsAsArray();
+
+ /**
+ * Gets an annotation for the annotation type specified.
+ *
+ * @param annotationType The annotation to match
+ * @return An annotation if found, null if the annotation wasn't present.
+ */
+ public <A extends Annotation> A getAnnotation(Class<A> annotationType);
+
+ /**
+ * Get the whole type hierarchy as a set of flattened types.
+ *
+ * The returned types should have any type parameters resolved to their
+ * actual types.
+ *
+ * @return the type hierarchy
+ */
+ public Set<Type> getFlattenedTypeHierarchy();
+
+ /**
+ * Get the type hierarchy of any interfaces implemented by this class.
+ *
+ * Interface hierarchies from super classes are not included.
+ *
+ * The returned types should have any type parameters resolved to their
+ * actual types.
+ *
+ * @return the type hierarchy
+ */
+ public Set<Type> getInterfaceOnlyFlattenedTypeHierarchy();
+
+ /**
+ * Indicates if an annotation type specified is present
+ *
+ * @param annotationType The annotation to match
+ * @return True if present, false if not
+ */
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType);
+
+ /**
+ * Indicates if an annotation type specified is present
+ *
+ * @param annotationType The annotation to match
+ * @return True if present, false if not
+ */
+ public boolean isDeclaredAnnotationPresent(Class<? extends Annotation> annotationType);
+
+ /**
+ * Gets the type of the element
+ *
+ * @return The type of the element
+ */
+ public Class<T> getRawType();
+
+ public Type getType();
+
+ /**
+ * Extends Java Class assignability such that actual type parameters are also
+ * considered
+ *
+ * @param that The other item to check assignability against
+ * @return True if assignable, false otherwise.
+ */
+ public boolean isAssignableFrom(WBAnnotated<?, ?> that);
+
+ /**
+ * Extends Java Class assignability such that actual type parameters are also
+ * considered
+ *
+ * @param type The type to compare against
+ * @param actualTypeArguments The type arguments
+ * @return True is assignable, false otherwise
+ */
+ public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments);
+
+ /**
+ * Gets the actual type arguments for any parameterized types that this
+ * AnnotatedItem represents.
+ *
+ * @return An array of type arguments
+ */
+ public Type[] getActualTypeArguments();
+
+ /**
+ * Indicates if this AnnotatedItem represents a static element
+ *
+ * @return True if static, false otherwise
+ */
+ public boolean isStatic();
+
+ /**
+ * Indicates if this AnnotatedItem represents a final element
+ * @return True if final, false otherwise
+ */
+ public boolean isFinal();
+
+ /**
+ * Indicates if this AnnotatedItem can be proxyed
+ *
+ * @return True if proxyable, false otherwise
+ */
+ public boolean isProxyable();
+
+ /**
+ * Indicates if this annotated item is public
+ *
+ * @return if public, returns true
+ */
+ public boolean isPublic();
+
+ /**
+ * Gets the name of this AnnotatedItem
+ *
+ * If it is not possible to determine the name of the underling element, a
+ * IllegalArgumentException is thrown
+ *
+ * @return The name
+ */
+ public String getName();
+
+ public AnnotationStore getAnnotationStore();
+
+ public boolean isParameterizedType();
+
+}
\ No newline at end of file
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotation.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedAnnotation.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotation.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotation.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+/**
+ * Represents a meta annotation
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WBAnnotation<T extends Annotation> extends WBType<T>
+{
+ /**
+ * Gets all members
+ *
+ * @return A set of abstracted members
+ */
+ public Set<WBMethod<?>> getMembers();
+
+ /**
+ * Gets all the members annotated with annotationType
+ *
+ * @param annotationType The annotation type to match
+ * @return A set of abstracted members with the annotation type
+ */
+ public Set<WBMethod<?>> getAnnotatedMembers(Class<? extends Annotation> annotationType);
+
+ /**
+ * Get an annotation member by name
+ *
+ * @param memberName
+ * @return
+ */
+ public <A> WBMethod<A> getMember(String memberName, WBClass<A> expectedType);
+
+ public Class<T> getRawType();
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBAnnotation.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBClass.java (from rev 2823, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedClass.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBClass.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBClass.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,203 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.Set;
+
+/**
+ * Represents a Class
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WBClass<T> extends WBType<T>
+{
+
+ /**
+ * Gets all fields on the type
+ *
+ * @return A set of abstracted fields
+ */
+ public Set<WBField<?>> getFields();
+
+ /**
+ * Get a field by name
+ *
+ * @param <F> the expected type of the field
+ * @param fieldName the field name
+ * @param expectedType the expected type of the field
+ * @return the field
+ */
+ public <F> WBField<F> getDeclaredField(String fieldName, WBClass<F> expectedType);
+
+ /**
+ * Gets all fields which are annotated with the given annotation type on this
+ * class and all super classes
+ *
+ * @param annotationType The annotation to match
+ * @return A set of abstracted fields with the given annotation. Returns an
+ * empty set if there are no matches
+ */
+ public Set<WBField<?>> getAnnotatedFields(Class<? extends Annotation> annotationType);
+
+ /**
+ * Gets all fields which are annotated with the given annotation type on this
+ * class only.
+ *
+ * @param annotationType The annotation to match
+ * @return A set of abstracted fields with the given annotation. Returns an
+ * empty set if there are no matches
+ */
+ public Set<WBField<?>> getDeclaredAnnotatedFields(Class<? extends Annotation> annotationType);
+
+ /**
+ * Gets all fields which are meta-annotated with metaAnnotationType
+ *
+ * @param metaAnnotationType The meta annotation to match
+ * @return A set of abstracted fields with the given meta-annotation. Returns
+ * an empty set if there are no matches
+ */
+ public Set<WBField<?>> getMetaAnnotatedFields(Class<? extends Annotation> metaAnnotationType);
+
+ /**
+ * Gets all constructors which are annotated with annotationType
+ *
+ * @param annotationType The annotation type to match
+ * @return A set of abstracted fields with the given annotation. Returns an
+ * empty set if there are no matches
+ */
+ public Set<WBConstructor<T>> getAnnotatedConstructors(Class<? extends Annotation> annotationType);
+
+ /**
+ * Gets all constructors
+ *
+ * @return A set of abstracted constructors
+ */
+ public Set<WBConstructor<T>> getConstructors();
+
+ /**
+ * Gets the no-args constructor
+ *
+ * @return The no-args constructor, or null if not defined
+ */
+ public WBConstructor<T> getNoArgsConstructor();
+
+ /**
+ * Get the constructor which matches the argument list provided
+ *
+ * @param parameterTypes the parameters of the constructor
+ * @return the matching constructor, or null if not defined
+ */
+ public WBConstructor<T> getDeclaredConstructor(ConstructorSignature signature);
+
+ /**
+ * Gets all methods annotated with annotationType
+ *
+ * @param annotationType The annotation to match
+ * @return A set of abstracted methods with the given annotation. Returns an
+ * empty set if there are no matches
+ */
+ public Set<WBMethod<?>> getAnnotatedMethods(Class<? extends Annotation> annotationType);
+
+ /**
+ * Gets all methods annotated with annotationType
+ *
+ * @param annotationType The annotation to match
+ * @return A set of abstracted methods with the given annotation. Returns an
+ * empty set if there are no matches
+ */
+ public Set<WBMethod<?>> getDeclaredAnnotatedMethods(Class<? extends Annotation> annotationType);
+
+ /**
+ * Find the annotated method for a given methodDescriptor
+ *
+ * @param methodDescriptor
+ * @return
+ *
+ * TODO Replace with AnnotatedMethod variant
+ */
+ @Deprecated
+ public WBMethod<?> getMethod(Method method);
+
+ /**
+ * Get a method by name
+ *
+ * @param <M> the expected return type
+ * @param signature the name of the method
+ * @param expectedReturnType the expected return type
+ * @return the method, or null if it doesn't exist
+ */
+ public <M> WBMethod<M> getDeclaredMethod(MethodSignature signature, WBClass<M> expectedReturnType);
+
+ // TODO Replace with AnnotatedMethod variant
+ @Deprecated
+ public WBMethod<?> getDeclaredMethod(Method method);
+
+ /**
+ * Gets all with parameters annotated with annotationType
+ *
+ * @param annotationType The annotation to match
+ * @return A set of abstracted methods with the given annotation. Returns an
+ * empty set if there are no matches
+ */
+ public Set<WBMethod<?>> getMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType);
+
+ /**
+ * Gets all with constructors annotated with annotationType
+ *
+ * @param annotationType The annotation to match
+ * @return A set of abstracted constructors with the given annotation. Returns an
+ * empty set if there are no matches
+ */
+ public Set<WBConstructor<?>> getConstructorsWithAnnotatedParameters(Class<? extends Annotation> annotationType);
+
+ /**
+ * Gets all with parameters annotated with annotationType
+ *
+ * @param annotationType The annotation to match
+ * @return A set of abstracted methods with the given annotation. Returns an
+ * empty set if there are no matches
+ */
+ public Set<WBMethod<?>> getDeclaredMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType);
+
+ /**
+ * Gets the superclass.
+ *
+ * @return The abstracted superclass, null if there is no superclass
+ */
+ public WBClass<?> getSuperclass();
+
+ /**
+ * Determine if this is a non-static member class
+ *
+ * @return true if this is a non-static member
+ */
+ public boolean isNonStaticMemberClass();
+
+ public boolean isParameterizedType();
+
+ public boolean isAbstract();
+
+ public boolean isEnum();
+
+ public <S> S cast(Object object);
+
+ public <U> WBClass<? extends U> asSubclass(WBClass<U> clazz);
+
+}
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBClass.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBConstructor.java (from rev 2823, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedConstructor.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBConstructor.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBConstructor.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.decorator.Decorates;
+
+/**
+ * Represents a Class Constructor
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WBConstructor<T> extends WBMember<T, Constructor<T>>
+{
+
+ @SuppressWarnings("unchecked")
+ public static final Set<Class<? extends Annotation>> MAPPED_PARAMETER_ANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(Decorates.class));
+
+ /**
+ * Gets all parameters to the constructor
+ *
+ * @return A set of abstracted parameters. Returns an empty set if there are
+ * no parameters
+ */
+ public List<? extends WBParameter<?>> getParameters();
+
+ /**
+ * Gets all parameters to the constructor which are annotated with
+ * annotationType
+ *
+ * @param annotationType A annotation to match
+ * @return A list of abstracted parameters with the given annotation type.
+ * Returns an empty set if there are no matches.
+ */
+ public List<WBParameter<?>> getAnnotatedParameters(Class<? extends Annotation> annotationType);
+
+ /**
+ * Creates a new instance of the class, using this constructor
+ *
+ * @return The created instance
+ */
+ public T newInstance(Object... parameters) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException;
+
+ /**
+ * Gets the declaring class of the annotation
+ *
+ * @return An abstraction of the declaring class
+ */
+ public WBType<T> getDeclaringClass();
+
+ public ConstructorSignature getSignature();
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBConstructor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBField.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedField.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBField.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBField.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,65 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.reflect.Field;
+
+/**
+ * AnnotatedField provides a uniform access to the annotations on an annotated
+ * field
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WBField<T> extends WBMember<T, Field>
+{
+
+ /**
+ * Gets the annotated field
+ *
+ * @return The annotated field
+ */
+ public Field getAnnotatedField();
+
+ /**
+ * Injects an instance
+ *
+ *
+ * @param declaringInstance The instance to inject into
+ * @param value The value to inject
+ */
+ public void set(Object declaringInstance, Object value) throws IllegalArgumentException, IllegalAccessException;
+
+ public T get(Object instance);
+
+ /**
+ * Gets an abstraction of the declaring class
+ *
+ * @return The declaring class
+ */
+ public WBType<?> getDeclaringClass();
+
+ /**
+ * Gets the property name of the field
+ *
+ * @return The name
+ */
+ public String getPropertyName();
+
+ public boolean isTransient();
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBField.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMember.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMember.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMember.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMember.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,38 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.reflect.Member;
+/**
+ * AnnotedMember provides enhanced access to an annotated member
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WBMember<T, S extends Member> extends WBAnnotated<T, S>
+{
+
+ public S getMember();
+
+ /**
+ * Gets an abstraction of the declaring class
+ *
+ * @return The declaring class
+ */
+ public WBType<?> getDeclaringClass();
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMember.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMethod.java (from rev 2823, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedMethod.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMethod.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMethod.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.enterprise.inject.Disposes;
+import javax.event.AfterTransactionCompletion;
+import javax.event.AfterTransactionFailure;
+import javax.event.AfterTransactionSuccess;
+import javax.event.Asynchronously;
+import javax.event.BeforeTransactionCompletion;
+import javax.event.IfExists;
+import javax.event.Observes;
+
+/**
+ * AnnotatedType provides a uniform access to the annotations on an annotated
+ * class defined either in Java or XML
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WBMethod<T> extends WBMember<T, Method>
+{
+ @SuppressWarnings("unchecked")
+ public static final Set<Class<? extends Annotation>> MAPPED_PARAMETER_ANNOTATIONS = new HashSet<Class<? extends Annotation>>(Arrays.asList(Disposes.class, Observes.class, IfExists.class, BeforeTransactionCompletion.class, AfterTransactionCompletion.class, AfterTransactionFailure.class, AfterTransactionSuccess.class, Asynchronously.class, Disposes.class));
+
+ /**
+ * Gets the abstracted parameters of the method
+ *
+ * @return A list of parameters. Returns an empty list if no parameters are
+ * present.
+ */
+ public List<? extends WBParameter<?>> getParameters();
+
+ /**
+ * Gets the list of annotated parameters for a given annotation
+ *
+ * @param metaAnnotationType The annotation to match
+ * @return A set of matching parameter abstractions. Returns an empty list if
+ * there are no matches.
+ */
+ public List<WBParameter<?>> getAnnotatedParameters(Class<? extends Annotation> metaAnnotationType);
+
+ /**
+ * Get the parameter types as an array
+ */
+ public Class<?>[] getParameterTypesAsArray();
+
+ /**
+ * Invokes the method
+ *
+ * @param instance The instance to invoke
+ * @param parameters The method parameters
+ * @return A reference to the instance
+ */
+ public T invoke(Object instance, Object... parameters) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException;
+
+ /**
+ * Invokes the method on the class of the passed instance, not the declaring
+ * class. Useful with proxies
+ *
+ * @param instance The instance to invoke
+ * @param manager The Web Beans manager
+ * @return A reference to the instance
+ */
+ public T invokeOnInstance(Object instance, Object... parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException;
+
+ /**
+ * Gets the declaring class
+ *
+ * @return An abstraction of the declaring class
+ */
+ public WBType<?> getDeclaringClass();
+
+ /**
+ * Gets the property name
+ *
+ * @return The name
+ */
+ public String getPropertyName();
+
+ /**
+ * Checks if a this is equivalent to a JLR method
+ *
+ * @param method The JLR method
+ * @return true if equivalent
+ */
+ public boolean isEquivalent(Method method);
+
+ public Method getAnnotatedMethod();
+
+ public MethodSignature getSignature();
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBMethod.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBParameter.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedParameter.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBParameter.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBParameter.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+
+
+/**
+ * AnnotatedParameter provides a uniform access to a method parameter defined
+ * either in Java or XML
+ *
+ * @author Pete Muir
+ * @param <T>
+ */
+public interface WBParameter<T> extends WBAnnotated<T, Object>
+{
+
+ public WBMember<?, ?> getDeclaringMember();
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBType.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedType.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBType.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WBType.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+
+/**
+ * AnnotatedType provides a uniform access to a type defined either in Java or
+ * XML
+ *
+ * @author Pete Muir
+ * @param <T>
+ */
+public interface WBType<T> extends WBAnnotated<T, Class<T>>
+{
+
+ /**
+ * Gets the superclass of the type
+ *
+ * @return The abstracted superclass
+ */
+ public WBType<?> getSuperclass();
+
+ /**
+ * Check if this is equivalent to a java class
+ * @param clazz The Java class
+ * @return true if equivalent
+ */
+ public boolean isEquivalent(Class<?> clazz);
+
+ public String getSimpleName();
+
+}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedClass.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedClass.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,88 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector;
-
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
-public class WrappedAnnotatedClass<T> extends ForwardingAnnotatedClass<T>
-{
-
- private final AnnotatedClass<T> delegate;
- private AnnotationStore annotationStore;
-
- public WrappedAnnotatedClass(AnnotatedClass<T> clazz, Set<Annotation> extraAnnotations, Set<Annotation> extraDeclaredAnnotations)
- {
- this.delegate = clazz;
- this.annotationStore = AnnotationStore.wrap(clazz.getAnnotationStore(), extraAnnotations, extraDeclaredAnnotations);
- }
-
- @Override
- protected AnnotatedClass<T> delegate()
- {
- return delegate;
- }
-
- @Override
- public AnnotationStore getAnnotationStore()
- {
- return annotationStore;
- }
-
- public <A extends Annotation> A getAnnotation(Class<A> annotationType)
- {
- return getAnnotationStore().getAnnotation(annotationType);
- }
-
- public Set<Annotation> getAnnotations()
- {
- return getAnnotationStore().getAnnotations();
- }
-
- public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return getAnnotationStore().getMetaAnnotations(metaAnnotationType);
- }
-
- public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
- {
- return getAnnotationStore().getMetaAnnotationsAsArray(metaAnnotationType);
- }
-
- @Deprecated
- public Set<Annotation> getBindings()
- {
- return getAnnotationStore().getBindings();
- }
-
- @Deprecated
- public Annotation[] getBindingsAsArray()
- {
- return getAnnotationStore().getBindingsAsArray();
- }
-
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
- {
- return getAnnotationStore().isAnnotationPresent(annotationType);
- }
-
- public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return getAnnotationStore().getDeclaredMetaAnnotations(metaAnnotationType);
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,107 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */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;
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public <A extends Annotation> A getAnnotation(Class<A> annotationType)
- {
- return getAnnotationStore().getAnnotation(annotationType);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public Set<Annotation> getAnnotations()
- {
- return getAnnotationStore().getAnnotations();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return getAnnotationStore().getMetaAnnotations(metaAnnotationType);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
- {
- return getAnnotationStore().getMetaAnnotationsAsArray(metaAnnotationType);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- @Deprecated
- public Set<Annotation> getBindings()
- {
- return getAnnotationStore().getBindings();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- @Deprecated
- public Annotation[] getBindingsAsArray()
- {
- return getAnnotationStore().getBindingsAsArray();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
- {
- return getAnnotationStore().isAnnotationPresent(annotationType);
- }
-
- public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return getAnnotationStore().getDeclaredMetaAnnotations(metaAnnotationType);
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,109 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-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;
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public <A extends Annotation> A getAnnotation(Class<A> annotationType)
- {
- return getAnnotationStore().getAnnotation(annotationType);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public Set<Annotation> getAnnotations()
- {
- return getAnnotationStore().getAnnotations();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return getAnnotationStore().getMetaAnnotations(metaAnnotationType);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
- {
- return getAnnotationStore().getMetaAnnotationsAsArray(metaAnnotationType);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- @Deprecated
- public Set<Annotation> getBindings()
- {
- return getAnnotationStore().getBindings();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- @Deprecated
- public Annotation[] getBindingsAsArray()
- {
- return getAnnotationStore().getBindingsAsArray();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
- {
- return getAnnotationStore().isAnnotationPresent(annotationType);
- }
-
- public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return getAnnotationStore().getDeclaredMetaAnnotations(metaAnnotationType);
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,114 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-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;
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public <A extends Annotation> A getAnnotation(Class<A> annotationType)
- {
- return getAnnotationStore().getAnnotation(annotationType);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public Set<Annotation> getAnnotations()
- {
- return getAnnotationStore().getAnnotations();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return getAnnotationStore().getMetaAnnotations(metaAnnotationType);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
- {
- return getAnnotationStore().getMetaAnnotationsAsArray(metaAnnotationType);
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- @Deprecated
- public Set<Annotation> getBindings()
- {
- return getAnnotationStore().getBindings();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- @Deprecated
- public Annotation[] getBindingsAsArray()
- {
- return getAnnotationStore().getBindingsAsArray();
- }
-
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
- {
- return getAnnotationStore().isAnnotationPresent(annotationType);
- }
-
- public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return getAnnotationStore().getDeclaredMetaAnnotations(metaAnnotationType);
- }
-
-}
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBClass.java (from rev 2827, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedClass.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBClass.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBClass.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+public class WrappedWBClass<T> extends ForwardingWBClass<T>
+{
+
+ private final WBClass<T> delegate;
+ private AnnotationStore annotationStore;
+
+ public WrappedWBClass(WBClass<T> clazz, Set<Annotation> extraAnnotations, Set<Annotation> extraDeclaredAnnotations)
+ {
+ this.delegate = clazz;
+ this.annotationStore = AnnotationStore.wrap(clazz.getAnnotationStore(), extraAnnotations, extraDeclaredAnnotations);
+ }
+
+ @Override
+ protected WBClass<T> delegate()
+ {
+ return delegate;
+ }
+
+ @Override
+ public AnnotationStore getAnnotationStore()
+ {
+ return annotationStore;
+ }
+
+ public <A extends Annotation> A getAnnotation(Class<A> annotationType)
+ {
+ return getAnnotationStore().getAnnotation(annotationType);
+ }
+
+ public Set<Annotation> getAnnotations()
+ {
+ return getAnnotationStore().getAnnotations();
+ }
+
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getAnnotationStore().getMetaAnnotations(metaAnnotationType);
+ }
+
+ public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getAnnotationStore().getMetaAnnotationsAsArray(metaAnnotationType);
+ }
+
+ @Deprecated
+ public Set<Annotation> getBindings()
+ {
+ return getAnnotationStore().getBindings();
+ }
+
+ @Deprecated
+ public Annotation[] getBindingsAsArray()
+ {
+ return getAnnotationStore().getBindingsAsArray();
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return getAnnotationStore().isAnnotationPresent(annotationType);
+ }
+
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getAnnotationStore().getDeclaredMetaAnnotations(metaAnnotationType);
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBClass.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBField.java (from rev 2827, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBField.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBField.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */package org.jboss.webbeans.introspector;
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+public class WrappedWBField<T> extends ForwardingWBField<T>
+{
+
+ private final WBField<T> delegate;
+ private AnnotationStore annotationStore;
+
+ public WrappedWBField(WBField<T> field, Set<Annotation> extraAnnotations)
+ {
+ this.delegate = field;
+ this.annotationStore = AnnotationStore.wrap(field.getAnnotationStore(), extraAnnotations, extraAnnotations);
+ }
+
+ @Override
+ protected WBField<T> delegate()
+ {
+ return delegate;
+ }
+
+ @Override
+ public AnnotationStore getAnnotationStore()
+ {
+ return annotationStore;
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public <A extends Annotation> A getAnnotation(Class<A> annotationType)
+ {
+ return getAnnotationStore().getAnnotation(annotationType);
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public Set<Annotation> getAnnotations()
+ {
+ return getAnnotationStore().getAnnotations();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getAnnotationStore().getMetaAnnotations(metaAnnotationType);
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getAnnotationStore().getMetaAnnotationsAsArray(metaAnnotationType);
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ @Deprecated
+ public Set<Annotation> getBindings()
+ {
+ return getAnnotationStore().getBindings();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ @Deprecated
+ public Annotation[] getBindingsAsArray()
+ {
+ return getAnnotationStore().getBindingsAsArray();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return getAnnotationStore().isAnnotationPresent(annotationType);
+ }
+
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getAnnotationStore().getDeclaredMetaAnnotations(metaAnnotationType);
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBField.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBMethod.java (from rev 2827, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBMethod.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBMethod.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,109 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+public class WrappedWBMethod<T> extends ForwardingWBMethod<T>
+{
+
+ private final WBMethod<T> delegate;
+ private AnnotationStore annotationStore;
+
+ public WrappedWBMethod(WBMethod<T> method, Set<Annotation> extraAnnotations)
+ {
+ this.delegate = method;
+ this.annotationStore = AnnotationStore.wrap(method.getAnnotationStore(), extraAnnotations, extraAnnotations);
+ }
+
+ @Override
+ protected WBMethod<T> delegate()
+ {
+ return delegate;
+ }
+
+ @Override
+ public AnnotationStore getAnnotationStore()
+ {
+ return annotationStore;
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public <A extends Annotation> A getAnnotation(Class<A> annotationType)
+ {
+ return getAnnotationStore().getAnnotation(annotationType);
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public Set<Annotation> getAnnotations()
+ {
+ return getAnnotationStore().getAnnotations();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getAnnotationStore().getMetaAnnotations(metaAnnotationType);
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getAnnotationStore().getMetaAnnotationsAsArray(metaAnnotationType);
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ @Deprecated
+ public Set<Annotation> getBindings()
+ {
+ return getAnnotationStore().getBindings();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ @Deprecated
+ public Annotation[] getBindingsAsArray()
+ {
+ return getAnnotationStore().getBindingsAsArray();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return getAnnotationStore().isAnnotationPresent(annotationType);
+ }
+
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getAnnotationStore().getDeclaredMetaAnnotations(metaAnnotationType);
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBMethod.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBParameter.java (from rev 2827, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBParameter.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBParameter.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,114 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+public class WrappedWBParameter<T> extends ForwardingWBParameter<T>
+{
+
+ public static <T> WrappedWBParameter<T> of(WBParameter<T> parameter, Set<Annotation> extraAnnotations)
+ {
+ return new WrappedWBParameter<T>(parameter, extraAnnotations);
+ }
+
+ private final WBParameter<T> delegate;
+ private AnnotationStore annotationStore;
+
+ public WrappedWBParameter(WBParameter<T> parameter, Set<Annotation> extraAnnotations)
+ {
+ this.delegate = parameter;
+ this.annotationStore = AnnotationStore.wrap(parameter.getAnnotationStore(), extraAnnotations, extraAnnotations);
+ }
+
+ @Override
+ protected WBParameter<T> delegate()
+ {
+ return delegate;
+ }
+
+ @Override
+ public AnnotationStore getAnnotationStore()
+ {
+ return annotationStore;
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public <A extends Annotation> A getAnnotation(Class<A> annotationType)
+ {
+ return getAnnotationStore().getAnnotation(annotationType);
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public Set<Annotation> getAnnotations()
+ {
+ return getAnnotationStore().getAnnotations();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getAnnotationStore().getMetaAnnotations(metaAnnotationType);
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getAnnotationStore().getMetaAnnotationsAsArray(metaAnnotationType);
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ @Deprecated
+ public Set<Annotation> getBindings()
+ {
+ return getAnnotationStore().getBindings();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ @Deprecated
+ public Annotation[] getBindingsAsArray()
+ {
+ return getAnnotationStore().getBindingsAsArray();
+ }
+
+ /**
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return getAnnotationStore().isAnnotationPresent(annotationType);
+ }
+
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getAnnotationStore().getDeclaredMetaAnnotations(metaAnnotationType);
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedWBParameter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,292 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector.jlr;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.ParameterizedType;
-import java.lang.reflect.Type;
-import java.util.Collections;
-import java.util.HashSet;
-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;
-
-/**
- * Represents functionality common for all annotated items, mainly different
- * mappings of the annotations and meta-annotations
- *
- * AbstractAnnotatedItem is an immutable class and therefore threadsafe
- *
- * @author Pete Muir
- * @author Nicklas Karlsson
- *
- * @param <T>
- * @param <S>
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
-public abstract class AbstractAnnotatedItem<T, S> implements AnnotatedItem<T, S>
-{
-
- interface WrappableAnnotatedItem<T, S> extends AnnotatedItem<T, S>
- {
-
- AnnotationStore getAnnotationStore();
-
- }
-
- // Cached string representation
- private String toString;
- private final AnnotationStore annotationStore;
- private final Class<T> rawType;
- private final Type[] actualTypeArguments;
- private final Type type;
- private final Set<Type> flattenedTypes;
- private final Set<Type> interfaceOnlyFlattenedTypes;
- private final boolean proxyable;
- private final boolean _parameterizedType;
-
- /**
- * 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
- *
- */
- public AbstractAnnotatedItem(AnnotationStore annotatedItemHelper, Class<T> rawType, Type type)
- {
- this.annotationStore = annotatedItemHelper;
- this.rawType = rawType;
- this.type = type;
- if (type instanceof ParameterizedType)
- {
- this.actualTypeArguments = ((ParameterizedType) type).getActualTypeArguments();
- }
- else
- {
- this.actualTypeArguments = new Type[0];
- }
- this._parameterizedType = Reflections.isParameterizedType(rawType);
- this.flattenedTypes = new Reflections.HierarchyDiscovery(type).getFlattenedTypes();
- this.interfaceOnlyFlattenedTypes = new HashSet<Type>();
- for (Type t : rawType.getGenericInterfaces())
- {
- interfaceOnlyFlattenedTypes.addAll(new Reflections.HierarchyDiscovery(t).getFlattenedTypes());
- }
- this.proxyable = Proxies.isTypesProxyable(flattenedTypes);
- }
-
- public AbstractAnnotatedItem(AnnotationStore annotatedItemHelper)
- {
- this.annotationStore = annotatedItemHelper;
- this.rawType = null;
- this.type = null;
- this.actualTypeArguments = new Type[0];
- this._parameterizedType = false;
- this.flattenedTypes = null;
- this.interfaceOnlyFlattenedTypes = null;
- this.proxyable = false;
- }
-
- public AnnotationStore getAnnotationStore()
- {
- return annotationStore;
- }
-
- public <A extends Annotation> A getAnnotation(Class<A> annotationType)
- {
- return getAnnotationStore().getAnnotation(annotationType);
- }
-
- public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return getAnnotationStore().getMetaAnnotations(metaAnnotationType);
- }
-
- public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
- {
- return getAnnotationStore().getDeclaredMetaAnnotations(metaAnnotationType);
- }
-
- public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
- {
- return getMetaAnnotations(metaAnnotationType).toArray(new Annotation[0]);
- }
-
- public Set<Annotation> getAnnotations()
- {
- return getAnnotationStore().getAnnotations();
- }
-
- /**
- * Checks if an annotation is present on the item
- *
- * @param annotatedType The annotation type to check for
- * @return True if present, false otherwise.
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#isAnnotationPresent(Class)
- */
- public boolean isAnnotationPresent(Class<? extends Annotation> annotatedType)
- {
- return getAnnotationStore().isAnnotationPresent(annotatedType);
- }
-
- /**
- * Compares two AbstractAnnotatedItems
- *
- * @param other The other item
- * @return True if equals, false otherwise
- */
- @Override
- public boolean equals(Object other)
- {
- if (other instanceof AnnotatedItem)
- {
- AnnotatedItem<?, ?> that = (AnnotatedItem<?, ?>) other;
- return this.getAnnotations().equals(that.getAnnotations()) && this.getRawType().equals(that.getRawType());
- }
- return false;
- }
-
- /**
- * Checks if this item is assignable from another annotated item (through
- * type and actual type arguments)
- *
- * @param that The other annotated item to check against
- * @return True if assignable, false otherwise
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#isAssignableFrom(AnnotatedItem)
- */
- public boolean isAssignableFrom(AnnotatedItem<?, ?> that)
- {
- return isAssignableFrom(that.getRawType(), that.getActualTypeArguments());
- }
-
- public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
- {
- return Reflections.isAssignableFrom(getRawType(), getActualTypeArguments(), type, actualTypeArguments);
- }
-
- public boolean isAssignableFrom(Type type)
- {
- return Reflections.isAssignableFrom(getType(), type);
- }
-
- /**
- * Gets the hash code of the actual type
- *
- * @return The hash code
- */
- @Override
- public int hashCode()
- {
- return getRawType().hashCode();
- }
-
- /**
- * Gets a string representation of the item
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- if (toString != null)
- {
- return toString;
- }
- toString = "Abstract annotated item " + getName();
- return toString;
- }
-
- @Deprecated
- public Set<Annotation> getBindings()
- {
- return getAnnotationStore().getBindings();
- }
-
- /**
- * Gets (as array) 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 An array of (binding type) annotations
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#getBindingsAsArray()
- */
- @Deprecated
- public Annotation[] getBindingsAsArray()
- {
- return getAnnotationStore().getBindingsAsArray();
- }
-
- /**
- * Indicates if the type is proxyable to a set of pre-defined rules
- *
- * @return True if proxyable, false otherwise.
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#isProxyable()
- */
- public boolean isProxyable()
- {
- return proxyable;
- }
-
- public Class<T> getRawType()
- {
- return rawType;
- }
-
- public Type getType()
- {
- return type;
- }
-
- public Type[] getActualTypeArguments()
- {
- return actualTypeArguments;
- }
-
- public Set<Type> getFlattenedTypeHierarchy()
- {
- return Collections.unmodifiableSet(flattenedTypes);
- }
-
- public Set<Type> getInterfaceOnlyFlattenedTypeHierarchy()
- {
- return Collections.unmodifiableSet(interfaceOnlyFlattenedTypes);
- }
-
- public abstract S getDelegate();
-
- public boolean isDeclaredAnnotationPresent(Class<? extends Annotation> annotationType)
- {
- return getAnnotationStore().isDeclaredAnnotationPresent(annotationType);
- }
-
- public boolean isParameterizedType()
- {
- return _parameterizedType;
- }
-
-}
\ No newline at end of file
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,144 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector.jlr;
-
-import java.lang.reflect.Member;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Type;
-
-import org.jboss.webbeans.introspector.AnnotatedMember;
-import org.jboss.webbeans.introspector.AnnotationStore;
-import org.jboss.webbeans.introspector.ForwardingAnnotatedMember;
-import org.jboss.webbeans.util.Reflections;
-
-/**
- * Represents an abstract annotated memeber (field, method or constructor)
- *
- * This class is immutable, and therefore threadsafe
- *
- * @author Pete Muir
- *
- * @param <T>
- * @param <S>
- */
-public abstract class AbstractAnnotatedMember<T, S extends Member> extends AbstractAnnotatedItem<T, S> implements AnnotatedMember<T, S>
-{
-
- static abstract class WrappableForwardingAnnotatedMember<T, S extends Member> extends ForwardingAnnotatedMember<T, S> implements WrappableAnnotatedItem<T, S>
- {
-
- }
-
- // The name of the member
- private final String name;
-
- // Cached string representation
- private String toString;
-
- private final boolean _public;
-
- /**
- * Constructor
- *
- * @param annotationMap The annotation map
- */
- protected AbstractAnnotatedMember(AnnotationStore annotatedItemHelper, Member member, Class<T> rawType, Type type)
- {
- super(annotatedItemHelper, rawType, type);
- name = member.getName();
- _public = Modifier.isPublic(member.getModifiers());
- }
-
- /**
- * Indicates if the member is static
- *
- * @return True if static, false otherwise
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#isStatic()
- */
- public boolean isStatic()
- {
- return Reflections.isStatic(getDelegate());
- }
-
- /**
- * Indicates if the member if final
- *
- * @return True if final, false otherwise
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#isFinal()
- */
- public boolean isFinal()
- {
- return Reflections.isFinal(getDelegate());
- }
-
- public boolean isTransient()
- {
- return Reflections.isTransient(getDelegate());
- }
-
- public boolean isPublic()
- {
- return _public;
- }
-
- /**
- * Gets the current value of the member
- *
- * @param beanManager The Web Beans manager
- * @return The current value
- *
- public T getValue(BeanManager beanManager)
- {
- return beanManager.getInstance(getRawType(), getMetaAnnotationsAsArray(BindingType.class));
- }*/
-
- /**
- * Gets the name of the member
- *
- * @returns The name
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#getName()
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Gets a string representation of the member
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- if (toString != null)
- {
- return toString;
- }
- toString = "Abstract annotated member " + getName();
- return toString;
- }
-
- public S getMember()
- {
- return getDelegate();
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,149 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector.jlr;
-
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Type;
-
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.AnnotatedType;
-import org.jboss.webbeans.introspector.AnnotationStore;
-import org.jboss.webbeans.resources.ClassTransformer;
-import org.jboss.webbeans.util.Reflections;
-
-/**
- * Represents an abstract annotated type
- *
- * This class is immutable, and therefore threadsafe
- *
- * @author Pete Muir
- *
- * @param <T>
- */
-public abstract class AbstractAnnotatedType<T> extends AbstractAnnotatedItem<T, Class<T>> implements AnnotatedType<T>
-{
-
- // The superclass abstraction of the type
- private final AnnotatedClass<?> superclass;
- // The name of the type
- private final String name;
-
- private final String _simpleName;
-
- // Cached string representation
- private String toString;
- private final boolean _public;
-
- /**
- * Constructor
- *
- * @param annotationMap The annotation map
- */
- public AbstractAnnotatedType(AnnotationStore annotatedItemHelper, Class<T> rawType, Type type, ClassTransformer classTransformer)
- {
- super(annotatedItemHelper, rawType, type);
- this.name = rawType.getName();
- this._simpleName = rawType.getSimpleName();
- if (rawType.getSuperclass() != null)
- {
- this.superclass = classTransformer.classForName(rawType.getSuperclass());
- }
- else
- {
- this.superclass = null;
- }
- this._public = Modifier.isFinal(rawType.getModifiers());
- }
-
- /**
- * Indicates if the type is static
- *
- * @return True if static, false otherwise
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#isStatic()
- */
- public boolean isStatic()
- {
- return Reflections.isStatic(getDelegate());
- }
-
- /**
- * Indicates if the type if final
- *
- * @return True if final, false otherwise
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#isFinal()
- */
- public boolean isFinal()
- {
- return Reflections.isFinal(getDelegate());
- }
-
- public boolean isPublic()
- {
- return _public;
- }
-
- /**
- * Gets the name of the type
- *
- * @returns The name
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#getName()
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Gets the superclass abstraction of the type
- *
- * @return The superclass abstraction
- */
- public AnnotatedClass<?> getSuperclass()
- {
- return superclass;
- }
-
- public boolean isEquivalent(Class<?> clazz)
- {
- return getDelegate().equals(clazz);
- }
-
- /**
- * Gets a string representation of the type
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- if (toString != null)
- {
- return toString;
- }
- toString = "Abstract annotated type " + getName();
- return toString;
- }
-
- public String getSimpleName()
- {
- return _simpleName;
- }
-
-}
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java (from rev 2827, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,292 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector.jlr;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.webbeans.introspector.WBAnnotated;
+import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.util.Proxies;
+import org.jboss.webbeans.util.Reflections;
+
+/**
+ * Represents functionality common for all annotated items, mainly different
+ * mappings of the annotations and meta-annotations
+ *
+ * AbstractAnnotatedItem is an immutable class and therefore threadsafe
+ *
+ * @author Pete Muir
+ * @author Nicklas Karlsson
+ *
+ * @param <T>
+ * @param <S>
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated
+ */
+public abstract class AbstractWBAnnotated<T, S> implements WBAnnotated<T, S>
+{
+
+ interface WrappableAnnotatedItem<T, S> extends WBAnnotated<T, S>
+ {
+
+ AnnotationStore getAnnotationStore();
+
+ }
+
+ // Cached string representation
+ private String toString;
+ private final AnnotationStore annotationStore;
+ private final Class<T> rawType;
+ private final Type[] actualTypeArguments;
+ private final Type type;
+ private final Set<Type> flattenedTypes;
+ private final Set<Type> interfaceOnlyFlattenedTypes;
+ private final boolean proxyable;
+ private final boolean _parameterizedType;
+
+ /**
+ * 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
+ *
+ */
+ public AbstractWBAnnotated(AnnotationStore annotatedItemHelper, Class<T> rawType, Type type)
+ {
+ this.annotationStore = annotatedItemHelper;
+ this.rawType = rawType;
+ this.type = type;
+ if (type instanceof ParameterizedType)
+ {
+ this.actualTypeArguments = ((ParameterizedType) type).getActualTypeArguments();
+ }
+ else
+ {
+ this.actualTypeArguments = new Type[0];
+ }
+ this._parameterizedType = Reflections.isParameterizedType(rawType);
+ this.flattenedTypes = new Reflections.HierarchyDiscovery(type).getFlattenedTypes();
+ this.interfaceOnlyFlattenedTypes = new HashSet<Type>();
+ for (Type t : rawType.getGenericInterfaces())
+ {
+ interfaceOnlyFlattenedTypes.addAll(new Reflections.HierarchyDiscovery(t).getFlattenedTypes());
+ }
+ this.proxyable = Proxies.isTypesProxyable(flattenedTypes);
+ }
+
+ public AbstractWBAnnotated(AnnotationStore annotatedItemHelper)
+ {
+ this.annotationStore = annotatedItemHelper;
+ this.rawType = null;
+ this.type = null;
+ this.actualTypeArguments = new Type[0];
+ this._parameterizedType = false;
+ this.flattenedTypes = null;
+ this.interfaceOnlyFlattenedTypes = null;
+ this.proxyable = false;
+ }
+
+ public AnnotationStore getAnnotationStore()
+ {
+ return annotationStore;
+ }
+
+ public <A extends Annotation> A getAnnotation(Class<A> annotationType)
+ {
+ return getAnnotationStore().getAnnotation(annotationType);
+ }
+
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getAnnotationStore().getMetaAnnotations(metaAnnotationType);
+ }
+
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getAnnotationStore().getDeclaredMetaAnnotations(metaAnnotationType);
+ }
+
+ public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation> metaAnnotationType)
+ {
+ return getMetaAnnotations(metaAnnotationType).toArray(new Annotation[0]);
+ }
+
+ public Set<Annotation> getAnnotations()
+ {
+ return getAnnotationStore().getAnnotations();
+ }
+
+ /**
+ * Checks if an annotation is present on the item
+ *
+ * @param annotatedType The annotation type to check for
+ * @return True if present, false otherwise.
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated#isAnnotationPresent(Class)
+ */
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotatedType)
+ {
+ return getAnnotationStore().isAnnotationPresent(annotatedType);
+ }
+
+ /**
+ * Compares two AbstractAnnotatedItems
+ *
+ * @param other The other item
+ * @return True if equals, false otherwise
+ */
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other instanceof WBAnnotated)
+ {
+ WBAnnotated<?, ?> that = (WBAnnotated<?, ?>) other;
+ return this.getAnnotations().equals(that.getAnnotations()) && this.getRawType().equals(that.getRawType());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if this item is assignable from another annotated item (through
+ * type and actual type arguments)
+ *
+ * @param that The other annotated item to check against
+ * @return True if assignable, false otherwise
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated#isAssignableFrom(WBAnnotated)
+ */
+ public boolean isAssignableFrom(WBAnnotated<?, ?> that)
+ {
+ return isAssignableFrom(that.getRawType(), that.getActualTypeArguments());
+ }
+
+ public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
+ {
+ return Reflections.isAssignableFrom(getRawType(), getActualTypeArguments(), type, actualTypeArguments);
+ }
+
+ public boolean isAssignableFrom(Type type)
+ {
+ return Reflections.isAssignableFrom(getType(), type);
+ }
+
+ /**
+ * Gets the hash code of the actual type
+ *
+ * @return The hash code
+ */
+ @Override
+ public int hashCode()
+ {
+ return getRawType().hashCode();
+ }
+
+ /**
+ * Gets a string representation of the item
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ if (toString != null)
+ {
+ return toString;
+ }
+ toString = "Abstract annotated item " + getName();
+ return toString;
+ }
+
+ @Deprecated
+ public Set<Annotation> getBindings()
+ {
+ return getAnnotationStore().getBindings();
+ }
+
+ /**
+ * Gets (as array) 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 An array of (binding type) annotations
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated#getBindingsAsArray()
+ */
+ @Deprecated
+ public Annotation[] getBindingsAsArray()
+ {
+ return getAnnotationStore().getBindingsAsArray();
+ }
+
+ /**
+ * Indicates if the type is proxyable to a set of pre-defined rules
+ *
+ * @return True if proxyable, false otherwise.
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated#isProxyable()
+ */
+ public boolean isProxyable()
+ {
+ return proxyable;
+ }
+
+ public Class<T> getRawType()
+ {
+ return rawType;
+ }
+
+ public Type getType()
+ {
+ return type;
+ }
+
+ public Type[] getActualTypeArguments()
+ {
+ return actualTypeArguments;
+ }
+
+ public Set<Type> getFlattenedTypeHierarchy()
+ {
+ return Collections.unmodifiableSet(flattenedTypes);
+ }
+
+ public Set<Type> getInterfaceOnlyFlattenedTypeHierarchy()
+ {
+ return Collections.unmodifiableSet(interfaceOnlyFlattenedTypes);
+ }
+
+ public abstract S getDelegate();
+
+ public boolean isDeclaredAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return getAnnotationStore().isDeclaredAnnotationPresent(annotationType);
+ }
+
+ public boolean isParameterizedType()
+ {
+ return _parameterizedType;
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBAnnotated.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBMember.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedMember.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBMember.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBMember.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,144 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector.jlr;
+
+import java.lang.reflect.Member;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Type;
+
+import org.jboss.webbeans.introspector.WBMember;
+import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.introspector.ForwardingWBMember;
+import org.jboss.webbeans.util.Reflections;
+
+/**
+ * Represents an abstract annotated memeber (field, method or constructor)
+ *
+ * This class is immutable, and therefore threadsafe
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ * @param <S>
+ */
+public abstract class AbstractWBMember<T, S extends Member> extends AbstractWBAnnotated<T, S> implements WBMember<T, S>
+{
+
+ static abstract class WrappableForwardingAnnotatedMember<T, S extends Member> extends ForwardingWBMember<T, S> implements WrappableAnnotatedItem<T, S>
+ {
+
+ }
+
+ // The name of the member
+ private final String name;
+
+ // Cached string representation
+ private String toString;
+
+ private final boolean _public;
+
+ /**
+ * Constructor
+ *
+ * @param annotationMap The annotation map
+ */
+ protected AbstractWBMember(AnnotationStore annotatedItemHelper, Member member, Class<T> rawType, Type type)
+ {
+ super(annotatedItemHelper, rawType, type);
+ name = member.getName();
+ _public = Modifier.isPublic(member.getModifiers());
+ }
+
+ /**
+ * Indicates if the member is static
+ *
+ * @return True if static, false otherwise
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated#isStatic()
+ */
+ public boolean isStatic()
+ {
+ return Reflections.isStatic(getDelegate());
+ }
+
+ /**
+ * Indicates if the member if final
+ *
+ * @return True if final, false otherwise
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated#isFinal()
+ */
+ public boolean isFinal()
+ {
+ return Reflections.isFinal(getDelegate());
+ }
+
+ public boolean isTransient()
+ {
+ return Reflections.isTransient(getDelegate());
+ }
+
+ public boolean isPublic()
+ {
+ return _public;
+ }
+
+ /**
+ * Gets the current value of the member
+ *
+ * @param beanManager The Web Beans manager
+ * @return The current value
+ *
+ public T getValue(BeanManager beanManager)
+ {
+ return beanManager.getInstance(getRawType(), getMetaAnnotationsAsArray(BindingType.class));
+ }*/
+
+ /**
+ * Gets the name of the member
+ *
+ * @returns The name
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated#getName()
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Gets a string representation of the member
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ if (toString != null)
+ {
+ return toString;
+ }
+ toString = "Abstract annotated member " + getName();
+ return toString;
+ }
+
+ public S getMember()
+ {
+ return getDelegate();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBMember.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBType.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedType.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBType.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBType.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,149 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector.jlr;
+
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Type;
+
+import org.jboss.webbeans.introspector.WBClass;
+import org.jboss.webbeans.introspector.WBType;
+import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.resources.ClassTransformer;
+import org.jboss.webbeans.util.Reflections;
+
+/**
+ * Represents an abstract annotated type
+ *
+ * This class is immutable, and therefore threadsafe
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public abstract class AbstractWBType<T> extends AbstractWBAnnotated<T, Class<T>> implements WBType<T>
+{
+
+ // The superclass abstraction of the type
+ private final WBClass<?> superclass;
+ // The name of the type
+ private final String name;
+
+ private final String _simpleName;
+
+ // Cached string representation
+ private String toString;
+ private final boolean _public;
+
+ /**
+ * Constructor
+ *
+ * @param annotationMap The annotation map
+ */
+ public AbstractWBType(AnnotationStore annotatedItemHelper, Class<T> rawType, Type type, ClassTransformer classTransformer)
+ {
+ super(annotatedItemHelper, rawType, type);
+ this.name = rawType.getName();
+ this._simpleName = rawType.getSimpleName();
+ if (rawType.getSuperclass() != null)
+ {
+ this.superclass = classTransformer.classForName(rawType.getSuperclass());
+ }
+ else
+ {
+ this.superclass = null;
+ }
+ this._public = Modifier.isFinal(rawType.getModifiers());
+ }
+
+ /**
+ * Indicates if the type is static
+ *
+ * @return True if static, false otherwise
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated#isStatic()
+ */
+ public boolean isStatic()
+ {
+ return Reflections.isStatic(getDelegate());
+ }
+
+ /**
+ * Indicates if the type if final
+ *
+ * @return True if final, false otherwise
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated#isFinal()
+ */
+ public boolean isFinal()
+ {
+ return Reflections.isFinal(getDelegate());
+ }
+
+ public boolean isPublic()
+ {
+ return _public;
+ }
+
+ /**
+ * Gets the name of the type
+ *
+ * @returns The name
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated#getName()
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Gets the superclass abstraction of the type
+ *
+ * @return The superclass abstraction
+ */
+ public WBClass<?> getSuperclass()
+ {
+ return superclass;
+ }
+
+ public boolean isEquivalent(Class<?> clazz)
+ {
+ return getDelegate().equals(clazz);
+ }
+
+ /**
+ * Gets a string representation of the type
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ if (toString != null)
+ {
+ return toString;
+ }
+ toString = "Abstract annotated type " + getName();
+ return toString;
+ }
+
+ public String getSimpleName()
+ {
+ return _simpleName;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractWBType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,149 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector.jlr;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.webbeans.introspector.AnnotatedAnnotation;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
-import org.jboss.webbeans.introspector.AnnotationStore;
-import org.jboss.webbeans.resources.ClassTransformer;
-import org.jboss.webbeans.util.collections.multi.SetHashMultiMap;
-import org.jboss.webbeans.util.collections.multi.SetMultiMap;
-
-/**
- * Represents an annotated annotation
- *
- * This class is immutable and therefore threadsafe
- *
- * @author Pete Muir
- *
- * @param <T>
- */
-public class AnnotatedAnnotationImpl<T extends Annotation> extends AbstractAnnotatedType<T> implements AnnotatedAnnotation<T>
-{
-
- // The annotated members map (annotation -> member with annotation)
- private final SetMultiMap<Class<? extends Annotation>, AnnotatedMethod<?>> annotatedMembers;
- // The implementation class of the annotation
- private final Class<T> clazz;
- // The set of abstracted members
- private final Set<AnnotatedMethod<?>> members;
-
- private final Map<String, AnnotatedMethod<?>> namedMembers;
-
- // Cached string representation
- private String toString;
-
- public static <A extends Annotation> AnnotatedAnnotation<A> of(Class<A> annotationType, ClassTransformer classTransformer)
- {
- return new AnnotatedAnnotationImpl<A>(annotationType, classTransformer);
- }
-
- /**
- * Constructor
- *
- * Initializes the superclass with the built annotation map
- *
- * @param annotationType The annotation type
- */
- protected AnnotatedAnnotationImpl(Class<T> annotationType, ClassTransformer classTransformer)
- {
- super(AnnotationStore.of(annotationType), annotationType, annotationType, classTransformer);
- this.clazz = annotationType;
- members = new HashSet<AnnotatedMethod<?>>();
- annotatedMembers = new SetHashMultiMap<Class<? extends Annotation>, AnnotatedMethod<?>>();
- this.namedMembers = new HashMap<String, AnnotatedMethod<?>>();
- for (Method member : clazz.getDeclaredMethods())
- {
- AnnotatedMethod<?> annotatedMethod = AnnotatedMethodImpl.of(member, this);
- members.add(annotatedMethod);
- for (Annotation annotation : annotatedMethod.getAnnotations())
- {
- annotatedMembers.put(annotation.annotationType(), annotatedMethod);
- }
- namedMembers.put(annotatedMethod.getName(), annotatedMethod);
- }
- }
-
- /**
- * Gets all members of the annotation
- *
- * Initializes the members first if they are null
- *
- * @return The set of abstracted members
- *
- * @see org.jboss.webbeans.introspector.AnnotatedAnnotation#getMembers()
- */
- public Set<AnnotatedMethod<?>> getMembers()
- {
- return Collections.unmodifiableSet(members);
- }
-
- /**
- * Returns the annotated members with a given annotation type
- *
- * If the annotated members are null, they are initialized first.
- *
- * @param annotationType The annotation type to match
- * @return The set of abstracted members with the given annotation type
- * present. An empty set is returned if no matches are found
- *
- * @see org.jboss.webbeans.introspector.AnnotatedAnnotation#getAnnotatedMembers(Class)
- */
- public Set<AnnotatedMethod<?>> getAnnotatedMembers(Class<? extends Annotation> annotationType)
- {
- return Collections.unmodifiableSet(annotatedMembers.get(annotationType));
- }
-
- public <A> AnnotatedMethod<A> getMember(String memberName, AnnotatedClass<A> expectedType)
- {
- return (AnnotatedMethod<A>) namedMembers.get(memberName);
- }
-
- /**
- * Gets a string representation of the annotation
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- if (toString != null)
- {
- return toString;
- }
- return toString;
- }
-
- public Class<T> getDelegate()
- {
- return clazz;
- }
-
- public AnnotatedAnnotation<T> wrap(Set<Annotation> annotations)
- {
- throw new UnsupportedOperationException();
- }
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,474 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector.jlr;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.webbeans.introspector.AnnotatedClass;
-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.introspector.ConstructorSignature;
-import org.jboss.webbeans.introspector.MethodSignature;
-import org.jboss.webbeans.resources.ClassTransformer;
-import org.jboss.webbeans.util.Names;
-import org.jboss.webbeans.util.Reflections;
-import org.jboss.webbeans.util.collections.multi.SetHashMultiMap;
-import org.jboss.webbeans.util.collections.multi.SetMultiMap;
-
-/**
- * Represents an annotated class
- *
- * This class is immutable, and therefore threadsafe
- *
- * @author Pete Muir
- *
- * @param <T>
- */
-public class AnnotatedClassImpl<T> extends AbstractAnnotatedType<T> implements AnnotatedClass<T>
-{
-
- private static List<Class<?>> NO_ARGUMENTS = Collections.emptyList();
-
- // The set of abstracted fields
- private final Set<AnnotatedField<?>> fields;
- // The map from annotation type to abstracted field with annotation
- private final SetMultiMap<Class<? extends Annotation>, AnnotatedField<?>> annotatedFields;
- // The map from annotation type to abstracted field with meta-annotation
- private final SetMultiMap<Class<? extends Annotation>, AnnotatedField<?>> metaAnnotatedFields;
-
- // The set of abstracted fields
- private final Set<AnnotatedField<?>> declaredFields;
- private final Map<String, AnnotatedField<?>> declaredFieldsByName;
- // The map from annotation type to abstracted field with annotation
- private final SetMultiMap<Class<? extends Annotation>, AnnotatedField<?>> declaredAnnotatedFields;
- // The map from annotation type to abstracted field with meta-annotation
- private final SetMultiMap<Class<? extends Annotation>, AnnotatedField<?>> declaredMetaAnnotatedFields;
-
- // The set of abstracted methods
- private final Set<AnnotatedMethod<?>> methods;
- private final Map<MethodSignature, AnnotatedMethod<?>> declaredMethodsBySignature;
- // The map from annotation type to abstracted method with annotation
- private final SetMultiMap<Class<? extends Annotation>, AnnotatedMethod<?>> annotatedMethods;
- // The map from annotation type to method with a parameter with annotation
- private final SetMultiMap<Class<? extends Annotation>, AnnotatedMethod<?>> methodsByAnnotatedParameters;
-
- // The set of abstracted methods
- private final Set<AnnotatedMethod<?>> declaredMethods;
- // The map from annotation type to abstracted method with annotation
- private final SetMultiMap<Class<? extends Annotation>, AnnotatedMethod<?>> declaredAnnotatedMethods;
- // The map from annotation type to method with a parameter with annotation
- private final SetMultiMap<Class<? extends Annotation>, AnnotatedMethod<?>> declaredMethodsByAnnotatedParameters;
-
- // The set of abstracted constructors
- private final Set<AnnotatedConstructor<T>> constructors;
- private final Map<ConstructorSignature, AnnotatedConstructor<?>> declaredConstructorsBySignature;
- // The map from annotation type to abstracted constructor with annotation
- private final SetMultiMap<Class<? extends Annotation>, AnnotatedConstructor<T>> annotatedConstructors;
- // The map from class list to abstracted constructor
- private final Map<List<Class<?>>, AnnotatedConstructor<T>> constructorsByArgumentMap;
-
- private final SetMultiMap<Class<? extends Annotation>, AnnotatedConstructor<?>> constructorsByAnnotatedParameters;
-
- // Cached string representation
- private String toString;
-
- private final boolean _nonStaticMemberClass;
- private final boolean _abstract;
- private final boolean _enum;
-
-
- public static <T> AnnotatedClass<T> of(Class<T> clazz, ClassTransformer classTransformer)
- {
- return new AnnotatedClassImpl<T>(clazz, clazz, clazz.getAnnotations(), clazz.getDeclaredAnnotations(), classTransformer);
- }
-
- private AnnotatedClassImpl(Class<T> rawType, Type type, Annotation[] annotations, Annotation[] declaredAnnotations, ClassTransformer classTransformer)
- {
- super(AnnotationStore.of(annotations, declaredAnnotations), rawType, type, classTransformer);
-
- this.fields = new HashSet<AnnotatedField<?>>();
- this.annotatedFields = new SetHashMultiMap<Class<? extends Annotation>, AnnotatedField<?>>();
- this.metaAnnotatedFields = new SetHashMultiMap<Class<? extends Annotation>, AnnotatedField<?>>();
- this.declaredFields = new HashSet<AnnotatedField<?>>();
- this.declaredFieldsByName = new HashMap<String, AnnotatedField<?>>();
- this.declaredAnnotatedFields = new SetHashMultiMap<Class<? extends Annotation>, AnnotatedField<?>>();
- this.declaredMetaAnnotatedFields = new SetHashMultiMap<Class<? extends Annotation>, AnnotatedField<?>>();
- this._nonStaticMemberClass = Reflections.isNonStaticInnerClass(rawType);
- this._abstract = Reflections.isAbstract(rawType);
- this._enum = rawType.isEnum();
- for (Class<?> c = rawType; c != Object.class && c != null; c = c.getSuperclass())
- {
- for (Field field : c.getDeclaredFields())
- {
- if (!field.isAccessible())
- {
- field.setAccessible(true);
- }
- AnnotatedField<?> annotatedField = new AnnotatedFieldImpl<Object>(field, this);
- this.fields.add(annotatedField);
- if (c == rawType)
- {
- this.declaredFields.add(annotatedField);
- this.declaredFieldsByName.put(annotatedField.getName(), annotatedField);
- }
- for (Annotation annotation : annotatedField.getAnnotations())
- {
- this.annotatedFields.put(annotation.annotationType(), annotatedField);
- if (c == rawType)
- {
- this.declaredAnnotatedFields.put(annotation.annotationType(), annotatedField);
- }
- for (Annotation metaAnnotation : annotation.annotationType().getAnnotations())
- {
- this.metaAnnotatedFields.put(metaAnnotation.annotationType(), annotatedField);
- if (c == rawType)
- {
- this.declaredMetaAnnotatedFields.put(metaAnnotation.annotationType(), annotatedField);
- }
- }
- }
-
- }
- }
-
- this.constructors = new HashSet<AnnotatedConstructor<T>>();
- this.constructorsByArgumentMap = new HashMap<List<Class<?>>, AnnotatedConstructor<T>>();
- this.annotatedConstructors = new SetHashMultiMap<Class<? extends Annotation>, AnnotatedConstructor<T>>();
- this.constructorsByAnnotatedParameters = new SetHashMultiMap<Class<? extends Annotation>, AnnotatedConstructor<?>>();
- this.declaredConstructorsBySignature = new HashMap<ConstructorSignature, AnnotatedConstructor<?>>();
- for (Constructor<?> constructor : rawType.getDeclaredConstructors())
- {
- @SuppressWarnings("unchecked")
- Constructor<T> c = (Constructor<T>) constructor;
- AnnotatedConstructor<T> annotatedConstructor = AnnotatedConstructorImpl.of(c, this);
- if (!constructor.isAccessible())
- {
- constructor.setAccessible(true);
- }
- this.constructors.add(annotatedConstructor);
- this.constructorsByArgumentMap.put(Arrays.asList(constructor.getParameterTypes()), annotatedConstructor);
-
- this.declaredConstructorsBySignature.put(annotatedConstructor.getSignature(), annotatedConstructor);
-
- for (Annotation annotation : annotatedConstructor.getAnnotations())
- {
- if (!annotatedConstructors.containsKey(annotation.annotationType()))
- {
- annotatedConstructors.put(annotation.annotationType(), new HashSet<AnnotatedConstructor<T>>());
- }
- annotatedConstructors.get(annotation.annotationType()).add(annotatedConstructor);
- }
-
- for (Class<? extends Annotation> annotationType : AnnotatedConstructor.MAPPED_PARAMETER_ANNOTATIONS)
- {
- if (annotatedConstructor.getAnnotatedParameters(annotationType).size() > 0)
- {
- constructorsByAnnotatedParameters.put(annotationType, annotatedConstructor);
- }
- }
- }
-
- this.methods = new HashSet<AnnotatedMethod<?>>();
- this.annotatedMethods = new SetHashMultiMap<Class<? extends Annotation>, AnnotatedMethod<?>>();
- this.methodsByAnnotatedParameters = new SetHashMultiMap<Class<? extends Annotation>, AnnotatedMethod<?>>();
- this.declaredMethods = new HashSet<AnnotatedMethod<?>>();
- this.declaredAnnotatedMethods = new SetHashMultiMap<Class<? extends Annotation>, AnnotatedMethod<?>>();
- this.declaredMethodsByAnnotatedParameters = new SetHashMultiMap<Class<? extends Annotation>, AnnotatedMethod<?>>();
- this.declaredMethodsBySignature = new HashMap<MethodSignature, AnnotatedMethod<?>>();
- for (Class<?> c = rawType; c != Object.class && c != null; c = c.getSuperclass())
- {
- for (Method method : c.getDeclaredMethods())
- {
- if (!method.isAccessible())
- {
- method.setAccessible(true);
- }
-
- AnnotatedMethod<?> annotatedMethod = AnnotatedMethodImpl.of(method, this);
- this.methods.add(annotatedMethod);
- if (c == rawType)
- {
- this.declaredMethods.add(annotatedMethod);
- this.declaredMethodsBySignature.put(annotatedMethod.getSignature(), annotatedMethod);
- }
- for (Annotation annotation : annotatedMethod.getAnnotations())
- {
- annotatedMethods.put(annotation.annotationType(), annotatedMethod);
- if (c == rawType)
- {
- this.declaredAnnotatedMethods.put(annotation.annotationType(), annotatedMethod);
- }
- }
- for (Class<? extends Annotation> annotationType : AnnotatedMethod.MAPPED_PARAMETER_ANNOTATIONS)
- {
- if (annotatedMethod.getAnnotatedParameters(annotationType).size() > 0)
- {
- methodsByAnnotatedParameters.put(annotationType, annotatedMethod);
- if (c == rawType)
- {
- this.declaredMethodsByAnnotatedParameters.put(annotationType, annotatedMethod);
- }
- }
- }
- }
- }
- }
-
- /**
- * Gets the implementing class
- *
- * @return The class
- */
- public Class<? extends T> getAnnotatedClass()
- {
- return getRawType();
- }
-
- /**
- * Gets the delegate (class)
- *
- * @return The class
- */
- public Class<T> getDelegate()
- {
- return getRawType();
- }
-
- /**
- * Gets the abstracted fields of the class
- *
- * Initializes the fields if they are null
- *
- * @return The set of abstracted fields
- */
- public Set<AnnotatedField<?>> getFields()
- {
- return Collections.unmodifiableSet(fields);
- }
-
- public Set<AnnotatedField<?>> getDeclaredFields()
- {
- return Collections.unmodifiableSet(declaredFields);
- }
-
- public <F> AnnotatedField<F> getDeclaredField(String fieldName, AnnotatedClass<F> expectedType)
- {
- return (AnnotatedField<F>) declaredFieldsByName.get(fieldName);
- }
-
- public Set<AnnotatedField<?>> getDeclaredAnnotatedFields(Class<? extends Annotation> annotationType)
- {
- return Collections.unmodifiableSet(declaredAnnotatedFields.get(annotationType));
- }
-
- /**
- * Gets the abstracted constructors of the class
- *
- * Initializes the constructors if they are null
- *
- * @return The set of abstracted constructors
- */
- public Set<AnnotatedConstructor<T>> getConstructors()
- {
- return Collections.unmodifiableSet(constructors);
- }
-
- public AnnotatedConstructor<T> getDeclaredConstructor(ConstructorSignature signature)
- {
- return (AnnotatedConstructor<T>) declaredConstructorsBySignature.get(signature);
- }
-
- /**
- * Gets abstracted fields with requested meta-annotation type present
- *
- * If the meta-annotations map is null, it is initializes. If the annotated
- * fields are null, it is initialized The meta-annotated field map is then
- * populated for the requested meta-annotation type and the result is
- * returned
- *
- * @param metaAnnotationType
- * The meta-annotation type to match
- * @return The set of abstracted fields with meta-annotation present. Returns
- * an empty set if no matches are found.
- */
- public Set<AnnotatedField<?>> getMetaAnnotatedFields(Class<? extends Annotation> metaAnnotationType)
- {
- return Collections.unmodifiableSet(metaAnnotatedFields.get(metaAnnotationType));
- }
-
- /**
- * Gets the abstracted field annotated with a specific annotation type
- *
- * If the fields map is null, initialize it first
- *
- * @param annotationType
- * The annotation type to match
- * @return A set of matching abstracted fields, null if none are found.
- *
- */
- public Set<AnnotatedField<?>> getAnnotatedFields(Class<? extends Annotation> annotationType)
- {
- return Collections.unmodifiableSet(annotatedFields.get(annotationType));
- }
-
- public boolean isNonStaticMemberClass()
- {
- return _nonStaticMemberClass;
- }
-
- public boolean isAbstract()
- {
- return _abstract;
- }
-
- public boolean isEnum()
- {
- return _enum;
- }
-
- /**
- * Gets the abstracted methods that have a certain annotation type present
- *
- * If the annotated methods map is null, initialize it first
- *
- * @param annotationType
- * The annotation type to match
- * @return A set of matching method abstractions. Returns an empty set if no
- * matches are found.
- *
- * @see org.jboss.webbeans.introspector.AnnotatedClass#getAnnotatedMethods(Class)
- */
- public Set<AnnotatedMethod<?>> getAnnotatedMethods(Class<? extends Annotation> annotationType)
- {
- return Collections.unmodifiableSet(annotatedMethods.get(annotationType));
- }
-
- public Set<AnnotatedMethod<?>> getDeclaredAnnotatedMethods(Class<? extends Annotation> annotationType)
- {
- return Collections.unmodifiableSet(declaredAnnotatedMethods.get(annotationType));
- }
-
- /**
- * Gets constructors with given annotation type
- *
- * @param annotationType
- * The annotation type to match
- * @return A set of abstracted constructors with given annotation type. If
- * the constructors set is empty, initialize it first. Returns an
- * empty set if there are no matches.
- *
- * @see org.jboss.webbeans.introspector.AnnotatedClass#getAnnotatedConstructors(Class)
- */
- public Set<AnnotatedConstructor<T>> getAnnotatedConstructors(Class<? extends Annotation> annotationType)
- {
- return Collections.unmodifiableSet(annotatedConstructors.get(annotationType));
- }
-
- public AnnotatedConstructor<T> getNoArgsConstructor()
- {
- return constructorsByArgumentMap.get(NO_ARGUMENTS);
- }
-
- public Set<AnnotatedMethod<?>> getMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
- {
- return Collections.unmodifiableSet(methodsByAnnotatedParameters.get(annotationType));
- }
-
- public Set<AnnotatedConstructor<?>> getConstructorsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
- {
- return Collections.unmodifiableSet(constructorsByAnnotatedParameters.get(annotationType));
- }
-
- public Set<AnnotatedMethod<?>> getDeclaredMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
- {
- return Collections.unmodifiableSet(declaredMethodsByAnnotatedParameters.get(annotationType));
- }
-
- public AnnotatedMethod<?> getMethod(Method methodDescriptor)
- {
- // TODO Should be cached
- for (AnnotatedMethod<?> annotatedMethod : methods)
- {
- if (annotatedMethod.getName().equals(methodDescriptor.getName()) && Arrays.equals(annotatedMethod.getParameterTypesAsArray(), methodDescriptor.getParameterTypes()))
- {
- return annotatedMethod;
- }
- }
- return null;
- }
-
- public AnnotatedMethod<?> getDeclaredMethod(Method method)
- {
- // TODO Should be cached
- for (AnnotatedMethod<?> annotatedMethod : declaredMethods)
- {
- if (annotatedMethod.getName().equals(method.getName()) && Arrays.equals(annotatedMethod.getParameterTypesAsArray(), method.getParameterTypes()))
- {
- return annotatedMethod;
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public <M> AnnotatedMethod<M> getDeclaredMethod(MethodSignature signature, AnnotatedClass<M> expectedReturnType)
- {
- return (AnnotatedMethod<M>) declaredMethodsBySignature.get(signature);
- }
-
- /**
- * Gets a string representation of the class
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- if (toString != null)
- {
- return toString;
- }
- toString = "Annotated class " + Names.classToString(getDelegate());
- return toString;
- }
-
- @SuppressWarnings("unchecked")
- public <U> AnnotatedClass<? extends U> asSubclass(AnnotatedClass<U> clazz)
- {
- return (AnnotatedClass<? extends U>) this;
- }
-
- @SuppressWarnings("unchecked")
- public T cast(Object object)
- {
- return (T) object;
- }
-
-}
\ No newline at end of file
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,255 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector.jlr;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.jboss.webbeans.BeanManagerImpl;
-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.introspector.ConstructorSignature;
-import org.jboss.webbeans.util.Names;
-import org.jboss.webbeans.util.collections.multi.ListHashMultiMap;
-import org.jboss.webbeans.util.collections.multi.ListMultiMap;
-
-/**
- * Represents an annotated constructor
- *
- * This class is immutable, and therefore threadsafe
- *
- * @author Pete Muir
- *
- * @param <T>
- */
-public class AnnotatedConstructorImpl<T> extends AbstractAnnotatedMember<T, Constructor<T>> implements AnnotatedConstructor<T>
-{
-
- // The underlying constructor
- private final Constructor<T> constructor;
-
- // The list of parameter abstractions
- private final List<AnnotatedParameter<?>> parameters;
- // The mapping of annotation -> parameter abstraction
- private final ListMultiMap<Class<? extends Annotation>, AnnotatedParameter<?>> annotatedParameters;
-
- // The declaring class abstraction
- private final AnnotatedType<T> declaringClass;
-
- private final ConstructorSignature signature;
-
- // Cached string representation
- private String toString;
-
- public static <T> AnnotatedConstructor<T> of(Constructor<T> constructor, AnnotatedType<T> declaringClass)
- {
- return new AnnotatedConstructorImpl<T>(constructor, declaringClass);
- }
-
- /**
- * Constructor
- *
- * Initializes the superclass with the build annotations map
- *
- * @param constructor The constructor method
- * @param declaringClass The declaring class
- */
- protected AnnotatedConstructorImpl(Constructor<T> constructor, AnnotatedType<T> declaringClass)
- {
- super(AnnotationStore.of(constructor), constructor, constructor.getDeclaringClass(), constructor.getDeclaringClass());
- this.constructor = constructor;
- this.declaringClass = declaringClass;
-
- this.parameters = new ArrayList<AnnotatedParameter<?>>();
- annotatedParameters = new ListHashMultiMap<Class<? extends Annotation>, AnnotatedParameter<?>>();
-
- for (int i = 0; i < constructor.getParameterTypes().length; i++)
- {
- if (constructor.getParameterAnnotations()[i].length > 0)
- {
- Class<?> clazz = constructor.getParameterTypes()[i];
- Type type = constructor.getGenericParameterTypes()[i];
- AnnotatedParameter<?> parameter = AnnotatedParameterImpl.of(constructor.getParameterAnnotations()[i], clazz, type, this);
- parameters.add(parameter);
-
- for (Annotation annotation : parameter.getAnnotations())
- {
- annotatedParameters.put(annotation.annotationType(), parameter);
- }
- }
- else
- {
- Class<?> clazz = constructor.getParameterTypes()[i];
- Type type;
- if (constructor.getGenericParameterTypes().length > i)
- {
- type = constructor.getGenericParameterTypes()[i];
- }
- else
- {
- type = clazz;
- }
- AnnotatedParameter<?> parameter = AnnotatedParameterImpl.of(new Annotation[0], clazz, type, this);
- parameters.add(parameter);
-
- for (Annotation annotation : parameter.getAnnotations())
- {
- annotatedParameters.put(annotation.annotationType(), parameter);
- }
- }
- }
- this.signature = new ConstructorSignatureImpl(this);
- }
-
- /**
- * Gets the constructor
- *
- * @return The constructor
- */
- public Constructor<T> getAnnotatedConstructor()
- {
- return constructor;
- }
-
- /**
- * Gets the delegate (constructor)
- *
- * @return The delegate
- */
- @Override
-public Constructor<T> getDelegate()
- {
- return constructor;
- }
-
- /**
- * Gets the abstracted parameters
- *
- * If the parameters are null, initalize them first
- *
- * @return A list of annotated parameter abstractions
- *
- * @see org.jboss.webbeans.introspector.AnnotatedConstructor#getParameters()
- */
- public List<AnnotatedParameter<?>> getParameters()
- {
- return Collections.unmodifiableList(parameters);
- }
-
- /**
- * Gets parameter abstractions with a given annotation type.
- *
- * If the parameters are null, they are initializes first.
- *
- * @param annotationType The annotation type to match
- * @return A list of matching parameter abstractions. An empty list is
- * returned if there are no matches.
- *
- * @see org.jboss.webbeans.introspector.AnnotatedConstructor#getAnnotatedParameters(Class)
- */
- public List<AnnotatedParameter<?>> getAnnotatedParameters(Class<? extends Annotation> annotationType)
- {
- return Collections.unmodifiableList(annotatedParameters.get(annotationType));
- }
-
- /**
- * Creates a new instance
- *
- * @param manager The Web Beans manager
- * @return An instance
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- * @throws InstantiationException
- * @throws IllegalArgumentException
- *
- * @see org.jboss.webbeans.introspector.AnnotatedConstructor#newInstance(BeanManagerImpl)
- */
- public T newInstance(Object... parameters) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
- {
- return getDelegate().newInstance(parameters);
- }
-
- /**
- * The overridden equals operation
- *
- * @param other The instance to compare to
- * @return True if equal, false otherwise
- */
- @Override
- public boolean equals(Object other)
- {
-
- if (super.equals(other) && other instanceof AnnotatedConstructor)
- {
- AnnotatedConstructor<?> that = (AnnotatedConstructor<?>) other;
- return this.getDeclaringClass().equals(that.getDeclaringClass()) && this.getParameters().equals(that.getParameters());
- }
- return false;
- }
-
- /**
- * The overridden hashcode
- *
- * Gets the hash code from the delegate
- *
- * @return The hash code
- */
- @Override
- public int hashCode()
- {
- return getDelegate().hashCode();
- }
-
- /**
- * Gets the declaring class
- *
- * @return The declaring class
- */
- public AnnotatedType<T> getDeclaringClass()
- {
- return declaringClass;
- }
-
- /**
- * Gets a string representation of the constructor
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- if (toString != null)
- {
- return toString;
- }
- toString = "Annotated constructor " + Names.constructorToString(constructor);
- return toString;
- }
-
- public ConstructorSignature getSignature()
- {
- return signature;
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,156 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector.jlr;
-
-import java.lang.reflect.Field;
-
-import org.jboss.webbeans.introspector.AnnotatedField;
-import org.jboss.webbeans.introspector.AnnotatedType;
-import org.jboss.webbeans.introspector.AnnotationStore;
-import org.jboss.webbeans.util.Names;
-import org.jboss.webbeans.util.Reflections;
-
-/**
- * Represents an annotated field
- *
- * This class is immutable, and therefore threadsafe
- *
- * @author Pete Muir
- *
- * @param <T>
- */
-public class AnnotatedFieldImpl<T> extends AbstractAnnotatedMember<T, Field> implements AnnotatedField<T>
-{
-
- // The underlying field
- private final Field field;
- // The abstraction of the declaring class
- private final AnnotatedType<?> declaringClass;
-
- // Cached string representation
- private String toString;
-
- /**
- * Constructor
- *
- * Initializes the superclass with the built annotation map and detects the
- * type arguments
- *
- * @param field The actual field
- * @param declaringClass The abstraction of the declaring class
- */
- protected AnnotatedFieldImpl(Field field, AnnotatedType<?> declaringClass)
- {
- super(AnnotationStore.of(field), field, (Class<T>) field.getType(), field.getGenericType());
- this.field = field;
- field.setAccessible(true);
- this.declaringClass = declaringClass;
- }
-
- /**
- * Gets the underlying field
- *
- * @return The fields
- */
- public Field getAnnotatedField()
- {
- return field;
- }
-
- public Field getDelegate()
- {
- return field;
- }
-
- public void set(Object instance, Object value) throws IllegalArgumentException, IllegalAccessException
- {
- field.set(instance, value);
- }
-
- public void setOnInstance(Object instance, Object value) throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException
- {
- instance.getClass().getField(getName()).set(instance, value);
- }
-
- @SuppressWarnings("unchecked")
- public T get(Object instance)
- {
- return (T) Reflections.getAndWrap(getDelegate(), instance);
- }
-
- /**
- * Gets the property name
- *
- * @return The property name
- *
- * @see org.jboss.webbeans.introspector.AnnotatedField#getName()
- */
- public String getPropertyName()
- {
- return getName();
- }
-
- /**
- * Gets the abstracted declaring class
- *
- * @return The declaring class
- *
- * @see org.jboss.webbeans.introspector.AnnotatedField#getDeclaringClass()
- */
- public AnnotatedType<?> getDeclaringClass()
- {
- return declaringClass;
- }
-
- /**
- * Gets a string representation of the field
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- if (toString != null)
- {
- return toString;
- }
- toString = Names.fieldToString(field) + " on " + getDeclaringClass();
- return toString;
- }
-
- @Override
- public boolean equals(Object other)
- {
- if (other instanceof AnnotatedField)
- {
- AnnotatedField<?> that = (AnnotatedField<?>) other;
- return this.getDeclaringClass().equals(that.getDeclaringClass()) && this.getName().equals(that.getName());
- }
- else
- {
- return false;
- }
- }
-
-
- @Override
- public int hashCode()
- {
- return getDelegate().hashCode();
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,222 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector.jlr;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.lang.reflect.Type;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.jboss.webbeans.introspector.AnnotatedMethod;
-import org.jboss.webbeans.introspector.AnnotatedParameter;
-import org.jboss.webbeans.introspector.AnnotatedType;
-import org.jboss.webbeans.introspector.AnnotationStore;
-import org.jboss.webbeans.introspector.MethodSignature;
-import org.jboss.webbeans.util.Names;
-import org.jboss.webbeans.util.Reflections;
-import org.jboss.webbeans.util.collections.multi.ListHashMultiMap;
-import org.jboss.webbeans.util.collections.multi.ListMultiMap;
-
-/**
- * Represents an annotated method
- *
- * This class is immutable and therefore threadsafe
- *
- * @author Pete Muir
- *
- * @param <T>
- */
-public class AnnotatedMethodImpl<T> extends AbstractAnnotatedMember<T, Method> implements AnnotatedMethod<T>
-{
-
- // The underlying method
- private final Method method;
-
- // The abstracted parameters
- private final List<AnnotatedParameter<?>> parameters;
- // A mapping from annotation type to parameter abstraction with that
- // annotation present
- private final ListMultiMap<Class<? extends Annotation>, AnnotatedParameter<?>> annotatedParameters;
-
- // The property name
- private final String propertyName;
-
- // The abstracted declaring class
- private final AnnotatedType<?> declaringClass;
-
- // Cached string representation
- private String toString;
-
- private final MethodSignature signature;
-
- public static <T> AnnotatedMethodImpl<T> of(Method method, AnnotatedType<?> declaringClass)
- {
- return new AnnotatedMethodImpl<T>(method, declaringClass);
- }
-
- /**
- * Constructor
- *
- * Initializes the superclass with the built annotation map, sets the method
- * and declaring class abstraction and detects the actual type arguments
- *
- * @param method The underlying method
- * @param declaringClass The declaring class abstraction
- */
- @SuppressWarnings("unchecked")
- protected AnnotatedMethodImpl(Method method, AnnotatedType<?> declaringClass)
- {
- super(AnnotationStore.of(method), method, (Class<T>) method.getReturnType(), method.getGenericReturnType());
- this.method = method;
- this.method.setAccessible(true);
- this.declaringClass = declaringClass;
- this.parameters = new ArrayList<AnnotatedParameter<?>>();
- this.annotatedParameters = new ListHashMultiMap<Class<? extends Annotation>, AnnotatedParameter<?>>();
-
- for (int i = 0; i < method.getParameterTypes().length; i++)
- {
- if (method.getParameterAnnotations()[i].length > 0)
- {
- Class<? extends Object> clazz = method.getParameterTypes()[i];
- Type type = method.getGenericParameterTypes()[i];
- AnnotatedParameter<?> parameter = AnnotatedParameterImpl.of(method.getParameterAnnotations()[i], (Class<Object>) clazz, type, this);
- this.parameters.add(parameter);
- for (Annotation annotation : parameter.getAnnotations())
- {
- if (MAPPED_PARAMETER_ANNOTATIONS.contains(annotation.annotationType()))
- {
- annotatedParameters.put(annotation.annotationType(), parameter);
- }
- }
- }
- else
- {
- Class<? extends Object> clazz = method.getParameterTypes()[i];
- Type type = method.getGenericParameterTypes()[i];
- AnnotatedParameter<?> parameter = AnnotatedParameterImpl.of(new Annotation[0], (Class<Object>) clazz, type, this);
- this.parameters.add(parameter);
- }
- }
-
- String propertyName = Reflections.getPropertyName(getDelegate());
- if (propertyName == null)
- {
- this.propertyName = getName();
- }
- else
- {
- this.propertyName = propertyName;
- }
- this.signature = new MethodSignatureImpl(this);
- }
-
- public Method getAnnotatedMethod()
- {
- return method;
- }
-
- public Method getDelegate()
- {
- return method;
- }
-
- public List<AnnotatedParameter<?>> getParameters()
- {
- return Collections.unmodifiableList(parameters);
- }
-
- public Class<?>[] getParameterTypesAsArray()
- {
- return method.getParameterTypes();
- }
-
- public List<AnnotatedParameter<?>> getAnnotatedParameters(Class<? extends Annotation> annotationType)
- {
- return Collections.unmodifiableList(annotatedParameters.get(annotationType));
- }
-
- @Override
- public boolean equals(Object other)
- {
- if (other instanceof AnnotatedMethod)
- {
- AnnotatedMethod<?> that = (AnnotatedMethod<?>) other;
- return this.getDeclaringClass().equals(that.getDeclaringClass()) && this.getName().equals(that.getName()) && this.getParameters().equals(that.getParameters());
- }
- else
- {
- return false;
- }
- }
-
- public boolean isEquivalent(Method method)
- {
- return this.getDeclaringClass().isEquivalent(method.getDeclaringClass()) && this.getName().equals(method.getName()) && Arrays.equals(this.getParameterTypesAsArray(), method.getParameterTypes());
- }
-
- @Override
- public int hashCode()
- {
- return getDelegate().hashCode();
- }
-
- public T invokeOnInstance(Object instance, Object...parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException
- {
- Method method = Reflections.lookupMethod(getName(), getParameterTypesAsArray(), instance);
- @SuppressWarnings("unchecked")
- T result = (T) method.invoke(instance, parameters);
- return result;
- }
-
- public T invoke(Object instance, Object... parameters) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
- {
- @SuppressWarnings("unchecked")
- T result = (T) method.invoke(instance, parameters);
- return result;
- }
-
- public String getPropertyName()
- {
- return propertyName;
- }
-
- public AnnotatedType<?> getDeclaringClass()
- {
- return declaringClass;
- }
-
- @Override
- public String toString()
- {
- if (toString != null)
- {
- return toString;
- }
- toString = "Annotated method on class " + getDeclaringClass().getName() + Names.methodToString(method);
- return toString;
- }
-
- public MethodSignature getSignature()
- {
- return signature;
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -1,166 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.introspector.jlr;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Set;
-
-import org.jboss.webbeans.introspector.AnnotatedMember;
-import org.jboss.webbeans.introspector.AnnotatedParameter;
-import org.jboss.webbeans.introspector.AnnotationStore;
-
-/**
- * Represents a parameter
- *
- * This class is immutable and therefore threadsafe
- *
- * @author Pete Muir
- *
- * @param <T>
- */
-public class AnnotatedParameterImpl<T> extends AbstractAnnotatedItem<T, Object> implements AnnotatedParameter<T>
-{
-
- // The final state
- private final boolean _final = false;
- // The static state
- private final boolean _static = false;
- private final boolean _public = false;
- private final AnnotatedMember<?, ?> declaringMember;
-
- // Cached string representation
- private String toString;
-
- public static <T> AnnotatedParameter<T> of(Annotation[] annotations, Class<T> rawType, Type type, AnnotatedMember<?, ?> declaringMember)
- {
- return new AnnotatedParameterImpl<T>(annotations, rawType, type, declaringMember);
- }
-
- /**
- * Constructor
- *
- * @param annotations The annotations array
- * @param type The type of the parameter
- */
- protected AnnotatedParameterImpl(Annotation[] annotations, Class<T> rawType, Type type, AnnotatedMember<?, ?> declaringMember)
- {
- super(AnnotationStore.of(annotations, annotations), rawType, type);
- this.declaringMember = declaringMember;
- }
-
- /**
- * Gets the delegate
- *
- * @return The delegate (null)
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#getDelegate()
- */
- public Object getDelegate()
- {
- return null;
- }
-
- /**
- * Indicates if the parameter is final
- *
- * @return True if final, false otherwise
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#isFinal()
- */
- public boolean isFinal()
- {
- return _final;
- }
-
- /**
- * Indicates if the parameter is static
- *
- * @return True if static, false otherwise
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#isStatic()
- */
- public boolean isStatic()
- {
- return _static;
- }
-
- public boolean isPublic()
- {
- return _public;
- }
-
- /**
- * Gets the current value
- *
- * @param beanManager The Web Beans manager
- * @return the value
- *
- * @see org.jboss.webbeans.introspector.AnnotatedParameter
- *
- public T getValue(BeanManager beanManager)
- {
- return beanManager.getInstanceByType(getRawType(), getMetaAnnotationsAsArray(BindingType.class));
- }*/
-
- /**
- * Gets the name of the parameter
- *
- * @throws IllegalArgumentException (not supported)
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#getName()
- */
- public String getName()
- {
- throw new IllegalArgumentException("Unable to determine name of parameter");
- }
-
- /**
- * Gets a string representation of the parameter
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- if (toString == null)
- {
- StringBuilder buffer = new StringBuilder();
- buffer.append("Annotated parameter ");
- if (_static)
- buffer.append("static ");
- if (_final)
- buffer.append("final ");
- buffer.append(getRawType().getName());
- buffer.append(" for operation ");
- buffer.append(getDeclaringMember().toString());
- toString = buffer.toString();
- }
- return toString;
- }
-
- public AnnotatedMember<?, ?> getDeclaringMember()
- {
- return declaringMember;
- }
-
- public AnnotatedParameter<T> wrap(Set<Annotation> annotations)
- {
- throw new UnsupportedOperationException();
- }
-
-}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/ConstructorSignatureImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -18,7 +18,7 @@
import java.util.Arrays;
-import org.jboss.webbeans.introspector.AnnotatedConstructor;
+import org.jboss.webbeans.introspector.WBConstructor;
import org.jboss.webbeans.introspector.ConstructorSignature;
import org.jboss.webbeans.introspector.MethodSignature;
@@ -27,7 +27,7 @@
private final String[] parameterTypes;
- public ConstructorSignatureImpl(AnnotatedConstructor<?> method)
+ public ConstructorSignatureImpl(WBConstructor<?> method)
{
this.parameterTypes = new String[method.getParameters().size()];
for (int i = 0; i < method.getParameters().size(); i++)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/MethodSignatureImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -19,7 +19,7 @@
import java.lang.reflect.Method;
import java.util.Arrays;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.WBMethod;
import org.jboss.webbeans.introspector.MethodSignature;
public class MethodSignatureImpl implements MethodSignature
@@ -30,7 +30,7 @@
private final String methodName;
private final String[] parameterTypes;
- public MethodSignatureImpl(AnnotatedMethod<?> method)
+ public MethodSignatureImpl(WBMethod<?> method)
{
this.methodName = method.getName();
this.parameterTypes = new String[method.getParameters().size()];
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java (from rev 2827, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,149 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector.jlr;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.webbeans.introspector.WBAnnotation;
+import org.jboss.webbeans.introspector.WBClass;
+import org.jboss.webbeans.introspector.WBMethod;
+import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.resources.ClassTransformer;
+import org.jboss.webbeans.util.collections.multi.SetHashMultiMap;
+import org.jboss.webbeans.util.collections.multi.SetMultiMap;
+
+/**
+ * Represents an annotated annotation
+ *
+ * This class is immutable and therefore threadsafe
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public class WBAnnotationImpl<T extends Annotation> extends AbstractWBType<T> implements WBAnnotation<T>
+{
+
+ // The annotated members map (annotation -> member with annotation)
+ private final SetMultiMap<Class<? extends Annotation>, WBMethod<?>> annotatedMembers;
+ // The implementation class of the annotation
+ private final Class<T> clazz;
+ // The set of abstracted members
+ private final Set<WBMethod<?>> members;
+
+ private final Map<String, WBMethod<?>> namedMembers;
+
+ // Cached string representation
+ private String toString;
+
+ public static <A extends Annotation> WBAnnotation<A> of(Class<A> annotationType, ClassTransformer classTransformer)
+ {
+ return new WBAnnotationImpl<A>(annotationType, classTransformer);
+ }
+
+ /**
+ * Constructor
+ *
+ * Initializes the superclass with the built annotation map
+ *
+ * @param annotationType The annotation type
+ */
+ protected WBAnnotationImpl(Class<T> annotationType, ClassTransformer classTransformer)
+ {
+ super(AnnotationStore.of(annotationType), annotationType, annotationType, classTransformer);
+ this.clazz = annotationType;
+ members = new HashSet<WBMethod<?>>();
+ annotatedMembers = new SetHashMultiMap<Class<? extends Annotation>, WBMethod<?>>();
+ this.namedMembers = new HashMap<String, WBMethod<?>>();
+ for (Method member : clazz.getDeclaredMethods())
+ {
+ WBMethod<?> annotatedMethod = WBMethodImpl.of(member, this);
+ members.add(annotatedMethod);
+ for (Annotation annotation : annotatedMethod.getAnnotations())
+ {
+ annotatedMembers.put(annotation.annotationType(), annotatedMethod);
+ }
+ namedMembers.put(annotatedMethod.getName(), annotatedMethod);
+ }
+ }
+
+ /**
+ * Gets all members of the annotation
+ *
+ * Initializes the members first if they are null
+ *
+ * @return The set of abstracted members
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotation#getMembers()
+ */
+ public Set<WBMethod<?>> getMembers()
+ {
+ return Collections.unmodifiableSet(members);
+ }
+
+ /**
+ * Returns the annotated members with a given annotation type
+ *
+ * If the annotated members are null, they are initialized first.
+ *
+ * @param annotationType The annotation type to match
+ * @return The set of abstracted members with the given annotation type
+ * present. An empty set is returned if no matches are found
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotation#getAnnotatedMembers(Class)
+ */
+ public Set<WBMethod<?>> getAnnotatedMembers(Class<? extends Annotation> annotationType)
+ {
+ return Collections.unmodifiableSet(annotatedMembers.get(annotationType));
+ }
+
+ public <A> WBMethod<A> getMember(String memberName, WBClass<A> expectedType)
+ {
+ return (WBMethod<A>) namedMembers.get(memberName);
+ }
+
+ /**
+ * Gets a string representation of the annotation
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ if (toString != null)
+ {
+ return toString;
+ }
+ return toString;
+ }
+
+ public Class<T> getDelegate()
+ {
+ return clazz;
+ }
+
+ public WBAnnotation<T> wrap(Set<Annotation> annotations)
+ {
+ throw new UnsupportedOperationException();
+ }
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBAnnotationImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java (from rev 2827, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,474 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector.jlr;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.webbeans.introspector.WBClass;
+import org.jboss.webbeans.introspector.WBConstructor;
+import org.jboss.webbeans.introspector.WBField;
+import org.jboss.webbeans.introspector.WBMethod;
+import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.introspector.ConstructorSignature;
+import org.jboss.webbeans.introspector.MethodSignature;
+import org.jboss.webbeans.resources.ClassTransformer;
+import org.jboss.webbeans.util.Names;
+import org.jboss.webbeans.util.Reflections;
+import org.jboss.webbeans.util.collections.multi.SetHashMultiMap;
+import org.jboss.webbeans.util.collections.multi.SetMultiMap;
+
+/**
+ * Represents an annotated class
+ *
+ * This class is immutable, and therefore threadsafe
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public class WBClassImpl<T> extends AbstractWBType<T> implements WBClass<T>
+{
+
+ private static List<Class<?>> NO_ARGUMENTS = Collections.emptyList();
+
+ // The set of abstracted fields
+ private final Set<WBField<?>> fields;
+ // The map from annotation type to abstracted field with annotation
+ private final SetMultiMap<Class<? extends Annotation>, WBField<?>> annotatedFields;
+ // The map from annotation type to abstracted field with meta-annotation
+ private final SetMultiMap<Class<? extends Annotation>, WBField<?>> metaAnnotatedFields;
+
+ // The set of abstracted fields
+ private final Set<WBField<?>> declaredFields;
+ private final Map<String, WBField<?>> declaredFieldsByName;
+ // The map from annotation type to abstracted field with annotation
+ private final SetMultiMap<Class<? extends Annotation>, WBField<?>> declaredAnnotatedFields;
+ // The map from annotation type to abstracted field with meta-annotation
+ private final SetMultiMap<Class<? extends Annotation>, WBField<?>> declaredMetaAnnotatedFields;
+
+ // The set of abstracted methods
+ private final Set<WBMethod<?>> methods;
+ private final Map<MethodSignature, WBMethod<?>> declaredMethodsBySignature;
+ // The map from annotation type to abstracted method with annotation
+ private final SetMultiMap<Class<? extends Annotation>, WBMethod<?>> annotatedMethods;
+ // The map from annotation type to method with a parameter with annotation
+ private final SetMultiMap<Class<? extends Annotation>, WBMethod<?>> methodsByAnnotatedParameters;
+
+ // The set of abstracted methods
+ private final Set<WBMethod<?>> declaredMethods;
+ // The map from annotation type to abstracted method with annotation
+ private final SetMultiMap<Class<? extends Annotation>, WBMethod<?>> declaredAnnotatedMethods;
+ // The map from annotation type to method with a parameter with annotation
+ private final SetMultiMap<Class<? extends Annotation>, WBMethod<?>> declaredMethodsByAnnotatedParameters;
+
+ // The set of abstracted constructors
+ private final Set<WBConstructor<T>> constructors;
+ private final Map<ConstructorSignature, WBConstructor<?>> declaredConstructorsBySignature;
+ // The map from annotation type to abstracted constructor with annotation
+ private final SetMultiMap<Class<? extends Annotation>, WBConstructor<T>> annotatedConstructors;
+ // The map from class list to abstracted constructor
+ private final Map<List<Class<?>>, WBConstructor<T>> constructorsByArgumentMap;
+
+ private final SetMultiMap<Class<? extends Annotation>, WBConstructor<?>> constructorsByAnnotatedParameters;
+
+ // Cached string representation
+ private String toString;
+
+ private final boolean _nonStaticMemberClass;
+ private final boolean _abstract;
+ private final boolean _enum;
+
+
+ public static <T> WBClass<T> of(Class<T> clazz, ClassTransformer classTransformer)
+ {
+ return new WBClassImpl<T>(clazz, clazz, clazz.getAnnotations(), clazz.getDeclaredAnnotations(), classTransformer);
+ }
+
+ private WBClassImpl(Class<T> rawType, Type type, Annotation[] annotations, Annotation[] declaredAnnotations, ClassTransformer classTransformer)
+ {
+ super(AnnotationStore.of(annotations, declaredAnnotations), rawType, type, classTransformer);
+
+ this.fields = new HashSet<WBField<?>>();
+ this.annotatedFields = new SetHashMultiMap<Class<? extends Annotation>, WBField<?>>();
+ this.metaAnnotatedFields = new SetHashMultiMap<Class<? extends Annotation>, WBField<?>>();
+ this.declaredFields = new HashSet<WBField<?>>();
+ this.declaredFieldsByName = new HashMap<String, WBField<?>>();
+ this.declaredAnnotatedFields = new SetHashMultiMap<Class<? extends Annotation>, WBField<?>>();
+ this.declaredMetaAnnotatedFields = new SetHashMultiMap<Class<? extends Annotation>, WBField<?>>();
+ this._nonStaticMemberClass = Reflections.isNonStaticInnerClass(rawType);
+ this._abstract = Reflections.isAbstract(rawType);
+ this._enum = rawType.isEnum();
+ for (Class<?> c = rawType; c != Object.class && c != null; c = c.getSuperclass())
+ {
+ for (Field field : c.getDeclaredFields())
+ {
+ if (!field.isAccessible())
+ {
+ field.setAccessible(true);
+ }
+ WBField<?> annotatedField = new WBFieldImpl<Object>(field, this);
+ this.fields.add(annotatedField);
+ if (c == rawType)
+ {
+ this.declaredFields.add(annotatedField);
+ this.declaredFieldsByName.put(annotatedField.getName(), annotatedField);
+ }
+ for (Annotation annotation : annotatedField.getAnnotations())
+ {
+ this.annotatedFields.put(annotation.annotationType(), annotatedField);
+ if (c == rawType)
+ {
+ this.declaredAnnotatedFields.put(annotation.annotationType(), annotatedField);
+ }
+ for (Annotation metaAnnotation : annotation.annotationType().getAnnotations())
+ {
+ this.metaAnnotatedFields.put(metaAnnotation.annotationType(), annotatedField);
+ if (c == rawType)
+ {
+ this.declaredMetaAnnotatedFields.put(metaAnnotation.annotationType(), annotatedField);
+ }
+ }
+ }
+
+ }
+ }
+
+ this.constructors = new HashSet<WBConstructor<T>>();
+ this.constructorsByArgumentMap = new HashMap<List<Class<?>>, WBConstructor<T>>();
+ this.annotatedConstructors = new SetHashMultiMap<Class<? extends Annotation>, WBConstructor<T>>();
+ this.constructorsByAnnotatedParameters = new SetHashMultiMap<Class<? extends Annotation>, WBConstructor<?>>();
+ this.declaredConstructorsBySignature = new HashMap<ConstructorSignature, WBConstructor<?>>();
+ for (Constructor<?> constructor : rawType.getDeclaredConstructors())
+ {
+ @SuppressWarnings("unchecked")
+ Constructor<T> c = (Constructor<T>) constructor;
+ WBConstructor<T> annotatedConstructor = WBConstructorImpl.of(c, this);
+ if (!constructor.isAccessible())
+ {
+ constructor.setAccessible(true);
+ }
+ this.constructors.add(annotatedConstructor);
+ this.constructorsByArgumentMap.put(Arrays.asList(constructor.getParameterTypes()), annotatedConstructor);
+
+ this.declaredConstructorsBySignature.put(annotatedConstructor.getSignature(), annotatedConstructor);
+
+ for (Annotation annotation : annotatedConstructor.getAnnotations())
+ {
+ if (!annotatedConstructors.containsKey(annotation.annotationType()))
+ {
+ annotatedConstructors.put(annotation.annotationType(), new HashSet<WBConstructor<T>>());
+ }
+ annotatedConstructors.get(annotation.annotationType()).add(annotatedConstructor);
+ }
+
+ for (Class<? extends Annotation> annotationType : WBConstructor.MAPPED_PARAMETER_ANNOTATIONS)
+ {
+ if (annotatedConstructor.getAnnotatedParameters(annotationType).size() > 0)
+ {
+ constructorsByAnnotatedParameters.put(annotationType, annotatedConstructor);
+ }
+ }
+ }
+
+ this.methods = new HashSet<WBMethod<?>>();
+ this.annotatedMethods = new SetHashMultiMap<Class<? extends Annotation>, WBMethod<?>>();
+ this.methodsByAnnotatedParameters = new SetHashMultiMap<Class<? extends Annotation>, WBMethod<?>>();
+ this.declaredMethods = new HashSet<WBMethod<?>>();
+ this.declaredAnnotatedMethods = new SetHashMultiMap<Class<? extends Annotation>, WBMethod<?>>();
+ this.declaredMethodsByAnnotatedParameters = new SetHashMultiMap<Class<? extends Annotation>, WBMethod<?>>();
+ this.declaredMethodsBySignature = new HashMap<MethodSignature, WBMethod<?>>();
+ for (Class<?> c = rawType; c != Object.class && c != null; c = c.getSuperclass())
+ {
+ for (Method method : c.getDeclaredMethods())
+ {
+ if (!method.isAccessible())
+ {
+ method.setAccessible(true);
+ }
+
+ WBMethod<?> annotatedMethod = WBMethodImpl.of(method, this);
+ this.methods.add(annotatedMethod);
+ if (c == rawType)
+ {
+ this.declaredMethods.add(annotatedMethod);
+ this.declaredMethodsBySignature.put(annotatedMethod.getSignature(), annotatedMethod);
+ }
+ for (Annotation annotation : annotatedMethod.getAnnotations())
+ {
+ annotatedMethods.put(annotation.annotationType(), annotatedMethod);
+ if (c == rawType)
+ {
+ this.declaredAnnotatedMethods.put(annotation.annotationType(), annotatedMethod);
+ }
+ }
+ for (Class<? extends Annotation> annotationType : WBMethod.MAPPED_PARAMETER_ANNOTATIONS)
+ {
+ if (annotatedMethod.getAnnotatedParameters(annotationType).size() > 0)
+ {
+ methodsByAnnotatedParameters.put(annotationType, annotatedMethod);
+ if (c == rawType)
+ {
+ this.declaredMethodsByAnnotatedParameters.put(annotationType, annotatedMethod);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Gets the implementing class
+ *
+ * @return The class
+ */
+ public Class<? extends T> getAnnotatedClass()
+ {
+ return getRawType();
+ }
+
+ /**
+ * Gets the delegate (class)
+ *
+ * @return The class
+ */
+ public Class<T> getDelegate()
+ {
+ return getRawType();
+ }
+
+ /**
+ * Gets the abstracted fields of the class
+ *
+ * Initializes the fields if they are null
+ *
+ * @return The set of abstracted fields
+ */
+ public Set<WBField<?>> getFields()
+ {
+ return Collections.unmodifiableSet(fields);
+ }
+
+ public Set<WBField<?>> getDeclaredFields()
+ {
+ return Collections.unmodifiableSet(declaredFields);
+ }
+
+ public <F> WBField<F> getDeclaredField(String fieldName, WBClass<F> expectedType)
+ {
+ return (WBField<F>) declaredFieldsByName.get(fieldName);
+ }
+
+ public Set<WBField<?>> getDeclaredAnnotatedFields(Class<? extends Annotation> annotationType)
+ {
+ return Collections.unmodifiableSet(declaredAnnotatedFields.get(annotationType));
+ }
+
+ /**
+ * Gets the abstracted constructors of the class
+ *
+ * Initializes the constructors if they are null
+ *
+ * @return The set of abstracted constructors
+ */
+ public Set<WBConstructor<T>> getConstructors()
+ {
+ return Collections.unmodifiableSet(constructors);
+ }
+
+ public WBConstructor<T> getDeclaredConstructor(ConstructorSignature signature)
+ {
+ return (WBConstructor<T>) declaredConstructorsBySignature.get(signature);
+ }
+
+ /**
+ * Gets abstracted fields with requested meta-annotation type present
+ *
+ * If the meta-annotations map is null, it is initializes. If the annotated
+ * fields are null, it is initialized The meta-annotated field map is then
+ * populated for the requested meta-annotation type and the result is
+ * returned
+ *
+ * @param metaAnnotationType
+ * The meta-annotation type to match
+ * @return The set of abstracted fields with meta-annotation present. Returns
+ * an empty set if no matches are found.
+ */
+ public Set<WBField<?>> getMetaAnnotatedFields(Class<? extends Annotation> metaAnnotationType)
+ {
+ return Collections.unmodifiableSet(metaAnnotatedFields.get(metaAnnotationType));
+ }
+
+ /**
+ * Gets the abstracted field annotated with a specific annotation type
+ *
+ * If the fields map is null, initialize it first
+ *
+ * @param annotationType
+ * The annotation type to match
+ * @return A set of matching abstracted fields, null if none are found.
+ *
+ */
+ public Set<WBField<?>> getAnnotatedFields(Class<? extends Annotation> annotationType)
+ {
+ return Collections.unmodifiableSet(annotatedFields.get(annotationType));
+ }
+
+ public boolean isNonStaticMemberClass()
+ {
+ return _nonStaticMemberClass;
+ }
+
+ public boolean isAbstract()
+ {
+ return _abstract;
+ }
+
+ public boolean isEnum()
+ {
+ return _enum;
+ }
+
+ /**
+ * Gets the abstracted methods that have a certain annotation type present
+ *
+ * If the annotated methods map is null, initialize it first
+ *
+ * @param annotationType
+ * The annotation type to match
+ * @return A set of matching method abstractions. Returns an empty set if no
+ * matches are found.
+ *
+ * @see org.jboss.webbeans.introspector.WBClass#getAnnotatedMethods(Class)
+ */
+ public Set<WBMethod<?>> getAnnotatedMethods(Class<? extends Annotation> annotationType)
+ {
+ return Collections.unmodifiableSet(annotatedMethods.get(annotationType));
+ }
+
+ public Set<WBMethod<?>> getDeclaredAnnotatedMethods(Class<? extends Annotation> annotationType)
+ {
+ return Collections.unmodifiableSet(declaredAnnotatedMethods.get(annotationType));
+ }
+
+ /**
+ * Gets constructors with given annotation type
+ *
+ * @param annotationType
+ * The annotation type to match
+ * @return A set of abstracted constructors with given annotation type. If
+ * the constructors set is empty, initialize it first. Returns an
+ * empty set if there are no matches.
+ *
+ * @see org.jboss.webbeans.introspector.WBClass#getAnnotatedConstructors(Class)
+ */
+ public Set<WBConstructor<T>> getAnnotatedConstructors(Class<? extends Annotation> annotationType)
+ {
+ return Collections.unmodifiableSet(annotatedConstructors.get(annotationType));
+ }
+
+ public WBConstructor<T> getNoArgsConstructor()
+ {
+ return constructorsByArgumentMap.get(NO_ARGUMENTS);
+ }
+
+ public Set<WBMethod<?>> getMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
+ {
+ return Collections.unmodifiableSet(methodsByAnnotatedParameters.get(annotationType));
+ }
+
+ public Set<WBConstructor<?>> getConstructorsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
+ {
+ return Collections.unmodifiableSet(constructorsByAnnotatedParameters.get(annotationType));
+ }
+
+ public Set<WBMethod<?>> getDeclaredMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
+ {
+ return Collections.unmodifiableSet(declaredMethodsByAnnotatedParameters.get(annotationType));
+ }
+
+ public WBMethod<?> getMethod(Method methodDescriptor)
+ {
+ // TODO Should be cached
+ for (WBMethod<?> annotatedMethod : methods)
+ {
+ if (annotatedMethod.getName().equals(methodDescriptor.getName()) && Arrays.equals(annotatedMethod.getParameterTypesAsArray(), methodDescriptor.getParameterTypes()))
+ {
+ return annotatedMethod;
+ }
+ }
+ return null;
+ }
+
+ public WBMethod<?> getDeclaredMethod(Method method)
+ {
+ // TODO Should be cached
+ for (WBMethod<?> annotatedMethod : declaredMethods)
+ {
+ if (annotatedMethod.getName().equals(method.getName()) && Arrays.equals(annotatedMethod.getParameterTypesAsArray(), method.getParameterTypes()))
+ {
+ return annotatedMethod;
+ }
+ }
+ return null;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <M> WBMethod<M> getDeclaredMethod(MethodSignature signature, WBClass<M> expectedReturnType)
+ {
+ return (WBMethod<M>) declaredMethodsBySignature.get(signature);
+ }
+
+ /**
+ * Gets a string representation of the class
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ if (toString != null)
+ {
+ return toString;
+ }
+ toString = "Annotated class " + Names.classToString(getDelegate());
+ return toString;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <U> WBClass<? extends U> asSubclass(WBClass<U> clazz)
+ {
+ return (WBClass<? extends U>) this;
+ }
+
+ @SuppressWarnings("unchecked")
+ public T cast(Object object)
+ {
+ return (T) object;
+ }
+
+}
\ No newline at end of file
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBClassImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java (from rev 2827, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,255 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector.jlr;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.webbeans.BeanManagerImpl;
+import org.jboss.webbeans.introspector.WBConstructor;
+import org.jboss.webbeans.introspector.WBParameter;
+import org.jboss.webbeans.introspector.WBType;
+import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.introspector.ConstructorSignature;
+import org.jboss.webbeans.util.Names;
+import org.jboss.webbeans.util.collections.multi.ListHashMultiMap;
+import org.jboss.webbeans.util.collections.multi.ListMultiMap;
+
+/**
+ * Represents an annotated constructor
+ *
+ * This class is immutable, and therefore threadsafe
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public class WBConstructorImpl<T> extends AbstractWBMember<T, Constructor<T>> implements WBConstructor<T>
+{
+
+ // The underlying constructor
+ private final Constructor<T> constructor;
+
+ // The list of parameter abstractions
+ private final List<WBParameter<?>> parameters;
+ // The mapping of annotation -> parameter abstraction
+ private final ListMultiMap<Class<? extends Annotation>, WBParameter<?>> annotatedParameters;
+
+ // The declaring class abstraction
+ private final WBType<T> declaringClass;
+
+ private final ConstructorSignature signature;
+
+ // Cached string representation
+ private String toString;
+
+ public static <T> WBConstructor<T> of(Constructor<T> constructor, WBType<T> declaringClass)
+ {
+ return new WBConstructorImpl<T>(constructor, declaringClass);
+ }
+
+ /**
+ * Constructor
+ *
+ * Initializes the superclass with the build annotations map
+ *
+ * @param constructor The constructor method
+ * @param declaringClass The declaring class
+ */
+ protected WBConstructorImpl(Constructor<T> constructor, WBType<T> declaringClass)
+ {
+ super(AnnotationStore.of(constructor), constructor, constructor.getDeclaringClass(), constructor.getDeclaringClass());
+ this.constructor = constructor;
+ this.declaringClass = declaringClass;
+
+ this.parameters = new ArrayList<WBParameter<?>>();
+ annotatedParameters = new ListHashMultiMap<Class<? extends Annotation>, WBParameter<?>>();
+
+ for (int i = 0; i < constructor.getParameterTypes().length; i++)
+ {
+ if (constructor.getParameterAnnotations()[i].length > 0)
+ {
+ Class<?> clazz = constructor.getParameterTypes()[i];
+ Type type = constructor.getGenericParameterTypes()[i];
+ WBParameter<?> parameter = WBParameterImpl.of(constructor.getParameterAnnotations()[i], clazz, type, this);
+ parameters.add(parameter);
+
+ for (Annotation annotation : parameter.getAnnotations())
+ {
+ annotatedParameters.put(annotation.annotationType(), parameter);
+ }
+ }
+ else
+ {
+ Class<?> clazz = constructor.getParameterTypes()[i];
+ Type type;
+ if (constructor.getGenericParameterTypes().length > i)
+ {
+ type = constructor.getGenericParameterTypes()[i];
+ }
+ else
+ {
+ type = clazz;
+ }
+ WBParameter<?> parameter = WBParameterImpl.of(new Annotation[0], clazz, type, this);
+ parameters.add(parameter);
+
+ for (Annotation annotation : parameter.getAnnotations())
+ {
+ annotatedParameters.put(annotation.annotationType(), parameter);
+ }
+ }
+ }
+ this.signature = new ConstructorSignatureImpl(this);
+ }
+
+ /**
+ * Gets the constructor
+ *
+ * @return The constructor
+ */
+ public Constructor<T> getAnnotatedConstructor()
+ {
+ return constructor;
+ }
+
+ /**
+ * Gets the delegate (constructor)
+ *
+ * @return The delegate
+ */
+ @Override
+public Constructor<T> getDelegate()
+ {
+ return constructor;
+ }
+
+ /**
+ * Gets the abstracted parameters
+ *
+ * If the parameters are null, initalize them first
+ *
+ * @return A list of annotated parameter abstractions
+ *
+ * @see org.jboss.webbeans.introspector.WBConstructor#getParameters()
+ */
+ public List<WBParameter<?>> getParameters()
+ {
+ return Collections.unmodifiableList(parameters);
+ }
+
+ /**
+ * Gets parameter abstractions with a given annotation type.
+ *
+ * If the parameters are null, they are initializes first.
+ *
+ * @param annotationType The annotation type to match
+ * @return A list of matching parameter abstractions. An empty list is
+ * returned if there are no matches.
+ *
+ * @see org.jboss.webbeans.introspector.WBConstructor#getAnnotatedParameters(Class)
+ */
+ public List<WBParameter<?>> getAnnotatedParameters(Class<? extends Annotation> annotationType)
+ {
+ return Collections.unmodifiableList(annotatedParameters.get(annotationType));
+ }
+
+ /**
+ * Creates a new instance
+ *
+ * @param manager The Web Beans manager
+ * @return An instance
+ * @throws InvocationTargetException
+ * @throws IllegalAccessException
+ * @throws InstantiationException
+ * @throws IllegalArgumentException
+ *
+ * @see org.jboss.webbeans.introspector.WBConstructor#newInstance(BeanManagerImpl)
+ */
+ public T newInstance(Object... parameters) throws IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException
+ {
+ return getDelegate().newInstance(parameters);
+ }
+
+ /**
+ * The overridden equals operation
+ *
+ * @param other The instance to compare to
+ * @return True if equal, false otherwise
+ */
+ @Override
+ public boolean equals(Object other)
+ {
+
+ if (super.equals(other) && other instanceof WBConstructor)
+ {
+ WBConstructor<?> that = (WBConstructor<?>) other;
+ return this.getDeclaringClass().equals(that.getDeclaringClass()) && this.getParameters().equals(that.getParameters());
+ }
+ return false;
+ }
+
+ /**
+ * The overridden hashcode
+ *
+ * Gets the hash code from the delegate
+ *
+ * @return The hash code
+ */
+ @Override
+ public int hashCode()
+ {
+ return getDelegate().hashCode();
+ }
+
+ /**
+ * Gets the declaring class
+ *
+ * @return The declaring class
+ */
+ public WBType<T> getDeclaringClass()
+ {
+ return declaringClass;
+ }
+
+ /**
+ * Gets a string representation of the constructor
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ if (toString != null)
+ {
+ return toString;
+ }
+ toString = "Annotated constructor " + Names.constructorToString(constructor);
+ return toString;
+ }
+
+ public ConstructorSignature getSignature()
+ {
+ return signature;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBConstructorImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedFieldImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,156 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector.jlr;
+
+import java.lang.reflect.Field;
+
+import org.jboss.webbeans.introspector.WBField;
+import org.jboss.webbeans.introspector.WBType;
+import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.util.Names;
+import org.jboss.webbeans.util.Reflections;
+
+/**
+ * Represents an annotated field
+ *
+ * This class is immutable, and therefore threadsafe
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public class WBFieldImpl<T> extends AbstractWBMember<T, Field> implements WBField<T>
+{
+
+ // The underlying field
+ private final Field field;
+ // The abstraction of the declaring class
+ private final WBType<?> declaringClass;
+
+ // Cached string representation
+ private String toString;
+
+ /**
+ * Constructor
+ *
+ * Initializes the superclass with the built annotation map and detects the
+ * type arguments
+ *
+ * @param field The actual field
+ * @param declaringClass The abstraction of the declaring class
+ */
+ protected WBFieldImpl(Field field, WBType<?> declaringClass)
+ {
+ super(AnnotationStore.of(field), field, (Class<T>) field.getType(), field.getGenericType());
+ this.field = field;
+ field.setAccessible(true);
+ this.declaringClass = declaringClass;
+ }
+
+ /**
+ * Gets the underlying field
+ *
+ * @return The fields
+ */
+ public Field getAnnotatedField()
+ {
+ return field;
+ }
+
+ public Field getDelegate()
+ {
+ return field;
+ }
+
+ public void set(Object instance, Object value) throws IllegalArgumentException, IllegalAccessException
+ {
+ field.set(instance, value);
+ }
+
+ public void setOnInstance(Object instance, Object value) throws IllegalArgumentException, SecurityException, IllegalAccessException, NoSuchFieldException
+ {
+ instance.getClass().getField(getName()).set(instance, value);
+ }
+
+ @SuppressWarnings("unchecked")
+ public T get(Object instance)
+ {
+ return (T) Reflections.getAndWrap(getDelegate(), instance);
+ }
+
+ /**
+ * Gets the property name
+ *
+ * @return The property name
+ *
+ * @see org.jboss.webbeans.introspector.WBField#getName()
+ */
+ public String getPropertyName()
+ {
+ return getName();
+ }
+
+ /**
+ * Gets the abstracted declaring class
+ *
+ * @return The declaring class
+ *
+ * @see org.jboss.webbeans.introspector.WBField#getDeclaringClass()
+ */
+ public WBType<?> getDeclaringClass()
+ {
+ return declaringClass;
+ }
+
+ /**
+ * Gets a string representation of the field
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ if (toString != null)
+ {
+ return toString;
+ }
+ toString = Names.fieldToString(field) + " on " + getDeclaringClass();
+ return toString;
+ }
+
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other instanceof WBField)
+ {
+ WBField<?> that = (WBField<?>) other;
+ return this.getDeclaringClass().equals(that.getDeclaringClass()) && this.getName().equals(that.getName());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ @Override
+ public int hashCode()
+ {
+ return getDelegate().hashCode();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBFieldImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java (from rev 2827, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,222 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector.jlr;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.lang.reflect.Type;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.jboss.webbeans.introspector.WBMethod;
+import org.jboss.webbeans.introspector.WBParameter;
+import org.jboss.webbeans.introspector.WBType;
+import org.jboss.webbeans.introspector.AnnotationStore;
+import org.jboss.webbeans.introspector.MethodSignature;
+import org.jboss.webbeans.util.Names;
+import org.jboss.webbeans.util.Reflections;
+import org.jboss.webbeans.util.collections.multi.ListHashMultiMap;
+import org.jboss.webbeans.util.collections.multi.ListMultiMap;
+
+/**
+ * Represents an annotated method
+ *
+ * This class is immutable and therefore threadsafe
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public class WBMethodImpl<T> extends AbstractWBMember<T, Method> implements WBMethod<T>
+{
+
+ // The underlying method
+ private final Method method;
+
+ // The abstracted parameters
+ private final List<WBParameter<?>> parameters;
+ // A mapping from annotation type to parameter abstraction with that
+ // annotation present
+ private final ListMultiMap<Class<? extends Annotation>, WBParameter<?>> annotatedParameters;
+
+ // The property name
+ private final String propertyName;
+
+ // The abstracted declaring class
+ private final WBType<?> declaringClass;
+
+ // Cached string representation
+ private String toString;
+
+ private final MethodSignature signature;
+
+ public static <T> WBMethodImpl<T> of(Method method, WBType<?> declaringClass)
+ {
+ return new WBMethodImpl<T>(method, declaringClass);
+ }
+
+ /**
+ * Constructor
+ *
+ * Initializes the superclass with the built annotation map, sets the method
+ * and declaring class abstraction and detects the actual type arguments
+ *
+ * @param method The underlying method
+ * @param declaringClass The declaring class abstraction
+ */
+ @SuppressWarnings("unchecked")
+ protected WBMethodImpl(Method method, WBType<?> declaringClass)
+ {
+ super(AnnotationStore.of(method), method, (Class<T>) method.getReturnType(), method.getGenericReturnType());
+ this.method = method;
+ this.method.setAccessible(true);
+ this.declaringClass = declaringClass;
+ this.parameters = new ArrayList<WBParameter<?>>();
+ this.annotatedParameters = new ListHashMultiMap<Class<? extends Annotation>, WBParameter<?>>();
+
+ for (int i = 0; i < method.getParameterTypes().length; i++)
+ {
+ if (method.getParameterAnnotations()[i].length > 0)
+ {
+ Class<? extends Object> clazz = method.getParameterTypes()[i];
+ Type type = method.getGenericParameterTypes()[i];
+ WBParameter<?> parameter = WBParameterImpl.of(method.getParameterAnnotations()[i], (Class<Object>) clazz, type, this);
+ this.parameters.add(parameter);
+ for (Annotation annotation : parameter.getAnnotations())
+ {
+ if (MAPPED_PARAMETER_ANNOTATIONS.contains(annotation.annotationType()))
+ {
+ annotatedParameters.put(annotation.annotationType(), parameter);
+ }
+ }
+ }
+ else
+ {
+ Class<? extends Object> clazz = method.getParameterTypes()[i];
+ Type type = method.getGenericParameterTypes()[i];
+ WBParameter<?> parameter = WBParameterImpl.of(new Annotation[0], (Class<Object>) clazz, type, this);
+ this.parameters.add(parameter);
+ }
+ }
+
+ String propertyName = Reflections.getPropertyName(getDelegate());
+ if (propertyName == null)
+ {
+ this.propertyName = getName();
+ }
+ else
+ {
+ this.propertyName = propertyName;
+ }
+ this.signature = new MethodSignatureImpl(this);
+ }
+
+ public Method getAnnotatedMethod()
+ {
+ return method;
+ }
+
+ public Method getDelegate()
+ {
+ return method;
+ }
+
+ public List<WBParameter<?>> getParameters()
+ {
+ return Collections.unmodifiableList(parameters);
+ }
+
+ public Class<?>[] getParameterTypesAsArray()
+ {
+ return method.getParameterTypes();
+ }
+
+ public List<WBParameter<?>> getAnnotatedParameters(Class<? extends Annotation> annotationType)
+ {
+ return Collections.unmodifiableList(annotatedParameters.get(annotationType));
+ }
+
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other instanceof WBMethod)
+ {
+ WBMethod<?> that = (WBMethod<?>) other;
+ return this.getDeclaringClass().equals(that.getDeclaringClass()) && this.getName().equals(that.getName()) && this.getParameters().equals(that.getParameters());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public boolean isEquivalent(Method method)
+ {
+ return this.getDeclaringClass().isEquivalent(method.getDeclaringClass()) && this.getName().equals(method.getName()) && Arrays.equals(this.getParameterTypesAsArray(), method.getParameterTypes());
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return getDelegate().hashCode();
+ }
+
+ public T invokeOnInstance(Object instance, Object...parameters) throws IllegalArgumentException, SecurityException, IllegalAccessException, InvocationTargetException, NoSuchMethodException
+ {
+ Method method = Reflections.lookupMethod(getName(), getParameterTypesAsArray(), instance);
+ @SuppressWarnings("unchecked")
+ T result = (T) method.invoke(instance, parameters);
+ return result;
+ }
+
+ public T invoke(Object instance, Object... parameters) throws IllegalArgumentException, IllegalAccessException, InvocationTargetException
+ {
+ @SuppressWarnings("unchecked")
+ T result = (T) method.invoke(instance, parameters);
+ return result;
+ }
+
+ public String getPropertyName()
+ {
+ return propertyName;
+ }
+
+ public WBType<?> getDeclaringClass()
+ {
+ return declaringClass;
+ }
+
+ @Override
+ public String toString()
+ {
+ if (toString != null)
+ {
+ return toString;
+ }
+ toString = "Annotated method on class " + getDeclaringClass().getName() + Names.methodToString(method);
+ return toString;
+ }
+
+ public MethodSignature getSignature()
+ {
+ return signature;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBMethodImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedParameterImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -0,0 +1,166 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.introspector.jlr;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import org.jboss.webbeans.introspector.WBMember;
+import org.jboss.webbeans.introspector.WBParameter;
+import org.jboss.webbeans.introspector.AnnotationStore;
+
+/**
+ * Represents a parameter
+ *
+ * This class is immutable and therefore threadsafe
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public class WBParameterImpl<T> extends AbstractWBAnnotated<T, Object> implements WBParameter<T>
+{
+
+ // The final state
+ private final boolean _final = false;
+ // The static state
+ private final boolean _static = false;
+ private final boolean _public = false;
+ private final WBMember<?, ?> declaringMember;
+
+ // Cached string representation
+ private String toString;
+
+ public static <T> WBParameter<T> of(Annotation[] annotations, Class<T> rawType, Type type, WBMember<?, ?> declaringMember)
+ {
+ return new WBParameterImpl<T>(annotations, rawType, type, declaringMember);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param annotations The annotations array
+ * @param type The type of the parameter
+ */
+ protected WBParameterImpl(Annotation[] annotations, Class<T> rawType, Type type, WBMember<?, ?> declaringMember)
+ {
+ super(AnnotationStore.of(annotations, annotations), rawType, type);
+ this.declaringMember = declaringMember;
+ }
+
+ /**
+ * Gets the delegate
+ *
+ * @return The delegate (null)
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated#getDelegate()
+ */
+ public Object getDelegate()
+ {
+ return null;
+ }
+
+ /**
+ * Indicates if the parameter is final
+ *
+ * @return True if final, false otherwise
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated#isFinal()
+ */
+ public boolean isFinal()
+ {
+ return _final;
+ }
+
+ /**
+ * Indicates if the parameter is static
+ *
+ * @return True if static, false otherwise
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated#isStatic()
+ */
+ public boolean isStatic()
+ {
+ return _static;
+ }
+
+ public boolean isPublic()
+ {
+ return _public;
+ }
+
+ /**
+ * Gets the current value
+ *
+ * @param beanManager The Web Beans manager
+ * @return the value
+ *
+ * @see org.jboss.webbeans.introspector.AnnotatedParameter
+ *
+ public T getValue(BeanManager beanManager)
+ {
+ return beanManager.getInstanceByType(getRawType(), getMetaAnnotationsAsArray(BindingType.class));
+ }*/
+
+ /**
+ * Gets the name of the parameter
+ *
+ * @throws IllegalArgumentException (not supported)
+ *
+ * @see org.jboss.webbeans.introspector.WBAnnotated#getName()
+ */
+ public String getName()
+ {
+ throw new IllegalArgumentException("Unable to determine name of parameter");
+ }
+
+ /**
+ * Gets a string representation of the parameter
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ if (toString == null)
+ {
+ StringBuilder buffer = new StringBuilder();
+ buffer.append("Annotated parameter ");
+ if (_static)
+ buffer.append("static ");
+ if (_final)
+ buffer.append("final ");
+ buffer.append(getRawType().getName());
+ buffer.append(" for operation ");
+ buffer.append(getDeclaringMember().toString());
+ toString = buffer.toString();
+ }
+ return toString;
+ }
+
+ public WBMember<?, ?> getDeclaringMember()
+ {
+ return declaringMember;
+ }
+
+ public WBParameter<T> wrap(Set<Annotation> annotations)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/WBParameterImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/AnnotationModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/AnnotationModel.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/AnnotationModel.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -20,7 +20,7 @@
import javax.inject.DefinitionException;
-import org.jboss.webbeans.introspector.AnnotatedAnnotation;
+import org.jboss.webbeans.introspector.WBAnnotation;
import org.jboss.webbeans.resources.ClassTransformer;
/**
@@ -31,7 +31,7 @@
public abstract class AnnotationModel<T extends Annotation>
{
// The underlying annotation
- private AnnotatedAnnotation<T> annotatedAnnotation;
+ private WBAnnotation<T> annotatedAnnotation;
// Is the data valid?
private boolean valid;
@@ -106,7 +106,7 @@
*
* @return The annotation
*/
- protected AnnotatedAnnotation<T> getAnnotatedAnnotation()
+ protected WBAnnotation<T> getAnnotatedAnnotation()
{
return annotatedAnnotation;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/BindingTypeModel.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/BindingTypeModel.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/metadata/BindingTypeModel.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -25,7 +25,7 @@
import javax.inject.DefinitionException;
import javax.inject.ExecutionException;
-import org.jboss.webbeans.introspector.AnnotatedMethod;
+import org.jboss.webbeans.introspector.WBMethod;
import org.jboss.webbeans.resources.ClassTransformer;
import org.jboss.webbeans.util.Reflections;
@@ -39,7 +39,7 @@
public class BindingTypeModel<T extends Annotation> extends AnnotationModel<T>
{
// The non-binding types
- private Set<AnnotatedMethod<?>> nonBindingTypes;
+ private Set<WBMethod<?>> nonBindingTypes;
/**
* Constructor
@@ -67,7 +67,7 @@
*/
private void checkArrayAndAnnotationValuedMembers()
{
- for (AnnotatedMethod<?> annotatedMethod : getAnnotatedAnnotation().getMembers())
+ for (WBMethod<?> annotatedMethod : getAnnotatedAnnotation().getMembers())
{
if ((Reflections.isArrayType(annotatedMethod.getRawType()) || Annotation.class.isAssignableFrom(annotatedMethod.getRawType())) && !nonBindingTypes.contains(annotatedMethod))
{
@@ -104,7 +104,7 @@
* @return A set of non-binding types, or an empty set if there are none
* present
*/
- public Set<AnnotatedMethod<?>> getNonBindingTypes()
+ public Set<WBMethod<?>> getNonBindingTypes()
{
return nonBindingTypes;
}
@@ -128,7 +128,7 @@
{
if (instance.annotationType().equals(getRawType()) && other.annotationType().equals(getRawType()))
{
- for (AnnotatedMethod<?> annotatedMethod : getAnnotatedAnnotation().getMembers())
+ for (WBMethod<?> annotatedMethod : getAnnotatedAnnotation().getMembers())
{
if (!nonBindingTypes.contains(annotatedMethod))
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/resources/ClassTransformer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/resources/ClassTransformer.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/resources/ClassTransformer.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -20,17 +20,17 @@
import java.util.concurrent.Callable;
import org.jboss.webbeans.bootstrap.api.Service;
-import org.jboss.webbeans.introspector.AnnotatedAnnotation;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.jlr.AnnotatedAnnotationImpl;
-import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
+import org.jboss.webbeans.introspector.WBAnnotation;
+import org.jboss.webbeans.introspector.WBClass;
+import org.jboss.webbeans.introspector.jlr.WBAnnotationImpl;
+import org.jboss.webbeans.introspector.jlr.WBClassImpl;
import org.jboss.webbeans.util.collections.ConcurrentCache;
public class ClassTransformer implements Service
{
- private final ConcurrentCache<Class<?>, AnnotatedClass<?>> classes;
- private final ConcurrentCache<Class<?>, AnnotatedAnnotation<?>> annotations;
+ private final ConcurrentCache<Class<?>, WBClass<?>> classes;
+ private final ConcurrentCache<Class<?>, WBAnnotation<?>> annotations;
private final ClassTransformer transformer = this;
/**
@@ -38,31 +38,31 @@
*/
public ClassTransformer()
{
- classes = new ConcurrentCache<Class<?>, AnnotatedClass<?>>();
- annotations = new ConcurrentCache<Class<?>, AnnotatedAnnotation<?>>();
+ classes = new ConcurrentCache<Class<?>, WBClass<?>>();
+ annotations = new ConcurrentCache<Class<?>, WBAnnotation<?>>();
}
- public <T> AnnotatedClass<T> classForName(final Class<T> clazz)
+ public <T> WBClass<T> classForName(final Class<T> clazz)
{
- return classes.putIfAbsent(clazz, new Callable<AnnotatedClass<T>>()
+ return classes.putIfAbsent(clazz, new Callable<WBClass<T>>()
{
- public AnnotatedClass<T> call() throws Exception
+ public WBClass<T> call() throws Exception
{
- return AnnotatedClassImpl.of(clazz, transformer);
+ return WBClassImpl.of(clazz, transformer);
}
});
}
- public <T extends Annotation> AnnotatedAnnotation<T> classForName(final Class<T> clazz)
+ public <T extends Annotation> WBAnnotation<T> classForName(final Class<T> clazz)
{
- return annotations.putIfAbsent(clazz, new Callable<AnnotatedAnnotation<T>>()
+ return annotations.putIfAbsent(clazz, new Callable<WBAnnotation<T>>()
{
- public AnnotatedAnnotation<T> call() throws Exception
+ public WBAnnotation<T> call() throws Exception
{
- return AnnotatedAnnotationImpl.of(clazz, transformer);
+ return WBAnnotationImpl.of(clazz, transformer);
}
});
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -30,8 +30,8 @@
import org.jboss.webbeans.bean.EnterpriseBean;
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.injection.FieldInjectionPoint;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.AnnotatedField;
+import org.jboss.webbeans.introspector.WBClass;
+import org.jboss.webbeans.introspector.WBField;
import org.jboss.webbeans.metadata.BindingTypeModel;
import org.jboss.webbeans.metadata.MetaDataCache;
@@ -80,21 +80,21 @@
}
}
- public static Set<FieldInjectionPoint<?>> getFieldInjectionPoints(AnnotatedClass<?> annotatedItem, Bean<?> declaringBean)
+ public static Set<FieldInjectionPoint<?>> getFieldInjectionPoints(WBClass<?> annotatedItem, Bean<?> declaringBean)
{
Set<FieldInjectionPoint<?>> injectableFields = new HashSet<FieldInjectionPoint<?>>();
- for (AnnotatedField<?> annotatedField : annotatedItem.getMetaAnnotatedFields(BindingType.class))
+ for (WBField<?> annotatedField : annotatedItem.getMetaAnnotatedFields(BindingType.class))
{
addFieldInjectionPoint(annotatedField, injectableFields, declaringBean);
}
- for (AnnotatedField<?> annotatedField : annotatedItem.getAnnotatedFields(Decorates.class))
+ for (WBField<?> annotatedField : annotatedItem.getAnnotatedFields(Decorates.class))
{
addFieldInjectionPoint(annotatedField, injectableFields, declaringBean);
}
return injectableFields;
}
- private static void addFieldInjectionPoint(AnnotatedField<?> annotatedField, Set<FieldInjectionPoint<?>> injectableFields, Bean<?> declaringBean)
+ private static void addFieldInjectionPoint(WBField<?> annotatedField, Set<FieldInjectionPoint<?>> injectableFields, Bean<?> declaringBean)
{
if (!annotatedField.isAnnotationPresent(Produces.class))
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -9,7 +9,7 @@
import org.jboss.testharness.impl.packaging.PackagingType;
import org.jboss.webbeans.bean.EnterpriseBean;
import org.jboss.webbeans.bean.NewEnterpriseBean;
-import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.literal.NewLiteral;
import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@@ -54,8 +54,8 @@
public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
{
initNewBean();
- Set<? extends AnnotatedItem<?, ?>> wrappedBeanInjectionPoints = wrappedEnterpriseBean.getAnnotatedInjectionPoints();
- Set<? extends AnnotatedItem<?, ?>> newBeanInjectionPoints = newEnterpriseBean.getAnnotatedInjectionPoints();
+ Set<? extends WBAnnotated<?, ?>> wrappedBeanInjectionPoints = wrappedEnterpriseBean.getAnnotatedInjectionPoints();
+ Set<? extends WBAnnotated<?, ?>> newBeanInjectionPoints = newEnterpriseBean.getAnnotatedInjectionPoints();
assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -9,8 +9,8 @@
import javax.enterprise.inject.deployment.Production;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.webbeans.introspector.AnnotatedClass;
-import org.jboss.webbeans.introspector.jlr.AnnotatedClassImpl;
+import org.jboss.webbeans.introspector.WBClass;
+import org.jboss.webbeans.introspector.jlr.WBClassImpl;
import org.jboss.webbeans.resources.ClassTransformer;
import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@@ -24,7 +24,7 @@
@Test
public void testDeclaredAnnotations()
{
- AnnotatedClass<Order> annotatedElement = AnnotatedClassImpl.of(Order.class, transformer);
+ WBClass<Order> annotatedElement = WBClassImpl.of(Order.class, transformer);
assert annotatedElement.getAnnotations().size() == 1;
assert annotatedElement.getAnnotation(Production.class) != null;
assert annotatedElement.getRawType().equals(Order.class);
@@ -33,7 +33,7 @@
@Test
public void testMetaAnnotations()
{
- AnnotatedClass<Order> annotatedElement = AnnotatedClassImpl.of(Order.class, transformer);
+ WBClass<Order> annotatedElement = WBClassImpl.of(Order.class, transformer);
Set<Annotation> annotations = annotatedElement.getMetaAnnotations(DeploymentType.class);
assert annotations.size() == 1;
Iterator<Annotation> it = annotations.iterator();
@@ -44,10 +44,10 @@
@Test
public void testEmpty()
{
- AnnotatedClass<Order> annotatedElement = AnnotatedClassImpl.of(Order.class, transformer);
+ WBClass<Order> annotatedElement = WBClassImpl.of(Order.class, transformer);
assert annotatedElement.getAnnotation(Stereotype.class) == null;
assert annotatedElement.getMetaAnnotations(Stereotype.class).size() == 0;
- AnnotatedClass<Antelope> classWithNoAnnotations = AnnotatedClassImpl.of(Antelope.class, transformer);
+ WBClass<Antelope> classWithNoAnnotations = WBClassImpl.of(Antelope.class, transformer);
assert classWithNoAnnotations.getAnnotations().size() == 0;
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java 2009-06-12 22:30:21 UTC (rev 2827)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/newsimple/NewSimpleBeanTest.java 2009-06-12 22:38:33 UTC (rev 2828)
@@ -7,7 +7,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.webbeans.bean.NewSimpleBean;
import org.jboss.webbeans.bean.SimpleBean;
-import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.introspector.WBAnnotated;
import org.jboss.webbeans.literal.NewLiteral;
import org.jboss.webbeans.test.AbstractWebBeansTest;
import org.testng.annotations.Test;
@@ -63,8 +63,8 @@
public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
{
initNewBean();
- Set<? extends AnnotatedItem<?, ?>> wrappedBeanInjectionPoints = wrappedSimpleBean.getAnnotatedInjectionPoints();
- Set<? extends AnnotatedItem<?, ?>> newBeanInjectionPoints = newSimpleBean.getAnnotatedInjectionPoints();
+ Set<? extends WBAnnotated<?, ?>> wrappedBeanInjectionPoints = wrappedSimpleBean.getAnnotatedInjectionPoints();
+ Set<? extends WBAnnotated<?, ?>> newBeanInjectionPoints = newSimpleBean.getAnnotatedInjectionPoints();
assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
}
14 years, 10 months
[webbeans-commits] Webbeans SVN: r2827 - ri/trunk/impl/src/main/java/org/jboss/webbeans and 23 other directories.
by webbeans-commits@lists.jboss.org
Author: pete.muir(a)jboss.org
Date: 2009-06-12 18:30:21 -0400 (Fri, 12 Jun 2009)
New Revision: 2827
Added:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingDecorator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanResolvableTransformer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedAdaptor.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ForwardingResolvable.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolovableTransformer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolvable.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Car.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanAnnotatedItemTransformer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/AnnotatedItemTransformer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableAnnotatedItem.java
Modified:
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Annotated.java
ri/trunk/api/src/main/java/javax/enterprise/inject/spi/InjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableAnnotatedClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedClass.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Proxies.java
ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java
ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java
ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/helpers/AbstractResourceServices.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/FiresOnNonEventTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/FiresOnEventWithoutTypeTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Animal.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/noninstance/NonInstanceTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/notypeparam/NoTypeParameterSpecifiedTest.java
tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
Log:
Big update to resolver to allow for use in other situations (decorators), mark various tests as broken, fix decorator init
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Annotated.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Annotated.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/Annotated.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -5,7 +5,7 @@
import java.util.Set;
public interface Annotated {
- Type getType();
+ public Type getType();
public <T extends Annotation> T getAnnotation(Class<T> annotationType);
public Set<Annotation> getAnnotations();
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType);
Modified: ri/trunk/api/src/main/java/javax/enterprise/inject/spi/InjectionPoint.java
===================================================================
--- ri/trunk/api/src/main/java/javax/enterprise/inject/spi/InjectionPoint.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/api/src/main/java/javax/enterprise/inject/spi/InjectionPoint.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -75,35 +75,9 @@
*/
public Member getMember();
- /**
- * Get the annotation instance for the given annotation type of the field in
- * the case of field injection, or annotations of the parameter in the case
- * of method parameter or constructor parameter injection.
- *
- * @param <T>
- * the type of the annotation
- * @param annotationType
- * the type of the annotation
- * @return the annotation of the specified annotationType, or null if no such
- * annotation exists
- */
- public <T extends Annotation> T getAnnotation(Class<T> annotationType);
+ public Annotated getAnnotated();
- /**
- * Get the annotations of the field in the case of field injection, or
- * annotations of the parameter in the case of method parameter or
- * constructor parameter injection.
- *
- * @return the annotations of the field
- */
- public Annotation[] getAnnotations();
+ public boolean isDelegate();
- /**
- * Determine if the specified annotation is present on the injection point
- *
- * @param annotationType
- * the type of the annotation
- * @return true if an annotation of the specified type is present, else false
- */
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType);
+ public boolean isTransient();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanManagerImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -66,7 +66,7 @@
import javax.inject.DeploymentException;
import javax.inject.DuplicateBindingTypeException;
-import org.jboss.webbeans.bean.DisposalMethodBean;
+import org.jboss.webbeans.bean.DecoratorBean;
import org.jboss.webbeans.bean.EnterpriseBean;
import org.jboss.webbeans.bean.NewEnterpriseBean;
import org.jboss.webbeans.bean.RIBean;
@@ -81,6 +81,7 @@
import org.jboss.webbeans.event.ObserverImpl;
import org.jboss.webbeans.injection.NonContextualInjector;
import org.jboss.webbeans.injection.resolution.ResolvableAnnotatedClass;
+import org.jboss.webbeans.injection.resolution.ResolvableFactory;
import org.jboss.webbeans.injection.resolution.Resolver;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.log.Log;
@@ -190,6 +191,7 @@
*/
private transient final EventManager eventManager;
private transient final Resolver resolver;
+ private transient final Resolver decoratorResolver;
private final transient NonContextualInjector nonContextualInjector;
private final transient ELResolver webbeansELResolver;
@@ -198,7 +200,8 @@
* ********************************
*/
private transient final ThreadLocal<Stack<InjectionPoint>> currentInjectionPoint;
- private transient List<Bean<?>> beanWithManagers;
+ private transient final List<Bean<?>> beans;
+ private transient final List<Decorator<?>> decorators;
private final transient Namespace rootNamespace;
private final transient ConcurrentSetMultiMap<Type, EventObserver<?>> registeredObservers;
private final transient Set<BeanManagerImpl> childActivities;
@@ -220,6 +223,7 @@
return new BeanManagerImpl(
serviceRegistry,
new CopyOnWriteArrayList<Bean<?>>(),
+ new CopyOnWriteArrayList<Decorator<?>>(),
new ConcurrentSetHashMultiMap<Type, EventObserver<?>>(),
new Namespace(),
new ConcurrentHashMap<Class<?>, EnterpriseBean<?>>(),
@@ -251,6 +255,7 @@
return new BeanManagerImpl(
parentManager.getServices(),
beans,
+ parentManager.getDecorators(),
registeredObservers,
rootNamespace,
parentManager.getNewEnterpriseBeanMap(),
@@ -272,6 +277,7 @@
private BeanManagerImpl(
ServiceRegistry serviceRegistry,
List<Bean<?>> beans,
+ List<Decorator<?>> decorators,
ConcurrentSetMultiMap<Type, EventObserver<?>> registeredObservers,
Namespace rootNamespace,
Map<Class<?>, EnterpriseBean<?>> newEnterpriseBeans,
@@ -285,7 +291,8 @@
)
{
this.services = serviceRegistry;
- this.beanWithManagers = beans;
+ this.beans = beans;
+ this.decorators = decorators;
this.newEnterpriseBeans = newEnterpriseBeans;
this.riBeans = riBeans;
this.clientProxyProvider = clientProxyProvider;
@@ -298,7 +305,8 @@
this.ids = ids;
this.id = ids.incrementAndGet();
- this.resolver = new Resolver(this);
+ this.resolver = new Resolver(this, beans);
+ this.decoratorResolver = new Resolver(this, decorators);
this.eventManager = new EventManager(this);
this.nonContextualInjector = new NonContextualInjector(this);
this.webbeansELResolver = new WebBeansELResolverImpl(this);
@@ -346,12 +354,12 @@
*/
public void addBean(Bean<?> bean)
{
- if (beanWithManagers.contains(bean))
+ if (beans.contains(bean))
{
return;
}
resolver.clear();
- beanWithManagers.add(bean);
+ beans.add(bean);
registerBeanNamespace(bean);
for (BeanManagerImpl childActivity : childActivities)
{
@@ -360,29 +368,6 @@
return;
}
- /**
- * Resolve the disposal method for the given producer method. For internal
- * use.
- *
- * @param apiType The API type to match
- * @param bindings The binding types to match
- * @return The set of matching disposal methods
- */
- public <T> Set<DisposalMethodBean<T>> resolveDisposalBeans(Class<T> apiType, Annotation... bindings)
- {
- // Correct?
- Set<Bean<?>> beans = getBeans(apiType, bindings);
- Set<DisposalMethodBean<T>> disposalBeans = new HashSet<DisposalMethodBean<T>>();
- for (Bean<?> bean : beans)
- {
- if (bean instanceof DisposalMethodBean)
- {
- disposalBeans.add((DisposalMethodBean<T>) bean);
- }
- }
- return disposalBeans;
- }
-
public <T> Set<Observer<T>> resolveObservers(T event, Annotation... bindings)
{
Class<?> clazz = event.getClass();
@@ -465,12 +450,12 @@
public Set<Bean<?>> getBeans(Type beanType, Annotation... bindings)
{
- return getBeans(ResolvableAnnotatedClass.of(beanType, bindings), bindings);
+ return getBeans(ResolvableAnnotatedClass.of(beanType, bindings, this), bindings);
}
public Set<Bean<?>> getBeans(AnnotatedItem<?, ?> element, Annotation... bindings)
{
- for (Annotation annotation : element.getAnnotationsAsSet())
+ for (Annotation annotation : element.getAnnotations())
{
if (!getServices().get(MetaDataCache.class).getBindingTypeModel(annotation.annotationType()).isValid())
{
@@ -492,7 +477,7 @@
{
throw new DuplicateBindingTypeException("Duplicate bindings (" + Arrays.asList(bindings) + ") type passed " + element.toString());
}
- return resolver.get(element);
+ return resolver.get(ResolvableFactory.of(element));
}
public Set<Bean<?>> getBeans(InjectionPoint injectionPoint)
@@ -505,7 +490,7 @@
currentInjectionPoint.get().push(injectionPoint);
}
// TODO Do this properly
- return getBeans(ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0])));
+ return getBeans(ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]), this));
}
finally
{
@@ -530,15 +515,19 @@
{
synchronized (beans)
{
- this.beanWithManagers = new CopyOnWriteArrayList<Bean<?>>(beans);
for (RIBean<?> bean : beans)
{
if (bean instanceof NewEnterpriseBean)
{
newEnterpriseBeans.put(bean.getType(), (EnterpriseBean<?>) bean);
}
+ if (bean instanceof DecoratorBean)
+ {
+ decorators.add(DecoratorBean.wrapForResolver((Decorator<?>) bean));
+ }
riBeans.put(bean.getId(), bean);
registerBeanNamespace(bean);
+ this.beans.add(bean);
}
resolver.clear();
}
@@ -575,8 +564,13 @@
*/
public List<Bean<?>> getBeans()
{
- return Collections.unmodifiableList(beanWithManagers);
+ return Collections.unmodifiableList(beans);
}
+
+ public List<Decorator<?>> getDecorators()
+ {
+ return Collections.unmodifiableList(decorators);
+ }
public Map<String, RIBean<?>> getRiBeans()
{
@@ -749,7 +743,7 @@
{
currentInjectionPoint.get().push(injectionPoint);
}
- AnnotatedItem<?, ?> element = ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]));
+ AnnotatedItem<?, ?> element = ResolvableAnnotatedClass.of(injectionPoint.getType(), injectionPoint.getBindings().toArray(new Annotation[0]), this);
Bean<?> resolvedBean = getBean(element, element.getBindingsAsArray());
if (getServices().get(MetaDataCache.class).getScopeModel(resolvedBean.getScopeType()).isNormal() && !Proxies.isTypeProxyable(injectionPoint.getType()))
{
@@ -794,7 +788,7 @@
@Deprecated
public <T> T getInstanceByType(Class<T> type, Annotation... bindings)
{
- AnnotatedItem<T, ?> element = ResolvableAnnotatedClass.of(type, bindings);
+ AnnotatedItem<T, ?> element = ResolvableAnnotatedClass.of(type, bindings, this);
return (T) getReference(getBean(element, bindings), type);
}
@@ -824,19 +818,23 @@
}
/**
- * Resolves a list of decorators based on API types and binding types Os
+ * Resolves a list of decorators based on API types and binding types
*
* @param types The set of API types to match
* @param bindings The binding types to match
* @return A list of matching decorators
*
- * @see javax.enterprise.inject.spi.BeanManager#resolveDecorators(java.util.Set,
- * java.lang.annotation.Annotation[])
+ * @see javax.enterprise.inject.spi.BeanManager#resolveDecorators(java.util.Set, java.lang.annotation.Annotation[])
*/
public List<Decorator<?>> resolveDecorators(Set<Type> types, Annotation... bindings)
{
throw new UnsupportedOperationException();
}
+
+ public List<Decorator<?>> resolveDecorators(Bean<?> bean)
+ {
+ throw new UnsupportedOperationException();
+ }
/**
* Resolves a list of interceptors based on interception type and interceptor
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/BeanValidator.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -28,6 +28,7 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.AmbiguousResolutionException;
+import javax.enterprise.inject.Any;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.New;
import javax.enterprise.inject.UnproxyableResolutionException;
@@ -35,7 +36,6 @@
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
import javax.event.Event;
-import javax.enterprise.inject.Any;
import javax.inject.DefinitionException;
import javax.inject.InconsistentSpecializationException;
import javax.inject.NullableDependencyException;
@@ -82,7 +82,7 @@
{
for (InjectionPoint injectionPoint : bean.getInjectionPoints())
{
- if (injectionPoint.getAnnotation(New.class) != null && injectionPoint.getBindings().size() > 1)
+ if (injectionPoint.getAnnotated().getAnnotation(New.class) != null && injectionPoint.getBindings().size() > 1)
{
throw new DefinitionException("The injection point " + injectionPoint + " is annotated with @New which cannot be combined with other binding types");
}
@@ -104,7 +104,7 @@
checkFacadeInjectionPoint(injectionPoint, Obtains.class, Instance.class);
checkFacadeInjectionPoint(injectionPoint, Any.class, Event.class);
Annotation[] bindings = injectionPoint.getBindings().toArray(new Annotation[0]);
- AnnotatedItem<?, ?> annotatedItem = ResolvableAnnotatedClass.of(injectionPoint.getType(), bindings);
+ AnnotatedItem<?, ?> annotatedItem = ResolvableAnnotatedClass.of(injectionPoint.getType(), bindings, manager);
Set<?> resolvedBeans = manager.getBeans(injectionPoint);
if (resolvedBeans.isEmpty())
{
@@ -161,7 +161,7 @@
private void checkFacadeInjectionPoint(InjectionPoint injectionPoint, Class<? extends Annotation> annotationType, Class<?> type)
{
- if (injectionPoint.isAnnotationPresent(annotationType))
+ if (injectionPoint.getAnnotated().isAnnotationPresent(annotationType))
{
if (injectionPoint.getType() instanceof ParameterizedType)
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/InstanceImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -51,7 +51,7 @@
public T get(Annotation... bindings)
{
Annotation[] annotations = mergeInBindings(bindings);
- Bean<T> bean = getManager().getBean(ResolvableAnnotatedClass.<T>of(getType(), annotations), annotations);
+ Bean<T> bean = getManager().getBean(ResolvableAnnotatedClass.<T>of(getType(), annotations, getManager()), annotations);
@SuppressWarnings("unchecked")
T instance = (T) getManager().getReference(bean, getType());
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractBean.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -62,7 +62,8 @@
public abstract class AbstractBean<T, E> extends RIBean<T>
{
- private static final Annotation ANY_BINDING = new AnyLiteral();
+ private static final Annotation ANY_LITERAL = new AnyLiteral();
+ private static final Annotation CURRENT_LITERAL = new CurrentLiteral();
@SuppressWarnings("unchecked")
private static Set<Class<?>> STANDARD_WEB_BEAN_CLASSES = new HashSet<Class<?>>(Arrays.asList(Event.class, BeanManagerImpl.class, ConversationImpl.class));
@@ -211,6 +212,7 @@
this.bindings = new HashSet<Annotation>();
this.bindings.addAll(getAnnotatedItem().getMetaAnnotations(BindingType.class));
initDefaultBindings();
+ log.trace("Using binding types " + bindings + " specified by annotations");
}
protected abstract void initInjectionPoints();
@@ -220,18 +222,9 @@
if (bindings.size() == 0)
{
log.trace("Adding default @Current binding type");
- this.bindings.add(new CurrentLiteral());
- this.bindings.add(ANY_BINDING);
+ this.bindings.add(CURRENT_LITERAL);
}
- else
- {
- if (!bindings.contains(ANY_BINDING))
- {
- bindings.add(ANY_BINDING);
- }
- if (log.isTraceEnabled())
- log.trace("Using binding types " + bindings + " specified by annotations");
- }
+ this.bindings.add(ANY_LITERAL);
}
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/AbstractClassBean.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -43,7 +43,6 @@
import org.jboss.webbeans.log.LogProvider;
import org.jboss.webbeans.log.Logging;
import org.jboss.webbeans.util.Beans;
-import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.Strings;
/**
@@ -267,13 +266,7 @@
/**
* Validates the bean implementation
*/
- protected void checkBeanImplementation()
- {
- if (Reflections.isAbstract(getType()))
- {
- throw new DefinitionException("Web Bean implementation class " + type + " cannot be declared abstract");
- }
- }
+ protected void checkBeanImplementation() {}
@Override
protected void preSpecialize(BeanDeployerEnvironment environment)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DecoratorBean.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -5,6 +5,7 @@
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Arrays;
+import java.util.HashSet;
import java.util.Set;
import javax.enterprise.inject.Initializer;
@@ -21,6 +22,32 @@
public class DecoratorBean<T> extends SimpleBean<T> implements Decorator<T>
{
+ public static <T> Decorator<T> wrapForResolver(final Decorator<T> decorator)
+ {
+ return new ForwardingDecorator<T>()
+ {
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return delegate().getDelegateBindings();
+ }
+
+ @Override
+ public Set<Type> getTypes()
+ {
+ return delegate().getTypes();
+ }
+
+ @Override
+ protected Decorator<T> delegate()
+ {
+ return decorator;
+ }
+
+ };
+ }
+
/**
* Creates a decorator bean
*
@@ -50,8 +77,7 @@
if (!isInitialized())
{
super.initialize(environment);
- checkDecorates();
- initDecorates();
+ initDelegate();
initDecoratedTypes();
initDelegateBindings();
initDelegateType();
@@ -60,11 +86,12 @@
protected void initDecoratedTypes()
{
- this.decoratedTypes = getAnnotatedItem().getInterfaceOnlyFlattenedTypeHierarchy();
+ this.decoratedTypes = new HashSet<Type>();
+ this.decoratedTypes.addAll(getAnnotatedItem().getInterfaceOnlyFlattenedTypeHierarchy());
this.decoratedTypes.remove(Serializable.class);
}
- protected void initDecorates()
+ protected void initDelegate()
{
this.decorates = getDecoratesInjectionPoint().iterator().next();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/DisposalMethodBean.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -173,6 +173,12 @@
{
return declaringBean.isSerializable();
}
+
+ @Override
+ public boolean isProxyable()
+ {
+ return true;
+ }
public T create(CreationalContext<T> creationalContext)
{
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingDecorator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingDecorator.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingDecorator.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -0,0 +1,30 @@
+package org.jboss.webbeans.bean;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Decorator;
+
+public abstract class ForwardingDecorator<T> extends ForwardingBean<T> implements Decorator<T>
+{
+
+ @Override
+ protected abstract Decorator<T> delegate();
+
+ public Set<Type> getDecoratedTypes()
+ {
+ return delegate().getDecoratedTypes();
+ }
+
+ public Set<Annotation> getDelegateBindings()
+ {
+ return delegate().getDelegateBindings();
+ }
+
+ public Type getDelegateType()
+ {
+ return delegate().getDelegateType();
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ForwardingDecorator.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/ProducerMethodBean.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -16,7 +16,6 @@
*/
package org.jboss.webbeans.bean;
-import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.util.Set;
@@ -161,7 +160,7 @@
*/
protected void initDisposalMethod(BeanDeployerEnvironment environment)
{
- Set<DisposalMethodBean<T>> disposalBeans = manager.resolveDisposalBeans(getType(), bindings.toArray(new Annotation[0]));
+ Set<DisposalMethodBean<T>> disposalBeans = environment.resolveDisposalBeans(getAnnotatedItem());
if (disposalBeans.size() == 1)
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/EventBean.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -28,7 +28,7 @@
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.event.EventImpl;
-import org.jboss.webbeans.injection.resolution.AnnotatedItemTransformer;
+import org.jboss.webbeans.injection.resolution.ResolovableTransformer;
import org.jboss.webbeans.literal.AnyLiteral;
public class EventBean extends AbstractFacadeBean<Event<?>>
@@ -38,7 +38,7 @@
private static final Set<Type> DEFAULT_TYPES = new HashSet<Type>(Arrays.asList(TYPE, Object.class));
private static final Annotation ANY = new AnyLiteral();
private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(ANY));
- public static final AnnotatedItemTransformer TRANSFORMER = new FacadeBeanAnnotatedItemTransformer(Event.class, ANY);
+ public static final ResolovableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(Event.class, ANY);
private static final Set<Class<? extends Annotation>> FILTERED_ANNOTATION_TYPES = new HashSet<Class<? extends Annotation>>(Arrays.asList(Obtains.class));
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanAnnotatedItemTransformer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanAnnotatedItemTransformer.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanAnnotatedItemTransformer.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -1,113 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.bean.standard;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import javax.event.Event;
-
-import org.jboss.webbeans.injection.resolution.AnnotatedItemTransformer;
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.introspector.ForwardingAnnotatedItem;
-
-/**
- * AnnotatedItem transformer which can be used for FacadeBeans
- *
- * @author Pete Muir
- *
- */
-public class FacadeBeanAnnotatedItemTransformer implements AnnotatedItemTransformer
-{
-
- private final Class<?> clazz;
- private final Annotation annotation;
- private final Set<Annotation> annotations;
- private final Set<Type> flattenedTypes;
-
- public FacadeBeanAnnotatedItemTransformer(Class<?> clazz, Annotation annotation)
- {
- this.clazz = clazz;
- this.annotation = annotation;
- this.annotations = new HashSet<Annotation>(Arrays.asList(annotation));
- Type[] types = {Object.class, Event.class};
- this.flattenedTypes = new HashSet<Type>(Arrays.asList(types));
- }
-
- public <T, S> AnnotatedItem<T, S> transform(final AnnotatedItem<T, S> element)
- {
- if (clazz.isAssignableFrom(element.getRawType()))
- {
- if (element.isAnnotationPresent(annotation.annotationType()))
- {
-
- return new ForwardingAnnotatedItem<T, S>()
- {
-
- @Override
- public Type[] getActualTypeArguments()
- {
- return new Type[0];
- }
-
- @Override
- public Set<Annotation> getBindings()
- {
- return annotations;
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Class<T> getRawType()
- {
- return (Class<T>) clazz;
- }
-
- @Override
- public Type getType()
- {
- return clazz;
- }
-
- @Override
- public Set<Type> getFlattenedTypeHierarchy()
- {
- return flattenedTypes;
- }
-
- @Override
- public AnnotatedItem<T, S> delegate()
- {
- return element;
- }
-
- @Override
- public boolean isAssignableFrom(Set<? extends Type> types)
- {
- return types.contains(clazz);
- }
-
- };
- }
- }
- return element;
- }
-
-}
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanResolvableTransformer.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanAnnotatedItemTransformer.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanResolvableTransformer.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanResolvableTransformer.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -0,0 +1,99 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.bean.standard;
+
+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 org.jboss.webbeans.injection.resolution.ForwardingResolvable;
+import org.jboss.webbeans.injection.resolution.ResolovableTransformer;
+import org.jboss.webbeans.injection.resolution.Resolvable;
+
+/**
+ * AnnotatedItem transformer which can be used for FacadeBeans
+ *
+ * @author Pete Muir
+ *
+ */
+public class FacadeBeanResolvableTransformer implements ResolovableTransformer
+{
+
+ private final Class<?> clazz;
+ private final Annotation annotation;
+ private final Set<Annotation> bindings;
+ private final HashSet<Type> types;
+
+ public FacadeBeanResolvableTransformer(Class<?> clazz, Annotation annotation)
+ {
+ this.clazz = clazz;
+ this.annotation = annotation;
+ this.bindings = new HashSet<Annotation>(Arrays.asList(annotation));
+ this.types = new HashSet<Type>();
+ types.add(clazz);
+ }
+
+ public Resolvable transform(final Resolvable resolvable)
+ {
+ if (resolvable.isAssignableTo(clazz))
+ {
+ if (resolvable.isAnnotationPresent(annotation.annotationType()))
+ {
+
+ return new ForwardingResolvable()
+ {
+
+ @Override
+ protected Resolvable delegate()
+ {
+ return resolvable;
+ }
+
+ @Override
+ public Set<Annotation> getBindings()
+ {
+ return Collections.unmodifiableSet(bindings);
+ }
+
+ @Override
+ public Set<Type> getTypes()
+ {
+ return Collections.unmodifiableSet(types);
+ }
+
+ @Override
+ public boolean isAssignableTo(Class<?> clazz)
+ {
+ return clazz.isAssignableFrom(clazz);
+ }
+
+ @Override
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return annotation.annotationType().equals(annotationType);
+ }
+
+ };
+ }
+ }
+ return resolvable;
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/FacadeBeanResolvableTransformer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bean/standard/InstanceBean.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -28,7 +28,7 @@
import org.jboss.webbeans.InstanceImpl;
import org.jboss.webbeans.BeanManagerImpl;
-import org.jboss.webbeans.injection.resolution.AnnotatedItemTransformer;
+import org.jboss.webbeans.injection.resolution.ResolovableTransformer;
import org.jboss.webbeans.literal.ObtainsLiteral;
public class InstanceBean extends AbstractFacadeBean<Instance<?>>
@@ -39,7 +39,7 @@
private static final Obtains OBTAINS = new ObtainsLiteral();
private static final Set<Annotation> DEFAULT_BINDINGS = new HashSet<Annotation>(Arrays.asList(OBTAINS));
private static final Set<Class<? extends Annotation>> FILTERED_ANNOTATION_TYPES = new HashSet<Class<? extends Annotation>>(Arrays.asList(Obtains.class));
- public static final AnnotatedItemTransformer TRANSFORMER = new FacadeBeanAnnotatedItemTransformer(TYPE, OBTAINS);
+ public static final ResolovableTransformer TRANSFORMER = new FacadeBeanResolvableTransformer(TYPE, OBTAINS);
public static AbstractFacadeBean<Instance<?>> of(BeanManagerImpl manager)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployer.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -72,7 +72,7 @@
public BeanDeployer(BeanManagerImpl manager, EjbDescriptorCache ejbDescriptors)
{
this.manager = manager;
- this.environment = new BeanDeployerEnvironment(ejbDescriptors);
+ this.environment = new BeanDeployerEnvironment(ejbDescriptors, manager);
this.classes = new HashSet<AnnotatedClass<?>>();
this.classTransformer = new ClassTransformer();
}
@@ -224,9 +224,7 @@
for (AnnotatedMethod<?> method : annotatedClass.getDeclaredMethodsWithAnnotatedParameters(Disposes.class))
{
DisposalMethodBean<?> disposalBean = DisposalMethodBean.of(manager, method, declaringBean);
- environment.addAllDisposalBean(disposalBean);
- manager.getResolver().addInjectionPoints(disposalBean.getAnnotatedInjectionPoints());
- manager.addBean(disposalBean);
+ environment.addDisposalBean(disposalBean);
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/bootstrap/BeanDeployerEnvironment.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -16,13 +16,17 @@
*/
package org.jboss.webbeans.bootstrap;
-import java.lang.annotation.Annotation;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Set;
+import javax.enterprise.inject.spi.Bean;
+
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.AbstractClassBean;
import org.jboss.webbeans.bean.DisposalMethodBean;
import org.jboss.webbeans.bean.NewBean;
@@ -30,7 +34,8 @@
import org.jboss.webbeans.bean.RIBean;
import org.jboss.webbeans.ejb.EjbDescriptorCache;
import org.jboss.webbeans.event.ObserverImpl;
-import org.jboss.webbeans.injection.resolution.ResolvableAnnotatedClass;
+import org.jboss.webbeans.injection.resolution.ResolvableFactory;
+import org.jboss.webbeans.injection.resolution.Resolver;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.AnnotatedMethod;
@@ -38,27 +43,29 @@
public class BeanDeployerEnvironment
{
- private static final AnnotatedItem<?, ?> OTHER_BEANS_ANNOTATED_ITEM = ResolvableAnnotatedClass.of(BeanDeployerEnvironment.class, new Annotation[0]);
-
private final Map<AnnotatedClass<?>, AbstractClassBean<?>> classBeanMap;
private final Map<AnnotatedMethod<?>, ProducerMethodBean<?>> producerMethodBeanMap;
private final Map<AnnotatedMethod<?>, DisposalMethodBean<?>> disposalMethodBeanMap;
private final Set<RIBean<?>> beans;
private final Set<ObserverImpl<?>> observers;
- private final Set<DisposalMethodBean<?>> allDisposalBeans;
+ private final List<DisposalMethodBean<?>> allDisposalBeans;
private final Set<DisposalMethodBean<?>> resolvedDisposalBeans;
private final EjbDescriptorCache ejbDescriptors;
+ private final Resolver disposalMethodResolver;
+ private final BeanManagerImpl manager;
- public BeanDeployerEnvironment(EjbDescriptorCache ejbDescriptors)
+ public BeanDeployerEnvironment(EjbDescriptorCache ejbDescriptors, BeanManagerImpl manager)
{
this.classBeanMap = new HashMap<AnnotatedClass<?>, AbstractClassBean<?>>();
this.producerMethodBeanMap = new HashMap<AnnotatedMethod<?>, ProducerMethodBean<?>>();
this.disposalMethodBeanMap = new HashMap<AnnotatedMethod<?>, DisposalMethodBean<?>>();
- this.allDisposalBeans = new HashSet<DisposalMethodBean<?>>();
+ this.allDisposalBeans = new ArrayList<DisposalMethodBean<?>>();
this.resolvedDisposalBeans = new HashSet<DisposalMethodBean<?>>();
this.beans = new HashSet<RIBean<?>>();
this.observers = new HashSet<ObserverImpl<?>>();
this.ejbDescriptors = ejbDescriptors;
+ this.disposalMethodResolver = new Resolver(manager, allDisposalBeans);
+ this.manager = manager;
}
public ProducerMethodBean<?> getProducerMethod(AnnotatedMethod<?> method)
@@ -135,12 +142,12 @@
return observers;
}
- public Set<DisposalMethodBean<?>> getAllDisposalBeans()
+ public List<DisposalMethodBean<?>> getAllDisposalBeans()
{
return allDisposalBeans;
}
- public void addAllDisposalBean(DisposalMethodBean<?> disposalBean)
+ public void addDisposalBean(DisposalMethodBean<?> disposalBean)
{
allDisposalBeans.add(disposalBean);
}
@@ -159,5 +166,28 @@
{
return ejbDescriptors;
}
+
+ /**
+ * Resolve the disposal method for the given producer method. For internal
+ * use.
+ *
+ * @param apiType The API type to match
+ * @param bindings The binding types to match
+ * @return The set of matching disposal methods
+ */
+ public <T> Set<DisposalMethodBean<T>> resolveDisposalBeans(AnnotatedItem<T, ?> annotatedItem)
+ {
+ // Correct?
+ Set<Bean<?>> beans = disposalMethodResolver.get(ResolvableFactory.of(annotatedItem));
+ Set<DisposalMethodBean<T>> disposalBeans = new HashSet<DisposalMethodBean<T>>();
+ for (Bean<?> bean : beans)
+ {
+ if (bean instanceof DisposalMethodBean)
+ {
+ disposalBeans.add((DisposalMethodBean<T>) bean);
+ }
+ }
+ return disposalBeans;
+ }
}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedAdaptor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedAdaptor.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedAdaptor.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -0,0 +1,43 @@
+package org.jboss.webbeans.injection;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.Annotated;
+
+import org.jboss.webbeans.introspector.AnnotatedItem;
+
+public class AnnotatedAdaptor implements Annotated
+{
+
+ private final AnnotatedItem<?, ?> annotatedItem;
+
+ public AnnotatedAdaptor(AnnotatedItem<?, ?> annotatedItem)
+ {
+ this.annotatedItem = annotatedItem;
+ }
+
+ public <T extends Annotation> T getAnnotation(Class<T> annotationType)
+ {
+ return annotatedItem.getAnnotation(annotationType);
+ }
+
+ public Set<Annotation> getAnnotations()
+ {
+ return annotatedItem.getAnnotations();
+ }
+
+ public Type getType()
+ {
+ return annotatedItem.getType();
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return annotationType.isAnnotationPresent(annotationType);
+ }
+
+
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/AnnotatedAdaptor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ConstructorInjectionPoint.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -28,6 +28,7 @@
import java.util.Set;
import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
@@ -81,11 +82,6 @@
return constructor;
}
- public Annotation[] getAnnotations()
- {
- return delegate().getAnnotationStore().getAnnotations().toArray(EMPTY_ANNOTATION_ARRAY);
- }
-
public Bean<?> getBean()
{
return declaringBean;
@@ -180,4 +176,21 @@
return getRawType();
}
+ public Annotated getAnnotated()
+ {
+ return new AnnotatedAdaptor(delegate());
+ }
+
+ public boolean isDelegate()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isTransient()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/FieldInjectionPoint.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -23,6 +23,7 @@
import java.util.Set;
import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
@@ -54,11 +55,6 @@
return field;
}
- public Annotation[] getAnnotations()
- {
- return delegate().getAnnotationStore().getAnnotations().toArray(EMPTY_ANNOTATION_ARRAY);
- }
-
public Bean<?> getBean()
{
return declaringBean;
@@ -101,4 +97,15 @@
}
}
+ public Annotated getAnnotated()
+ {
+ return new AnnotatedAdaptor(delegate());
+ }
+
+ public boolean isDelegate()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/MethodInjectionPoint.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -27,6 +27,7 @@
import java.util.Set;
import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
@@ -80,11 +81,6 @@
return method;
}
- public Annotation[] getAnnotations()
- {
- return delegate().getAnnotationStore().getAnnotations().toArray(EMPTY_ANNOTATION_ARRAY);
- }
-
public Bean<?> getBean()
{
return declaringBean;
@@ -265,5 +261,22 @@
}
return parameterValues;
}
+
+ public Annotated getAnnotated()
+ {
+ return new AnnotatedAdaptor(delegate());
+ }
+
+ public boolean isDelegate()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isTransient()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/ParameterInjectionPoint.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -21,6 +21,7 @@
import java.util.Set;
import javax.enterprise.context.spi.CreationalContext;
+import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
@@ -52,11 +53,6 @@
return parameter;
}
- public Annotation[] getAnnotations()
- {
- return delegate().getAnnotationStore().getAnnotations().toArray(EMPTY_ANNOTATION_ARRAY);
- }
-
public Bean<?> getBean()
{
return declaringBean;
@@ -83,4 +79,21 @@
return (T) manager.getInjectableReference(this, creationalContext);
}
+ public Annotated getAnnotated()
+ {
+ return new AnnotatedAdaptor(delegate());
+ }
+
+ public boolean isDelegate()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isTransient()
+ {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
}
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/AnnotatedItemTransformer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/AnnotatedItemTransformer.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/AnnotatedItemTransformer.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -1,27 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.injection.resolution;
-
-import org.jboss.webbeans.introspector.AnnotatedItem;
-
-
-public interface AnnotatedItemTransformer
-{
-
- public <T, S> AnnotatedItem<T, S> transform(AnnotatedItem<T, S> element);
-
-}
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ForwardingResolvable.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ForwardingResolvable.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ForwardingResolvable.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -0,0 +1,32 @@
+package org.jboss.webbeans.injection.resolution;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+public abstract class ForwardingResolvable implements Resolvable
+{
+
+ protected abstract Resolvable delegate();
+
+ public Set<Annotation> getBindings()
+ {
+ return delegate().getBindings();
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return delegate().isAnnotationPresent(annotationType);
+ }
+
+ public Set<Type> getTypes()
+ {
+ return delegate().getTypes();
+ }
+
+ public boolean isAssignableTo(Class<?> clazz)
+ {
+ return delegate().isAssignableTo(clazz);
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ForwardingResolvable.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolovableTransformer.java (from rev 2821, ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/AnnotatedItemTransformer.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolovableTransformer.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolovableTransformer.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -0,0 +1,26 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.jboss.webbeans.injection.resolution;
+
+
+
+public interface ResolovableTransformer
+{
+
+ public Resolvable transform(Resolvable element);
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolovableTransformer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolvable.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolvable.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolvable.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -0,0 +1,24 @@
+package org.jboss.webbeans.injection.resolution;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+/**
+ * Something that is resovable by the resolver
+ *
+ * @author pmuir
+ *
+ */
+public interface Resolvable
+{
+
+ public Set<Annotation> getBindings();
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType);
+
+ public boolean isAssignableTo(Class<?> clazz);
+
+ public Set<Type> getTypes();
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolvable.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableAnnotatedClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableAnnotatedClass.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableAnnotatedClass.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -23,55 +23,46 @@
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.Arrays;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import javax.enterprise.inject.TypeLiteral;
import javax.enterprise.inject.spi.InjectionPoint;
+import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.injection.AnnotatedInjectionPoint;
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.introspector.jlr.AbstractAnnotatedItem;
import org.jboss.webbeans.util.Names;
+import org.jboss.webbeans.util.Reflections;
-public class ResolvableAnnotatedClass<T> extends AbstractAnnotatedItem<T, Class<T>>
+public class ResolvableAnnotatedClass<T> extends AbstractAnnotatedItem<T, Class<T>> implements Resolvable
{
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
+ private static final Set<Annotation> EMPTY_ANNOTATION_SET = Collections.emptySet();
+
private final Class<T> rawType;
+ private final Set<Type> types;
private final Type[] actualTypeArguments;
private final String _string;
- public static <T> AnnotatedItem<T, Class<T>> of(TypeLiteral<T> typeLiteral, Annotation[] annotations)
- {
- return new ResolvableAnnotatedClass<T>(typeLiteral.getRawType(), typeLiteral.getType(), annotations);
- }
+ private final BeanManagerImpl manager;
- public static <T> AnnotatedItem<T, Class<T>> of(Class<T> clazz, Annotation[] annotations)
+ public static <T> AnnotatedItem<T, Class<T>> of(TypeLiteral<T> typeLiteral, Annotation[] annotations, BeanManagerImpl manager)
{
- return new ResolvableAnnotatedClass<T>(clazz, clazz, annotations);
+ return new ResolvableAnnotatedClass<T>(typeLiteral.getType(), annotations, manager);
}
- public static <T> AnnotatedItem<T, Class<T>> of(Type type, Annotation[] annotations)
+ public static <T> AnnotatedItem<T, Class<T>> of(Type type, Annotation[] annotations, BeanManagerImpl manager)
{
- if (type instanceof Class)
- {
- return new ResolvableAnnotatedClass<T>((Class<T>) type, type, annotations);
- }
- else if (type instanceof ParameterizedType)
- {
- return new ResolvableAnnotatedClass<T>((Class<T>) ((ParameterizedType) type).getRawType(), type, annotations);
- }
- else
- {
- throw new UnsupportedOperationException("Cannot create annotated item of " + type);
- }
+ return new ResolvableAnnotatedClass<T>(type, annotations, manager);
}
-
-
- public static <T> AnnotatedItem<T, Class<T>> of(InjectionPoint injectionPoint)
+
+ public static <T> AnnotatedItem<T, Class<T>> of(InjectionPoint injectionPoint, BeanManagerImpl manager)
{
if (injectionPoint instanceof AnnotatedInjectionPoint)
{
@@ -81,19 +72,19 @@
}
else
{
- return of(injectionPoint.getType(), injectionPoint.getAnnotations());
+ return new ResolvableAnnotatedClass<T>(injectionPoint.getType(), injectionPoint.getAnnotated().getAnnotations(), manager);
}
}
- public static <T> AnnotatedItem<T, Class<T>> of(Member member, Annotation[] annotations)
+ public static <T> AnnotatedItem<T, Class<T>> of(Member member, Annotation[] annotations, BeanManagerImpl manager)
{
if (member instanceof Field)
{
- return new ResolvableAnnotatedClass<T>((Class<T>) ((Field) member).getType(), ((Field) member).getGenericType(), annotations);
+ return new ResolvableAnnotatedClass<T>(((Field) member).getGenericType(), annotations, manager);
}
else if (member instanceof Method)
{
- return new ResolvableAnnotatedClass<T>((Class<T>) ((Method) member).getReturnType(), ((Method) member).getGenericReturnType(), annotations);
+ return new ResolvableAnnotatedClass<T>(((Method) member).getGenericReturnType(), annotations, manager);
}
else
{
@@ -101,21 +92,49 @@
}
}
- private ResolvableAnnotatedClass(Class<T> rawType, Type type, Annotation[] annotations)
+ private ResolvableAnnotatedClass(Type type, AnnotationStore annotationStore, BeanManagerImpl manager)
{
- super(AnnotationStore.of(annotations, EMPTY_ANNOTATION_ARRAY));
- this.rawType = rawType;
+ super(annotationStore);
+
+ this.manager = manager;
+
if (type instanceof ParameterizedType)
{
+ ParameterizedType parameterizedType = (ParameterizedType) type;
+ if (parameterizedType.getRawType() instanceof Class)
+ {
+ this.rawType = (Class<T>) parameterizedType.getRawType();
+ }
+ else
+ {
+ throw new IllegalArgumentException("Cannot extract rawType from " + type);
+ }
this.actualTypeArguments = ((ParameterizedType) type).getActualTypeArguments();
- this._string = rawType.toString() + "<" + Arrays.asList(actualTypeArguments).toString() + ">; binding types = " + Names.annotationsToString(new HashSet<Annotation>(Arrays.asList(annotations)));
+ this._string = rawType.toString() + "<" + Arrays.asList(actualTypeArguments).toString() + ">; binding types = " + Names.annotationsToString(annotationStore.getBindings());
}
- else
+ else if (type instanceof Class)
{
+ this.rawType = (Class<T>) type;
this.actualTypeArguments = new Type[0];
- this._string = rawType.toString() +"; binding types = " + Names.annotationsToString(new HashSet<Annotation>(Arrays.asList(annotations)));
+ this._string = rawType.toString() +"; binding types = " + Names.annotationsToString(annotationStore.getBindings());
}
+ else
+ {
+ throw new IllegalArgumentException("Unable to extract type information from " + type);
+ }
+ this.types = new HashSet<Type>();
+ types.add(type);
}
+
+ private ResolvableAnnotatedClass(Type type, Annotation[] annotations, BeanManagerImpl manager)
+ {
+ this(type, AnnotationStore.of(annotations, EMPTY_ANNOTATION_ARRAY), manager);
+ }
+
+ private ResolvableAnnotatedClass(Type type, Set<Annotation>annotations, BeanManagerImpl manager)
+ {
+ this(type, AnnotationStore.of(annotations, EMPTY_ANNOTATION_SET), manager);
+ }
@Override
public String toString()
@@ -179,4 +198,14 @@
throw new UnsupportedOperationException();
}
+ public Set<Type> getTypes()
+ {
+ return types;
+ }
+
+ public boolean isAssignableTo(Class<?> clazz)
+ {
+ return Reflections.isAssignableFrom(clazz, getType());
+ }
+
}
\ No newline at end of file
Deleted: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableAnnotatedItem.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableAnnotatedItem.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableAnnotatedItem.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.jboss.webbeans.injection.resolution;
-
-import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.introspector.ForwardingAnnotatedItem;
-
-/**
- * Extension of an element which bases equality not only on type, but also on
- * binding type
- */
-abstract class ResolvableAnnotatedItem<T, S> extends ForwardingAnnotatedItem<T, S>
-{
-
- public static <T1, S1> ResolvableAnnotatedItem<T1, S1> of(final AnnotatedItem<T1, S1> delegate)
- {
- return new ResolvableAnnotatedItem<T1, S1>()
- {
- @Override
- protected AnnotatedItem<T1, S1> delegate()
- {
- return delegate;
- }
- };
- }
-
- private static final long serialVersionUID = 1L;
-
- @Override
- public boolean equals(Object other)
- {
- if (other instanceof AnnotatedItem)
- {
- AnnotatedItem<?, ?> that = (AnnotatedItem<?, ?>) other;
- return delegate().isAssignableFrom(that) && that.getBindings().equals(this.getBindings());
- }
- else
- {
- return false;
- }
- }
-
- @Override
- public int hashCode()
- {
- return delegate().hashCode();
- }
-
- @Override
- public String toString()
- {
- return "Resolvable annotated item for " + delegate();
- }
-
-}
\ No newline at end of file
Added: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java (rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -0,0 +1,70 @@
+package org.jboss.webbeans.injection.resolution;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.jboss.webbeans.introspector.AnnotatedItem;
+import org.jboss.webbeans.util.Reflections;
+
+public class ResolvableFactory
+{
+
+ public static Resolvable of(AnnotatedItem<?, ?> element)
+ {
+ if (element instanceof Resolvable)
+ {
+ return (Resolvable) element;
+ }
+ else
+ {
+ Set<Type> types = new HashSet<Type>();
+ types.add(element.getType());
+ return new ResolvableImpl(element.getBindings(), types);
+ }
+ }
+
+ private ResolvableFactory() {}
+
+ private static class ResolvableImpl implements Resolvable
+ {
+
+ private final Set<Annotation> bindings;
+ private final Set<Class<? extends Annotation>> annotationTypes;
+ private final Set<Type> types;
+
+ public ResolvableImpl(Set<Annotation> bindings, Set<Type> types)
+ {
+ this.bindings = bindings;
+ this.annotationTypes = new HashSet<Class<? extends Annotation>>();
+ this.types = types;
+ for (Annotation annotation : bindings)
+ {
+ annotationTypes.add(annotation.annotationType());
+ }
+ }
+
+ public Set<Annotation> getBindings()
+ {
+ return bindings;
+ }
+
+ public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ {
+ return annotationTypes.contains(annotationType);
+ }
+
+ public Set<Type> getTypes()
+ {
+ return types;
+ }
+
+ public boolean isAssignableTo(Class<?> clazz)
+ {
+ return Reflections.isAssignableFrom(clazz, types);
+ }
+
+ }
+
+}
Property changes on: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/ResolvableFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/injection/resolution/Resolver.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -17,6 +17,7 @@
package org.jboss.webbeans.injection.resolution;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@@ -26,16 +27,15 @@
import java.util.TreeSet;
import java.util.concurrent.Callable;
-import javax.enterprise.inject.TypeLiteral;
import javax.enterprise.inject.spi.Bean;
import org.jboss.webbeans.BeanManagerImpl;
import org.jboss.webbeans.bean.standard.EventBean;
import org.jboss.webbeans.bean.standard.InstanceBean;
import org.jboss.webbeans.introspector.AnnotatedItem;
-import org.jboss.webbeans.metadata.BindingTypeModel;
-import org.jboss.webbeans.metadata.MetaDataCache;
+import org.jboss.webbeans.util.Beans;
import org.jboss.webbeans.util.ListComparator;
+import org.jboss.webbeans.util.Reflections;
import org.jboss.webbeans.util.collections.ConcurrentCache;
/**
@@ -46,30 +46,66 @@
public class Resolver
{
private static final long serialVersionUID = 1L;
-
- private static final Class<AnnotatedItem<Object, Object>> ANNOTATED_ITEM_GENERIFIED_WITH_OBJECT_OBJECT = new TypeLiteral<AnnotatedItem<Object, Object>>(){}.getRawType();
+ private static abstract class MatchingResolvable extends ForwardingResolvable
+ {
+
+ private final BeanManagerImpl manager;
+
+ public MatchingResolvable(BeanManagerImpl manager)
+ {
+ this.manager = manager;
+ }
+
+ public boolean matches(Set<Type> types, Set<Annotation> bindings)
+ {
+ return Reflections.isAssignableFrom(this.getTypes(), types) && Beans.containsAllBindings(this.getBindings(), bindings, manager);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj instanceof Resolvable)
+ {
+ Resolvable that = (Resolvable) obj;
+ return this.matches(that.getTypes(), that.getBindings());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ }
+
// The resolved injection points
- private ConcurrentCache<ResolvableAnnotatedItem<?, ?>, Set<Bean<?>>> resolvedInjectionPoints;
+ private ConcurrentCache<Resolvable, Set<Bean<?>>> resolvedInjectionPoints;
// The registerd injection points
private Set<AnnotatedItem<?, ?>> injectionPoints;
// The resolved names
private ConcurrentCache<String, Set<Bean<?>>> resolvedNames;
+
+ // The beans to search
+ private final List<? extends Bean<?>> beans;
+
// The Web Beans manager
private final BeanManagerImpl manager;
- private final Set<AnnotatedItemTransformer> transformers;
+
+ // Annotation transformers used to mutate annotations during resolution
+ private final Set<ResolovableTransformer> transformers;
/**
* Constructor
*
*/
- public Resolver(BeanManagerImpl manager)
+ public Resolver(BeanManagerImpl manager, List<? extends Bean<?>> beans)
{
this.manager = manager;
+ this.beans = beans;
this.injectionPoints = new HashSet<AnnotatedItem<?, ?>>();
- this.resolvedInjectionPoints = new ConcurrentCache<ResolvableAnnotatedItem<?, ?>, Set<Bean<?>>>();
+ this.resolvedInjectionPoints = new ConcurrentCache<Resolvable, Set<Bean<?>>>();
this.resolvedNames = new ConcurrentCache<String, Set<Bean<?>>>();
- this.transformers = new HashSet<AnnotatedItemTransformer>();
+ this.transformers = new HashSet<ResolovableTransformer>();
transformers.add(EventBean.TRANSFORMER);
transformers.add(InstanceBean.TRANSFORMER);
}
@@ -92,18 +128,27 @@
* @param element The injection point to add
* @return A set of matching beans for the injection point
*/
- private Set<Bean<?>> registerInjectionPoint(final ResolvableAnnotatedItem<?, ?> element)
+ private Set<Bean<?>> registerInjectionPoint(final Resolvable element)
{
+ final MatchingResolvable wrapped = new MatchingResolvable(manager)
+ {
+
+ @Override
+ protected Resolvable delegate()
+ {
+ return element;
+ }
+
+ };
Callable<Set<Bean<?>>> callable = new Callable<Set<Bean<?>>>()
{
-
public Set<Bean<?>> call() throws Exception
{
- return retainHighestPrecedenceBeans(getMatchingBeans(element, manager.getBeans()), manager.getEnabledDeploymentTypes());
+ return retainHighestPrecedenceBeans(getMatchingBeans(wrapped, beans), manager.getEnabledDeploymentTypes());
}
};
- return resolvedInjectionPoints.putIfAbsent(element, callable);
+ return resolvedInjectionPoints.putIfAbsent(wrapped, callable);
}
/**
@@ -112,7 +157,7 @@
*/
public void clear()
{
- this.resolvedInjectionPoints = new ConcurrentCache<ResolvableAnnotatedItem<?, ?>, Set<Bean<?>>>();
+ this.resolvedInjectionPoints = new ConcurrentCache<Resolvable, Set<Bean<?>>>();
resolvedNames = new ConcurrentCache<String, Set<Bean<?>>>();
}
@@ -124,17 +169,7 @@
{
for (final AnnotatedItem<? extends Object, ? extends Object> injectable : injectionPoints)
{
-
- registerInjectionPoint(new ResolvableAnnotatedItem<Object, Object>()
- {
- private static final long serialVersionUID = 1L;
-
- @Override
- public AnnotatedItem<Object, Object> delegate()
- {
- return ANNOTATED_ITEM_GENERIFIED_WITH_OBJECT_OBJECT.cast(injectable);
- }
- });
+ registerInjectionPoint(ResolvableFactory.of(injectable));
}
}
@@ -144,15 +179,15 @@
* @param key The resolving criteria
* @return An unmodifiable set of matching beans
*/
- public Set<Bean<?>> get(final AnnotatedItem<?, ?> key)
+ public Set<Bean<?>> get(final Resolvable key)
{
- Set<Bean<?>> beans = registerInjectionPoint(ResolvableAnnotatedItem.of(transformElement(key)));
+ Set<Bean<?>> beans = registerInjectionPoint(transformElement(key));
return Collections.unmodifiableSet(beans);
}
- private <T, S> AnnotatedItem<T, S> transformElement(AnnotatedItem<T, S> element)
+ private Resolvable transformElement(Resolvable element)
{
- for (AnnotatedItemTransformer transformer : transformers)
+ for (ResolovableTransformer transformer : transformers)
{
element = transformer.transform(element);
}
@@ -173,15 +208,15 @@
public Set<Bean<? extends Object>> call() throws Exception
{
- Set<Bean<?>> beans = new HashSet<Bean<?>>();
- for (Bean<?> bean : manager.getBeans())
+ Set<Bean<?>> matchedBeans = new HashSet<Bean<?>>();
+ for (Bean<?> bean : beans)
{
if ((bean.getName() == null && name == null) || (bean.getName() != null && bean.getName().equals(name)))
{
- beans.add(bean);
+ matchedBeans.add(bean);
}
}
- return retainHighestPrecedenceBeans(beans, manager.getEnabledDeploymentTypes());
+ return retainHighestPrecedenceBeans(matchedBeans, manager.getEnabledDeploymentTypes());
}
});
@@ -236,12 +271,12 @@
* @param beans The beans to filter
* @return A set of filtered beans
*/
- private Set<Bean<?>> getMatchingBeans(AnnotatedItem<?, ?> element, List<Bean<?>> beans)
+ private static Set<Bean<?>> getMatchingBeans(MatchingResolvable resolvable, List<? extends Bean<?>> beans)
{
Set<Bean<?>> resolvedBeans = new HashSet<Bean<?>>();
for (Bean<?> bean : beans)
{
- if (element.isAssignableFrom(bean.getTypes()) && containsAllBindings(element, bean.getBindings()))
+ if (resolvable.matches(bean.getTypes(), bean.getBindings()))
{
resolvedBeans.add(bean);
}
@@ -250,41 +285,6 @@
}
/**
- * Checks if binding criteria fulfill all binding types
- *
- * @param element The binding criteria to check
- * @param bindings The binding types to check
- * @return True if all matches, false otherwise
- */
- private boolean containsAllBindings(AnnotatedItem<?, ?> element, Set<Annotation> bindings)
- {
- for (Annotation binding : element.getBindings())
- {
- BindingTypeModel<?> bindingType = manager.getServices().get(MetaDataCache.class).getBindingTypeModel(binding.annotationType());
- if (bindingType.getNonBindingTypes().size() > 0)
- {
- boolean matchFound = false;
- for (Annotation otherBinding : bindings)
- {
- if (bindingType.isEqual(binding, otherBinding))
- {
- matchFound = true;
- }
- }
- if (!matchFound)
- {
- return false;
- }
- }
- else if (!bindings.contains(binding))
- {
- return false;
- }
- }
- return true;
- }
-
- /**
* Gets a string representation
*
* @return A string representation
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotatedItem.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -47,7 +47,7 @@
* @return A set of annotations. Returns an empty set if there are no
* matches.
*/
- public <A extends Annotation> Set<A> getAnnotationsAsSet();
+ public <A extends Annotation> Set<A> getAnnotations();
/**
* Gets all annotations which are annotated with the given meta annotation
@@ -162,17 +162,16 @@
* @return True if assignable, false otherwise.
*/
public boolean isAssignableFrom(AnnotatedItem<?, ?> that);
-
+
/**
- * Checks if any of the types provided are assignable to this, using
- * the extended assignability algorithm provided by AnnotatedItem.
+ * Extends Java Class assignability such that actual type parameters are also
+ * considered
*
- * The types are assumed to contain their own actual type parameterization.
- *
- * @param types The set of types to match
- * @return True if assignable, false otherwise.
+ * @param type The type to compare against
+ * @param actualTypeArguments The type arguments
+ * @return True is assignable, false otherwise
*/
- public boolean isAssignableFrom(Set<? extends Type> types);
+ public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments);
/**
* Gets the actual type arguments for any parameterized types that this
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/AnnotationStore.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -91,6 +91,11 @@
return new AnnotationStore(buildAnnotationMap(annotations), buildAnnotationMap(declaredAnnotations));
}
+ public static AnnotationStore of(Set<Annotation> annotations, Set<Annotation> declaredAnnotations)
+ {
+ return new AnnotationStore(buildAnnotationMap(annotations), buildAnnotationMap(declaredAnnotations));
+ }
+
public static AnnotationStore wrap(AnnotationStore annotationStore, Set<Annotation> annotations, Set<Annotation> declaredAnnotations)
{
Map<Class<? extends Annotation>, Annotation> annotationMap = new HashMap<Class<? extends Annotation>, Annotation>();
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/ForwardingAnnotatedItem.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -50,9 +50,9 @@
/**
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
- public Set<Annotation> getAnnotationsAsSet()
+ public Set<Annotation> getAnnotations()
{
- return delegate().getAnnotationsAsSet();
+ return delegate().getAnnotations();
}
/**
@@ -131,12 +131,9 @@
return delegate().isAssignableFrom(that);
}
- /**
- * @see org.jboss.webbeans.introspector.AnnotatedItem
- */
- public boolean isAssignableFrom(Set<? extends Type> types)
+ public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
{
- return delegate().isAssignableFrom(types);
+ return delegate().isAssignableFrom(type, actualTypeArguments);
}
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedClass.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedClass.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -48,7 +48,7 @@
return getAnnotationStore().getAnnotation(annotationType);
}
- public Set<Annotation> getAnnotationsAsSet()
+ public Set<Annotation> getAnnotations()
{
return getAnnotationStore().getAnnotations();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedField.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -52,7 +52,7 @@
/**
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
- public Set<Annotation> getAnnotationsAsSet()
+ public Set<Annotation> getAnnotations()
{
return getAnnotationStore().getAnnotations();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedMethod.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -54,7 +54,7 @@
/**
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
- public Set<Annotation> getAnnotationsAsSet()
+ public Set<Annotation> getAnnotations()
{
return getAnnotationStore().getAnnotations();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/WrappedAnnotatedParameter.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -59,7 +59,7 @@
/**
* @see org.jboss.webbeans.introspector.AnnotatedItem
*/
- public Set<Annotation> getAnnotationsAsSet()
+ public Set<Annotation> getAnnotations()
{
return getAnnotationStore().getAnnotations();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AbstractAnnotatedItem.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -19,7 +19,6 @@
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
-import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -28,7 +27,6 @@
import org.jboss.webbeans.introspector.AnnotationStore;
import org.jboss.webbeans.util.Proxies;
import org.jboss.webbeans.util.Reflections;
-import org.jboss.webbeans.util.Types;
/**
* Represents functionality common for all annotated items, mainly different
@@ -134,7 +132,7 @@
return getMetaAnnotations(metaAnnotationType).toArray(new Annotation[0]);
}
- public Set<Annotation> getAnnotationsAsSet()
+ public Set<Annotation> getAnnotations()
{
return getAnnotationStore().getAnnotations();
}
@@ -164,7 +162,7 @@
if (other instanceof AnnotatedItem)
{
AnnotatedItem<?, ?> that = (AnnotatedItem<?, ?>) other;
- return this.getAnnotationsAsSet().equals(that.getAnnotationsAsSet()) && this.getRawType().equals(that.getRawType());
+ return this.getAnnotations().equals(that.getAnnotations()) && this.getRawType().equals(that.getRawType());
}
return false;
}
@@ -183,51 +181,14 @@
return isAssignableFrom(that.getRawType(), that.getActualTypeArguments());
}
- /**
- * Checks if this item is assignable from any one a set of types
- *
- * @param types The set of types to check against
- * @return True if assignable, false otherwise
- *
- * @see org.jboss.webbeans.introspector.AnnotatedItem#isAssignableFrom(Set)
- */
- public boolean isAssignableFrom(Set<? extends Type> types)
+ public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
{
- for (Type type : types)
- {
- if (type instanceof Class)
- {
- Class<?> clazz = (Class<?>) type;
- if (isAssignableFrom(clazz, new Type[0]))
- {
- return true;
- }
- }
- else if (type instanceof ParameterizedType)
- {
- ParameterizedType parameterizedType = (ParameterizedType) type;
- if (parameterizedType.getRawType() instanceof Class)
- {
- if (isAssignableFrom((Class<?>) parameterizedType.getRawType(), parameterizedType.getActualTypeArguments()))
- {
- return true;
- }
- }
- }
- }
- return false;
+ return Reflections.isAssignableFrom(getRawType(), getActualTypeArguments(), type, actualTypeArguments);
}
-
- /**
- * Helper method for doing actual assignability check
- *
- * @param type The type to compare against
- * @param actualTypeArguments The type arguments
- * @return True is assignable, false otherwise
- */
- private boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
+
+ public boolean isAssignableFrom(Type type)
{
- return Types.boxedType(getRawType()).isAssignableFrom(Types.boxedType(type)) && Arrays.equals(getActualTypeArguments(), actualTypeArguments);
+ return Reflections.isAssignableFrom(getType(), type);
}
/**
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedAnnotationImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -79,7 +79,7 @@
{
AnnotatedMethod<?> annotatedMethod = AnnotatedMethodImpl.of(member, this);
members.add(annotatedMethod);
- for (Annotation annotation : annotatedMethod.getAnnotationsAsSet())
+ for (Annotation annotation : annotatedMethod.getAnnotations())
{
annotatedMembers.put(annotation.annotationType(), annotatedMethod);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedClassImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -138,7 +138,7 @@
this.declaredFields.add(annotatedField);
this.declaredFieldsByName.put(annotatedField.getName(), annotatedField);
}
- for (Annotation annotation : annotatedField.getAnnotationsAsSet())
+ for (Annotation annotation : annotatedField.getAnnotations())
{
this.annotatedFields.put(annotation.annotationType(), annotatedField);
if (c == rawType)
@@ -177,7 +177,7 @@
this.declaredConstructorsBySignature.put(annotatedConstructor.getSignature(), annotatedConstructor);
- for (Annotation annotation : annotatedConstructor.getAnnotationsAsSet())
+ for (Annotation annotation : annotatedConstructor.getAnnotations())
{
if (!annotatedConstructors.containsKey(annotation.annotationType()))
{
@@ -218,7 +218,7 @@
this.declaredMethods.add(annotatedMethod);
this.declaredMethodsBySignature.put(annotatedMethod.getSignature(), annotatedMethod);
}
- for (Annotation annotation : annotatedMethod.getAnnotationsAsSet())
+ for (Annotation annotation : annotatedMethod.getAnnotations())
{
annotatedMethods.put(annotation.annotationType(), annotatedMethod);
if (c == rawType)
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedConstructorImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -93,7 +93,7 @@
AnnotatedParameter<?> parameter = AnnotatedParameterImpl.of(constructor.getParameterAnnotations()[i], clazz, type, this);
parameters.add(parameter);
- for (Annotation annotation : parameter.getAnnotationsAsSet())
+ for (Annotation annotation : parameter.getAnnotations())
{
annotatedParameters.put(annotation.annotationType(), parameter);
}
@@ -113,7 +113,7 @@
AnnotatedParameter<?> parameter = AnnotatedParameterImpl.of(new Annotation[0], clazz, type, this);
parameters.add(parameter);
- for (Annotation annotation : parameter.getAnnotationsAsSet())
+ for (Annotation annotation : parameter.getAnnotations())
{
annotatedParameters.put(annotation.annotationType(), parameter);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/introspector/jlr/AnnotatedMethodImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -99,7 +99,7 @@
Type type = method.getGenericParameterTypes()[i];
AnnotatedParameter<?> parameter = AnnotatedParameterImpl.of(method.getParameterAnnotations()[i], (Class<Object>) clazz, type, this);
this.parameters.add(parameter);
- for (Annotation annotation : parameter.getAnnotationsAsSet())
+ for (Annotation annotation : parameter.getAnnotations())
{
if (MAPPED_PARAMETER_ANNOTATIONS.contains(annotation.annotationType()))
{
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Beans.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -16,9 +16,11 @@
*/
package org.jboss.webbeans.util;
+import java.lang.annotation.Annotation;
import java.util.HashSet;
import java.util.Set;
+import javax.decorator.Decorates;
import javax.enterprise.inject.BindingType;
import javax.enterprise.inject.Produces;
import javax.enterprise.inject.spi.Bean;
@@ -30,6 +32,7 @@
import org.jboss.webbeans.injection.FieldInjectionPoint;
import org.jboss.webbeans.introspector.AnnotatedClass;
import org.jboss.webbeans.introspector.AnnotatedField;
+import org.jboss.webbeans.metadata.BindingTypeModel;
import org.jboss.webbeans.metadata.MetaDataCache;
/**
@@ -82,21 +85,65 @@
Set<FieldInjectionPoint<?>> injectableFields = new HashSet<FieldInjectionPoint<?>>();
for (AnnotatedField<?> annotatedField : annotatedItem.getMetaAnnotatedFields(BindingType.class))
{
- if (!annotatedField.isAnnotationPresent(Produces.class))
+ addFieldInjectionPoint(annotatedField, injectableFields, declaringBean);
+ }
+ for (AnnotatedField<?> annotatedField : annotatedItem.getAnnotatedFields(Decorates.class))
+ {
+ addFieldInjectionPoint(annotatedField, injectableFields, declaringBean);
+ }
+ return injectableFields;
+ }
+
+ private static void addFieldInjectionPoint(AnnotatedField<?> annotatedField, Set<FieldInjectionPoint<?>> injectableFields, Bean<?> declaringBean)
+ {
+ if (!annotatedField.isAnnotationPresent(Produces.class))
+ {
+ if (annotatedField.isStatic())
{
- if (annotatedField.isStatic())
+ throw new DefinitionException("Don't place binding annotations on static fields " + annotatedField);
+ }
+ if (annotatedField.isFinal())
+ {
+ throw new DefinitionException("Don't place binding annotations on final fields " + annotatedField);
+ }
+ FieldInjectionPoint<?> fieldInjectionPoint = FieldInjectionPoint.of(declaringBean, annotatedField);
+ injectableFields.add(fieldInjectionPoint);
+ }
+ }
+
+ /**
+ * Checks if binding criteria fulfill all binding types
+ *
+ * @param element The binding criteria to check
+ * @param bindings2 The binding types to check
+ * @return True if all matches, false otherwise
+ */
+ public static boolean containsAllBindings(Set<Annotation> bindings1, Set<Annotation> bindings2, BeanManagerImpl manager)
+ {
+ for (Annotation binding : bindings1)
+ {
+ BindingTypeModel<?> bindingType = manager.getServices().get(MetaDataCache.class).getBindingTypeModel(binding.annotationType());
+ if (bindingType.getNonBindingTypes().size() > 0)
+ {
+ boolean matchFound = false;
+ for (Annotation otherBinding : bindings2)
{
- throw new DefinitionException("Don't place binding annotations on static fields " + annotatedField);
+ if (bindingType.isEqual(binding, otherBinding))
+ {
+ matchFound = true;
+ }
}
- if (annotatedField.isFinal())
+ if (!matchFound)
{
- throw new DefinitionException("Don't place binding annotations on final fields " + annotatedField);
+ return false;
}
- FieldInjectionPoint<?> fieldInjectionPoint = FieldInjectionPoint.of(declaringBean, annotatedField);
- injectableFields.add(fieldInjectionPoint);
}
+ else if (!bindings2.contains(binding))
+ {
+ return false;
+ }
}
- return injectableFields;
+ return true;
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Proxies.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Proxies.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Proxies.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -227,5 +227,16 @@
}
}
+ /**
+ * Indicates if an instance is a Javassist proxy
+ *
+ * @param instance The instance to examine
+ * @return True if proxy, false otherwise
+ */
+ public static boolean isProxy(Object instance)
+ {
+ return instance.getClass().getName().indexOf("_$$_javassist_") > 0;
+ }
+
}
Modified: ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/impl/src/main/java/org/jboss/webbeans/util/Reflections.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -544,20 +544,7 @@
throw new NoSuchMethodException("Method " + methodName + Arrays.asList(parameterTypes).toString().replace("[", "(").replace("]", ")") + " not implemented by instance " + c.getName());
}
-
-
/**
- * Indicates if an instance is a Javassist proxy
- *
- * @param instance The instance to examine
- * @return True if proxy, false otherwise
- */
- public static boolean isProxy(Object instance)
- {
- return instance.getClass().getName().indexOf("_$$_javassist_") > 0;
- }
-
- /**
* Checks the bindingType to make sure the annotation was declared properly
* as a binding type (annotated with @BindingType).
*
@@ -575,6 +562,101 @@
}
return isBindingAnnotation;
}
+
+ /**
+ * Check the assignability of one type to another, taking into account the
+ * actual type arguements
+ *
+ * @param rawType1 the raw type of the class to check
+ * @param actualTypeArguments1 the actual type arguements to check, or an empty array if not a parameterized type
+ * @param rawType2 the raw type of the class to check
+ * @param actualTypeArguments2 the actual type arguements to check, or an empty array if not a parameterized type
+ * @return
+ */
+ public static boolean isAssignableFrom(Class<?> rawType1, Type[] actualTypeArguments1, Class<?> rawType2, Type[] actualTypeArguments2)
+ {
+ return Types.boxedType(rawType1).isAssignableFrom(Types.boxedType(rawType2)) && Arrays.equals(actualTypeArguments1, actualTypeArguments2);
+ }
+
+ public static boolean isAssignableFrom(Type type1, Set<? extends Type> types2)
+ {
+ for (Type type2 : types2)
+ {
+ if (isAssignableFrom(type1, type2))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean isAssignableFrom(Type type1, Type type2)
+ {
+ if (type1 instanceof Class)
+ {
+ Class<?> clazz = (Class<?>) type1;
+ if (isAssignableFrom(clazz, new Type[0], type2))
+ {
+ return true;
+ }
+ }
+ else if (type1 instanceof ParameterizedType)
+ {
+ ParameterizedType parameterizedType = (ParameterizedType) type1;
+ if (parameterizedType.getRawType() instanceof Class)
+ {
+ if (isAssignableFrom((Class<?>) parameterizedType.getRawType(), parameterizedType.getActualTypeArguments(), type2))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ public static boolean isAssignableFrom(Class<?> rawType1, Type[] actualTypeArguments1, Type type2)
+ {
+ if (type2 instanceof Class)
+ {
+ Class<?> clazz = (Class<?>) type2;
+ if (isAssignableFrom(rawType1, actualTypeArguments1, clazz, new Type[0]))
+ {
+ return true;
+ }
+ }
+ else if (type2 instanceof ParameterizedType)
+ {
+ ParameterizedType parameterizedType = (ParameterizedType) type2;
+ if (parameterizedType.getRawType() instanceof Class)
+ {
+ if (isAssignableFrom(rawType1, actualTypeArguments1, (Class<?>) parameterizedType.getRawType(), parameterizedType.getActualTypeArguments()))
+ {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Check the assiginability of a set of <b>flattened</b> types. This algorithm
+ * will check whether any of the types1 matches a type in types2
+ *
+ * @param types1
+ * @param types2
+ * @return
+ */
+ public static boolean isAssignableFrom(Set<Type> types1, Set<Type> types2)
+ {
+ for (Type type : types1)
+ {
+ if (isAssignableFrom(type, types2))
+ {
+ return true;
+ }
+ }
+ return false;
+ }
public static boolean isSerializable(Class<?> clazz)
{
Modified: ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java
===================================================================
--- ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/porting-package/src/main/java/org/jboss/webbeans/tck/BeansImpl.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -8,7 +8,7 @@
import org.jboss.webbeans.context.AbstractContext;
import org.jboss.webbeans.ejb.spi.EjbDescriptor;
import org.jboss.webbeans.ejb.spi.EjbServices;
-import org.jboss.webbeans.util.Reflections;
+import org.jboss.webbeans.util.Proxies;
/**
* Implements the Beans SPI for the TCK specifically for the JBoss RI.
@@ -67,7 +67,7 @@
public boolean isProxy(Object instance)
{
- return Reflections.isProxy(instance);
+ return Proxies.isProxy(instance);
}
public <T> T getEnterpriseBean(Class<? extends T> beanType, Class<T> localInterface)
Modified: ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/helpers/AbstractResourceServices.java
===================================================================
--- ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/helpers/AbstractResourceServices.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/spi/src/main/java/org/jboss/webbeans/resources/spi/helpers/AbstractResourceServices.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -20,7 +20,7 @@
*/
public Object resolveResource(InjectionPoint injectionPoint)
{
- if (!injectionPoint.isAnnotationPresent(Resource.class))
+ if (!injectionPoint.getAnnotated().isAnnotationPresent(Resource.class))
{
throw new IllegalArgumentException("No @Resource annotation found on injection point " + injectionPoint);
}
@@ -72,7 +72,7 @@
protected String getResourceName(InjectionPoint injectionPoint)
{
- Resource resource = injectionPoint.getAnnotation(Resource.class);
+ Resource resource = injectionPoint.getAnnotated().getAnnotation(Resource.class);
String mappedName = resource.mappedName();
if (!mappedName.equals(""))
{
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/NewEnterpriseBeanTest.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -1,6 +1,5 @@
package org.jboss.webbeans.test.unit.implementation;
-import java.lang.annotation.Annotation;
import java.util.Set;
import javax.enterprise.inject.New;
@@ -13,7 +12,6 @@
import org.jboss.webbeans.introspector.AnnotatedItem;
import org.jboss.webbeans.literal.NewLiteral;
import org.jboss.webbeans.test.AbstractWebBeansTest;
-import org.jboss.webbeans.util.Proxies.TypeInfo;
import org.testng.annotations.Test;
@Artifact
@@ -61,12 +59,4 @@
assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
}
- @Test(groups = { "new" })
- public void testNewBeanHasNoDisposalMethods()
- {
- initNewBean();
- Class<?> type = TypeInfo.ofTypes(newEnterpriseBean.getTypes()).getSuperClass();
- assert getCurrentManager().resolveDisposalBeans(type, newEnterpriseBean.getBindings().toArray(new Annotation[0])).isEmpty();
- }
-
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -25,7 +25,7 @@
public void testDeclaredAnnotations()
{
AnnotatedClass<Order> annotatedElement = AnnotatedClassImpl.of(Order.class, transformer);
- assert annotatedElement.getAnnotationsAsSet().size() == 1;
+ assert annotatedElement.getAnnotations().size() == 1;
assert annotatedElement.getAnnotation(Production.class) != null;
assert annotatedElement.getRawType().equals(Order.class);
}
@@ -48,7 +48,7 @@
assert annotatedElement.getAnnotation(Stereotype.class) == null;
assert annotatedElement.getMetaAnnotations(Stereotype.class).size() == 0;
AnnotatedClass<Antelope> classWithNoAnnotations = AnnotatedClassImpl.of(Antelope.class, transformer);
- assert classWithNoAnnotations.getAnnotationsAsSet().size() == 0;
+ assert classWithNoAnnotations.getAnnotations().size() == 0;
}
}
Modified: ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ ri/trunk/tests/src/test/java/org/jboss/webbeans/test/unit/lookup/circular/CircularDependencyTest.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -149,7 +149,7 @@
@Override
protected void execute() throws Exception
{
- getCurrentManager().getInstanceByType(Violation.class).ping();
+ createContextualInstance(Violation.class).ping();
}
}.run();
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/AbstractJSR299Test.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -14,7 +14,6 @@
import javax.enterprise.context.spi.Context;
import javax.enterprise.inject.TypeLiteral;
import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import org.jboss.jsr299.tck.api.JSR299Configuration;
@@ -147,7 +146,7 @@
public <T> Set<Bean<T>> getBeans(Class<T> type, Annotation... bindings)
{
- return (Set<Bean<T>>)(Set)getCurrentManager().getBeans(type, bindings);
+ return (Set) getCurrentManager().getBeans(type, bindings);
}
public <T> Set<Bean<T>> getBeans(TypeLiteral<T> type, Annotation... bindings)
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/activities/ActivitiesTest.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -13,6 +13,7 @@
import javax.enterprise.inject.AnnotationLiteral;
import javax.enterprise.inject.UnsatisfiedResolutionException;
import javax.enterprise.inject.deployment.Production;
+import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.BeanManager;
import javax.enterprise.inject.spi.InjectionPoint;
@@ -108,16 +109,6 @@
InjectionPoint injectionPoint = new InjectionPoint()
{
- public <T extends Annotation> T getAnnotation(Class<T> annotationType)
- {
- return null;
- }
-
- public Annotation[] getAnnotations()
- {
- return new Annotation[0];
- }
-
public Bean<?> getBean()
{
return bean;
@@ -138,10 +129,20 @@
return injectionPointType;
}
- public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
+ public Annotated getAnnotated()
{
+ return null;
+ }
+
+ public boolean isDelegate()
+ {
return false;
}
+
+ public boolean isTransient()
+ {
+ return false;
+ }
};
injectionPoints.add(injectionPoint);
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/deployment/lifecycle/DeploymentTest.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -17,9 +17,6 @@
package org.jboss.jsr299.tck.tests.deployment.lifecycle;
-import javax.enterprise.inject.spi.AfterBeanDiscovery;
-import javax.enterprise.inject.spi.BeforeBeanDiscovery;
-
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
import org.jboss.jsr299.tck.AbstractJSR299Test;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/FiresOnNonEventTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/FiresOnNonEventTest.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event1/FiresOnNonEventTest.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -36,7 +36,8 @@
@ExpectedDeploymentException(DefinitionException.class)
public class FiresOnNonEventTest extends AbstractJSR299Test
{
- @Test(groups = { "events" })
+ @Test(groups = { "events", "broken" })
+ // Erm, not right anymore :-) PLM
@SpecAssertion(section = "7.6", id = "j")
public void testFiresAnnotationOnNonEventTypeInjectionPointFails() throws Exception
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/FiresOnEventWithoutTypeTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/FiresOnEventWithoutTypeTest.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/event/broken/event2/FiresOnEventWithoutTypeTest.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -36,8 +36,9 @@
@ExpectedDeploymentException(DefinitionException.class)
public class FiresOnEventWithoutTypeTest extends AbstractJSR299Test
{
- @Test(groups = { "events" })
+ @Test(groups = { "events", "broken" })
@SpecAssertion(section = "7.6", id = "k")
+ // TODO I don't think this matches any more
public void testFiresAnnotationOnInjectionPointWithoutTypeParameterFails()
{
assert false;
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Animal.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Animal.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Animal.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -1,8 +1,6 @@
package org.jboss.jsr299.tck.tests.implementation.simple.definition;
-import javax.enterprise.inject.deployment.Production;
-@Production
interface Animal
{
Added: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Car.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Car.java (rev 0)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Car.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -0,0 +1,6 @@
+package org.jboss.jsr299.tck.tests.implementation.simple.definition;
+
+public interface Car
+{
+
+}
Property changes on: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/Car.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/implementation/simple/definition/SimpleBeanDefinitionTest.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -61,15 +61,8 @@
@SpecAssertion(section = "3.2.1", id = "cb")
public void testInterfaceNotDiscoveredAsSimpleBean()
{
- assert getBeans(Animal.class).size() == 0;
+ assert getBeans(Car.class).size() == 0;
}
-
- @Test
- @SpecAssertion(section = "3.2.1", id = "e")
- public void testEntityClassesNotDiscoveredAsSimpleBean()
- {
- assert getBeans(MockEntity.class).size() == 0;
- }
@Test
@SpecAssertions( {
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dependency/resolution/DependencyResolutionTest.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -10,6 +10,7 @@
import javax.enterprise.context.RequestScoped;
import javax.enterprise.inject.UnproxyableResolutionException;
import javax.enterprise.inject.UnsatisfiedResolutionException;
+import javax.enterprise.inject.spi.Annotated;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.InjectionPoint;
@@ -40,17 +41,7 @@
this.member = member;
this.bindings = bindings;
}
-
- public <T extends Annotation> T getAnnotation(Class<T> arg0)
- {
- return null;
- }
- public Annotation[] getAnnotations()
- {
- return null;
- }
-
public Bean<?> getBean()
{
return beanWithManager;
@@ -71,9 +62,22 @@
return type;
}
- public boolean isAnnotationPresent(Class<? extends Annotation> arg0)
+ public Annotated getAnnotated()
{
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isDelegate()
+ {
+ // TODO Auto-generated method stub
return false;
+ }
+
+ public boolean isTransient()
+ {
+ // TODO Auto-generated method stub
+ return false;
}
}
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/noninstance/NonInstanceTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/noninstance/NonInstanceTest.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/noninstance/NonInstanceTest.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -16,7 +16,8 @@
@ExpectedDeploymentException(DefinitionException.class)
public class NonInstanceTest extends AbstractJSR299Test
{
- @Test
+ @Test(groups = "broken")
+ // TODO Now @Any... plm
@SpecAssertion(section = "5.8", id = "g")
public void TestInjectionPointMustBeInstance()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/notypeparam/NoTypeParameterSpecifiedTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/notypeparam/NoTypeParameterSpecifiedTest.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/dynamic/notypeparam/NoTypeParameterSpecifiedTest.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -17,7 +17,8 @@
@ExpectedDeploymentException(DefinitionException.class)
public class NoTypeParameterSpecifiedTest extends AbstractJSR299Test
{
- @Test
+ @Test(groups="broken")
+ // TODO Out of date I think (PLM)
@SpecAssertion(section = "5.8", id = "h")
public void TestInjectionPointMustHaveTypeParameter()
{
Modified: tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java
===================================================================
--- tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-06-12 14:22:03 UTC (rev 2826)
+++ tck/trunk/impl/src/main/java/org/jboss/jsr299/tck/tests/lookup/injectionpoint/InjectionPointTest.java 2009-06-12 22:30:21 UTC (rev 2827)
@@ -20,15 +20,14 @@
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
-import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Current;
import javax.enterprise.inject.deployment.Standard;
-import javax.enterprise.inject.spi.InjectionPoint;
import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.InjectionPoint;
import org.hibernate.tck.annotations.SpecAssertion;
import org.hibernate.tck.annotations.SpecAssertions;
@@ -192,7 +191,7 @@
FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
- assert beanWithInjectionPoint.getInjectedMetadata().getAnnotation(AnimalStereotype.class) != null;
+ assert beanWithInjectionPoint.getInjectedMetadata().getAnnotated().getAnnotation(AnimalStereotype.class) != null;
}
}.run();
}
@@ -211,7 +210,7 @@
FieldInjectionPointBean beanWithInjectedBean = getInstanceByType(FieldInjectionPointBean.class,new CurrentLiteral());
BeanWithInjectionPointMetadata beanWithInjectionPoint = beanWithInjectedBean.getInjectedBean();
assert beanWithInjectionPoint.getInjectedMetadata() != null;
- Set<Annotation> annotations = new HashSet<Annotation>(Arrays.asList(beanWithInjectionPoint.getInjectedMetadata().getAnnotations()));
+ Set<Annotation> annotations = new HashSet<Annotation>(beanWithInjectionPoint.getInjectedMetadata().getAnnotated().getAnnotations());
assert annotations.size() > 0;
assert annotations.contains(new CurrentLiteral());
assert annotations.contains(new AnimalStereotypeAnnotationLiteral());
14 years, 10 months