Author: shane.bryzak(a)jboss.com
Date: 2009-10-08 02:32:51 -0400 (Thu, 08 Oct 2009)
New Revision: 3895
Added:
ri/trunk/impl/src/main/java/org/jboss/weld/context/ForwardingWeldCreationalContext.java
ri/trunk/impl/src/main/java/org/jboss/weld/context/WeldCreationalContext.java
ri/trunk/impl/src/main/java/org/jboss/weld/injection/WeldInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotation.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldConstructor.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldField.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldMember.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldMethod.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldParameter.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldAnnotation.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldCallable.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldClass.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldConstructor.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldField.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldMember.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldMethod.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldParameter.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldCallable.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldMember.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldAnnotationImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldFieldImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldMethodImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableWeldClass.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/WeldStartupTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/Weld256Test.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri279/Weld279Test.java
Removed:
ri/trunk/impl/src/main/java/org/jboss/weld/context/ForwardingWBCreationalContext.java
ri/trunk/impl/src/main/java/org/jboss/weld/context/WBCreationalContext.java
ri/trunk/impl/src/main/java/org/jboss/weld/injection/WBInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBAnnotation.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBClass.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBConstructor.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBField.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBMember.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBMethod.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBParameter.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBAnnotation.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBCallable.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBClass.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBConstructor.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBField.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBMember.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBMethod.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBParameter.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBAnnotated.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBCallable.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBMember.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBAnnotationImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBClassImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBConstructorImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBFieldImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBMethodImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBParameterImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableWBClass.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/WBStartupTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/Wbri256Test.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri279/Wbri279Test.java
Modified:
ri/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/SimpleInjectionTarget.java
ri/trunk/impl/src/main/java/org/jboss/weld/Validator.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ExtensionBean.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/facade/InstanceImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/ee/EEResourceProducerField.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/ee/PersistenceContextProducerField.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java
ri/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyMethodHandler.java
ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java
ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployer.java
ri/trunk/impl/src/main/java/org/jboss/weld/context/CreationalContextImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/context/DependentContext.java
ri/trunk/impl/src/main/java/org/jboss/weld/el/ELCreationalContext.java
ri/trunk/impl/src/main/java/org/jboss/weld/event/ObserverFactory.java
ri/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/event/TransactionalObserverMethodImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/injection/ConstructorInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/weld/injection/FieldInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/weld/injection/MethodInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/weld/injection/ParameterInjectionPoint.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/AnnotationStore.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/ConstructorSignatureImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/MethodSignatureImpl.java
ri/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/AnnotationModel.java
ri/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/BindingTypeModel.java
ri/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/InterceptorBindingModel.java
ri/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableFactory.java
ri/trunk/impl/src/main/java/org/jboss/weld/resources/ClassTransformer.java
ri/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/deployment/structure/AccessibleManagerResolutionTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/NewEnterpriseBeanTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/newsimple/NewSimpleBeanTest.java
Log:
rename WB* classes
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java 2009-10-08 06:11:18
UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/BeanManagerImpl.java 2009-10-08 06:32:51
UTC (rev 3895)
@@ -63,13 +63,13 @@
import org.jboss.weld.bean.proxy.ClientProxyProvider;
import org.jboss.weld.bootstrap.api.ServiceRegistry;
import org.jboss.weld.context.CreationalContextImpl;
-import org.jboss.weld.context.WBCreationalContext;
+import org.jboss.weld.context.WeldCreationalContext;
import org.jboss.weld.ejb.EjbDescriptors;
import org.jboss.weld.ejb.spi.EjbDescriptor;
import org.jboss.weld.el.Namespace;
import org.jboss.weld.el.WeldELResolver;
import org.jboss.weld.el.WeldExpressionFactory;
-import org.jboss.weld.introspector.WBAnnotated;
+import org.jboss.weld.introspector.WeldAnnotated;
import org.jboss.weld.literal.AnyLiteral;
import org.jboss.weld.literal.DefaultLiteral;
import org.jboss.weld.log.Log;
@@ -80,7 +80,7 @@
import org.jboss.weld.resolution.NameBasedResolver;
import org.jboss.weld.resolution.Resolvable;
import org.jboss.weld.resolution.ResolvableFactory;
-import org.jboss.weld.resolution.ResolvableWBClass;
+import org.jboss.weld.resolution.ResolvableWeldClass;
import org.jboss.weld.resolution.TypeSafeBeanResolver;
import org.jboss.weld.resolution.TypeSafeDecoratorResolver;
import org.jboss.weld.resolution.TypeSafeInterceptorResolver;
@@ -699,10 +699,10 @@
public Set<Bean<?>> getBeans(Type beanType, Annotation... bindings)
{
- return getBeans(ResolvableWBClass.of(beanType, bindings, this), bindings);
+ return getBeans(ResolvableWeldClass.of(beanType, bindings, this), bindings);
}
- public Set<Bean<?>> getBeans(WBAnnotated<?, ?> element,
Annotation... bindings)
+ public Set<Bean<?>> getBeans(WeldAnnotated<?, ?> element,
Annotation... bindings)
{
for (Annotation annotation : element.getAnnotations())
{
@@ -739,7 +739,7 @@
currentInjectionPoint.get().push(injectionPoint);
}
// TODO Do this properly
- Set<Bean<?>> beans =
getBeans(ResolvableWBClass.of(injectionPoint.getType(),
injectionPoint.getQualifiers().toArray(new Annotation[0]), this));
+ Set<Bean<?>> beans =
getBeans(ResolvableWeldClass.of(injectionPoint.getType(),
injectionPoint.getQualifiers().toArray(new Annotation[0]), this));
Set<Bean<?>> injectableBeans = new HashSet<Bean<?>>();
for (Bean<?> bean : beans)
{
@@ -903,9 +903,9 @@
public Object getReference(Bean<?> bean, CreationalContext<?>
creationalContext)
{
bean = getMostSpecializedBean(bean);
- if (creationalContext instanceof WBCreationalContext<?>)
+ if (creationalContext instanceof WeldCreationalContext<?>)
{
- creationalContext = ((WBCreationalContext<?>)
creationalContext).getCreationalContext(bean);
+ creationalContext = ((WeldCreationalContext<?>)
creationalContext).getCreationalContext(bean);
}
if
(getServices().get(MetaAnnotationStore.class).getScopeModel(bean.getScope()).isNormal())
{
@@ -957,9 +957,9 @@
throw new UnproxyableResolutionException("Attempting to inject an
unproxyable normal scoped bean " + resolvedBean + " into " +
injectionPoint);
}
// TODO Can we move this logic to getReference?
- if (creationalContext instanceof WBCreationalContext<?>)
+ if (creationalContext instanceof WeldCreationalContext<?>)
{
- WBCreationalContext<?> wbCreationalContext =
(WBCreationalContext<?>) creationalContext;
+ WeldCreationalContext<?> wbCreationalContext =
(WeldCreationalContext<?>) creationalContext;
if (wbCreationalContext.containsIncompleteInstance(resolvedBean))
{
return wbCreationalContext.getIncompleteInstance(resolvedBean);
@@ -986,7 +986,7 @@
public Object getInjectableReference(InjectionPoint injectionPoint,
CreationalContext<?> creationalContext)
{
- WBAnnotated<?, ?> element = ResolvableWBClass.of(injectionPoint.getType(),
injectionPoint.getQualifiers().toArray(new Annotation[0]), this);
+ WeldAnnotated<?, ?> element =
ResolvableWeldClass.of(injectionPoint.getType(),
injectionPoint.getQualifiers().toArray(new Annotation[0]), this);
Bean<?> resolvedBean = getBean(element, element.getBindingsAsArray());
return getReference(injectionPoint, resolvedBean, creationalContext);
}
@@ -1012,7 +1012,7 @@
return instance;
}
- public <T> Bean<T> getBean(WBAnnotated<T, ?> element, Annotation...
bindings)
+ public <T> Bean<T> getBean(WeldAnnotated<T, ?> element,
Annotation... bindings)
{
Bean<T> bean = (Bean<T>) resolve(getBeans(element, bindings));
if (bean == null)
@@ -1371,7 +1371,7 @@
return new WeldExpressionFactory(expressionFactory);
}
- public <T> WBCreationalContext<T>
createCreationalContext(Contextual<T> contextual)
+ public <T> WeldCreationalContext<T>
createCreationalContext(Contextual<T> contextual)
{
return new CreationalContextImpl<T>(contextual);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/SimpleInjectionTarget.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/SimpleInjectionTarget.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/SimpleInjectionTarget.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -28,9 +28,9 @@
import org.jboss.weld.injection.FieldInjectionPoint;
import org.jboss.weld.injection.InjectionContextImpl;
import org.jboss.weld.injection.MethodInjectionPoint;
-import org.jboss.weld.injection.WBInjectionPoint;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.WBMethod;
+import org.jboss.weld.injection.WeldInjectionPoint;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.util.Beans;
/**
@@ -41,19 +41,19 @@
{
private final BeanManagerImpl beanManager;
- private final WBClass<T> type;
+ private final WeldClass<T> type;
private final ConstructorInjectionPoint<T> constructor;
private final List<Set<FieldInjectionPoint<?, ?>>>
injectableFields;
private final List<Set<MethodInjectionPoint<?, ?>>>
initializerMethods;
- private final WBMethod<?, ?> postConstruct;
- private final WBMethod<?, ?> preDestroy;
+ private final WeldMethod<?, ?> postConstruct;
+ private final WeldMethod<?, ?> preDestroy;
private final Set<InjectionPoint> injectionPoints;
- private final Set<WBInjectionPoint<?, ?>> ejbInjectionPoints;
- private final Set<WBInjectionPoint<?, ?>>
persistenceContextInjectionPoints;
- private final Set<WBInjectionPoint<?, ?>> persistenceUnitInjectionPoints;
- private final Set<WBInjectionPoint<?, ?>> resourceInjectionPoints;
+ private final Set<WeldInjectionPoint<?, ?>> ejbInjectionPoints;
+ private final Set<WeldInjectionPoint<?, ?>>
persistenceContextInjectionPoints;
+ private final Set<WeldInjectionPoint<?, ?>>
persistenceUnitInjectionPoints;
+ private final Set<WeldInjectionPoint<?, ?>> resourceInjectionPoints;
- public SimpleInjectionTarget(WBClass<T> type, BeanManagerImpl beanManager)
+ public SimpleInjectionTarget(WeldClass<T> type, BeanManagerImpl beanManager)
{
this.beanManager = beanManager;
this.type = type;
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/Validator.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/Validator.java 2009-10-08 06:11:18 UTC (rev
3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/Validator.java 2009-10-08 06:32:51 UTC (rev
3895)
@@ -48,9 +48,9 @@
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.bootstrap.api.Service;
-import org.jboss.weld.introspector.WBAnnotated;
+import org.jboss.weld.introspector.WeldAnnotated;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
-import org.jboss.weld.resolution.ResolvableWBClass;
+import org.jboss.weld.resolution.ResolvableWeldClass;
import org.jboss.weld.util.Beans;
import org.jboss.weld.util.Proxies;
import org.jboss.weld.util.Reflections;
@@ -155,7 +155,7 @@
checkFacadeInjectionPoint(ij, Instance.class);
checkFacadeInjectionPoint(ij, Event.class);
Annotation[] bindings = ij.getQualifiers().toArray(new Annotation[0]);
- WBAnnotated<?, ?> annotatedItem = ResolvableWBClass.of(ij.getType(),
bindings, beanManager);
+ WeldAnnotated<?, ?> annotatedItem = ResolvableWeldClass.of(ij.getType(),
bindings, beanManager);
Set<?> resolvedBeans =
beanManager.getBeanResolver().resolve(beanManager.getInjectableBeans(ij));
if (resolvedBeans.isEmpty())
{
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java 2009-10-08 06:11:18
UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractBean.java 2009-10-08 06:32:51
UTC (rev 3895)
@@ -34,10 +34,10 @@
import org.jboss.weld.Container;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
-import org.jboss.weld.injection.WBInjectionPoint;
-import org.jboss.weld.introspector.WBAnnotated;
-import org.jboss.weld.introspector.WBField;
-import org.jboss.weld.introspector.WBParameter;
+import org.jboss.weld.injection.WeldInjectionPoint;
+import org.jboss.weld.introspector.WeldAnnotated;
+import org.jboss.weld.introspector.WeldField;
+import org.jboss.weld.introspector.WeldParameter;
import org.jboss.weld.literal.AnyLiteral;
import org.jboss.weld.literal.DefaultLiteral;
import org.jboss.weld.log.Log;
@@ -79,8 +79,8 @@
// The API types
protected Set<Type> types;
// The injection points
- private Set<WBInjectionPoint<?, ?>> injectionPoints;
- private Set<WBInjectionPoint<?, ?>> delegateInjectionPoints;
+ private Set<WeldInjectionPoint<?, ?>> injectionPoints;
+ private Set<WeldInjectionPoint<?, ?>> delegateInjectionPoints;
// If the type a primitive?
private boolean primitive;
// The Bean manager
@@ -106,8 +106,8 @@
{
super(idSuffix, manager);
this.manager = manager;
- this.injectionPoints = new HashSet<WBInjectionPoint<?, ?>>();
- this.delegateInjectionPoints = new HashSet<WBInjectionPoint<?,?>>();
+ this.injectionPoints = new HashSet<WeldInjectionPoint<?, ?>>();
+ this.delegateInjectionPoints = new HashSet<WeldInjectionPoint<?,?>>();
}
/**
@@ -145,7 +145,7 @@
}
}
- protected void addInjectionPoint(WBInjectionPoint<?, ?> injectionPoint)
+ protected void addInjectionPoint(WeldInjectionPoint<?, ?> injectionPoint)
{
if (injectionPoint.isAnnotationPresent(Decorates.class))
{
@@ -154,15 +154,15 @@
injectionPoints.add(injectionPoint);
}
- protected void addInjectionPoints(Iterable<? extends WBInjectionPoint<?,
?>> injectionPoints)
+ protected void addInjectionPoints(Iterable<? extends WeldInjectionPoint<?,
?>> injectionPoints)
{
- for (WBInjectionPoint<?, ?> injectionPoint : injectionPoints)
+ for (WeldInjectionPoint<?, ?> injectionPoint : injectionPoints)
{
addInjectionPoint(injectionPoint);
}
}
- protected Set<WBInjectionPoint<?, ?>> getDelegateInjectionPoints()
+ protected Set<WeldInjectionPoint<?, ?>> getDelegateInjectionPoints()
{
return delegateInjectionPoints;
}
@@ -262,13 +262,13 @@
private boolean checkInjectionPointsAreSerializable()
{
boolean passivating =
manager.getServices().get(MetaAnnotationStore.class).getScopeModel(this.getScope()).isPassivating();
- for (WBInjectionPoint<?, ?> injectionPoint : getAnnotatedInjectionPoints())
+ for (WeldInjectionPoint<?, ?> injectionPoint :
getAnnotatedInjectionPoints())
{
Annotation[] bindings =
injectionPoint.getMetaAnnotationsAsArray(Qualifier.class);
Bean<?> resolvedBean = manager.getBeans(injectionPoint.getJavaClass(),
bindings).iterator().next();
if (passivating)
{
- if (Dependent.class.equals(resolvedBean.getScope()) &&
!Reflections.isSerializable(resolvedBean.getBeanClass()) && (((injectionPoint
instanceof WBField<?, ?>) && !((WBField<?, ?>)
injectionPoint).isTransient()) || (injectionPoint instanceof WBParameter<?, ?>)))
+ if (Dependent.class.equals(resolvedBean.getScope()) &&
!Reflections.isSerializable(resolvedBean.getBeanClass()) && (((injectionPoint
instanceof WeldField<?, ?>) && !((WeldField<?, ?>)
injectionPoint).isTransient()) || (injectionPoint instanceof WeldParameter<?, ?>)))
{
return false;
}
@@ -331,7 +331,7 @@
*
* @return The annotated item
*/
- protected abstract WBAnnotated<T, E> getAnnotatedItem();
+ protected abstract WeldAnnotated<T, E> getAnnotatedItem();
/**
* Gets the binding types
@@ -356,7 +356,7 @@
public abstract AbstractBean<?, ?> getSpecializedBean();
@Override
- public Set<WBInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
+ public Set<WeldInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
{
return injectionPoints;
}
@@ -425,7 +425,7 @@
* @param annotatedItem The other annotation to check
* @return True if assignable, otherwise false
*/
- public boolean isAssignableFrom(WBAnnotated<?, ?> annotatedItem)
+ public boolean isAssignableFrom(WeldAnnotated<?, ?> annotatedItem)
{
return this.getAnnotatedItem().isAssignableFrom(annotatedItem);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractClassBean.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -44,8 +44,8 @@
import org.jboss.weld.context.SerializableContextualInstance;
import org.jboss.weld.injection.FieldInjectionPoint;
import org.jboss.weld.injection.MethodInjectionPoint;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.WBMethod;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.log.LogProvider;
import org.jboss.weld.log.Logging;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
@@ -69,7 +69,7 @@
// Logger
private static final LogProvider log =
Logging.getLogProvider(AbstractClassBean.class);
// The item representation
- protected WBClass<T> annotatedItem;
+ protected WeldClass<T> annotatedItem;
// The injectable fields of each type in the type hierarchy, with the actual type at
the bottom
private List<Set<FieldInjectionPoint<?, ?>>> injectableFields;
// The initializer methods of each type in the type hierarchy, with the actual type at
the bottom
@@ -81,8 +81,8 @@
private Class<T> proxyClassForDecorators;
private final ThreadLocal<Integer> decoratorStackPosition;
- private WBMethod<?, ?> postConstruct;
- private WBMethod<?, ?> preDestroy;
+ private WeldMethod<?, ?> postConstruct;
+ private WeldMethod<?, ?> preDestroy;
/**
* Constructor
@@ -90,7 +90,7 @@
* @param type The type
* @param manager The Bean manager
*/
- protected AbstractClassBean(WBClass<T> type, String idSuffix, BeanManagerImpl
manager)
+ protected AbstractClassBean(WeldClass<T> type, String idSuffix, BeanManagerImpl
manager)
{
super(idSuffix, manager);
this.annotatedItem = type;
@@ -251,7 +251,7 @@
@Override
protected void initScopeType()
{
- for (WBClass<?> clazz = getAnnotatedItem(); clazz != null; clazz =
clazz.getWBSuperclass())
+ for (WeldClass<?> clazz = getAnnotatedItem(); clazz != null; clazz =
clazz.getWeldSuperclass())
{
Set<Annotation> scopeTypes = new HashSet<Annotation>();
scopeTypes.addAll(clazz.getDeclaredMetaAnnotations(Scope.class));
@@ -292,7 +292,7 @@
protected void preSpecialize(BeanDeployerEnvironment environment)
{
super.preSpecialize(environment);
- if (getAnnotatedItem().getWBSuperclass() == null ||
getAnnotatedItem().getWBSuperclass().getJavaClass().equals(Object.class))
+ if (getAnnotatedItem().getWeldSuperclass() == null ||
getAnnotatedItem().getWeldSuperclass().getJavaClass().equals(Object.class))
{
throw new DefinitionException("Specializing bean must extend another bean
" + toString());
}
@@ -304,7 +304,7 @@
* @return The annotated item
*/
@Override
- public WBClass<T> getAnnotatedItem()
+ public WeldClass<T> getAnnotatedItem()
{
return annotatedItem;
}
@@ -350,7 +350,7 @@
public void postConstruct(T instance)
{
- WBMethod<?, ?> postConstruct = getPostConstruct();
+ WeldMethod<?, ?> postConstruct = getPostConstruct();
if (postConstruct != null)
{
try
@@ -366,7 +366,7 @@
public void preDestroy(T instance)
{
- WBMethod<?, ?> preDestroy = getPreDestroy();
+ WeldMethod<?, ?> preDestroy = getPreDestroy();
if (preDestroy != null)
{
try
@@ -402,7 +402,7 @@
*
* @return The post-construct method
*/
- public WBMethod<?, ?> getPostConstruct()
+ public WeldMethod<?, ?> getPostConstruct()
{
return postConstruct;
}
@@ -412,7 +412,7 @@
*
* @return The pre-destroy method
*/
- public WBMethod<?, ?> getPreDestroy()
+ public WeldMethod<?, ?> getPreDestroy()
{
return preDestroy;
}
@@ -455,8 +455,8 @@
builder.interceptPostConstruct().with(manager.resolveInterceptors(InterceptionType.POST_CONSTRUCT,
classBindingAnnotations.toArray(new Annotation[0])).toArray(new
Interceptor<?>[]{}));
builder.interceptPreDestroy().with(manager.resolveInterceptors(InterceptionType.PRE_DESTROY,
classBindingAnnotations.toArray(new Annotation[0])).toArray(new
Interceptor<?>[]{}));
- List<WBMethod<?, ?>> businessMethods =
Beans.getInterceptableBusinessMethods(getAnnotatedItem());
- for (WBMethod<?, ?> method : businessMethods)
+ List<WeldMethod<?, ?>> businessMethods =
Beans.getInterceptableBusinessMethods(getAnnotatedItem());
+ for (WeldMethod<?, ?> method : businessMethods)
{
List<Annotation> methodBindingAnnotations = new
ArrayList<Annotation>(classBindingAnnotations);
methodBindingAnnotations.addAll(flattenInterceptorBindings(manager,
method.getAnnotations()));
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractProducerBean.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -40,7 +40,7 @@
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.DefinitionException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
-import org.jboss.weld.introspector.WBMember;
+import org.jboss.weld.introspector.WeldMember;
import org.jboss.weld.log.LogProvider;
import org.jboss.weld.log.Logging;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
@@ -71,7 +71,7 @@
}
@Override
- public abstract WBMember<T, X, S> getAnnotatedItem();
+ public abstract WeldMember<T, X, S> getAnnotatedItem();
@Override
// Overriden to provide the class of the bean that declares the producer method/field
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/AbstractReceiverBean.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -23,8 +23,8 @@
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
-import org.jboss.weld.context.WBCreationalContext;
-import org.jboss.weld.introspector.WBMember;
+import org.jboss.weld.context.WeldCreationalContext;
+import org.jboss.weld.introspector.WeldMember;
import org.jboss.weld.log.LogProvider;
import org.jboss.weld.log.Logging;
@@ -68,9 +68,9 @@
}
else
{
- if (creationalContext instanceof WBCreationalContext<?>)
+ if (creationalContext instanceof WeldCreationalContext<?>)
{
- WBCreationalContext<?> creationalContextImpl =
(WBCreationalContext<?>) creationalContext;
+ WeldCreationalContext<?> creationalContextImpl =
(WeldCreationalContext<?>) creationalContext;
if (creationalContextImpl.containsIncompleteInstance(getDeclaringBean()))
{
log.warn("Executing producer field or method " +
getAnnotatedItem() + " on incomplete declaring bean " + getDeclaringBean() +
" due to circular injection");
@@ -119,6 +119,6 @@
}
@Override
- protected abstract WBMember<T, ?, S> getAnnotatedItem();
+ protected abstract WeldMember<T, ?, S> getAnnotatedItem();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java 2009-10-08 06:11:18
UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/DecoratorImpl.java 2009-10-08 06:32:51
UTC (rev 3895)
@@ -31,8 +31,8 @@
import org.jboss.weld.DefinitionException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.injection.MethodInjectionPoint;
-import org.jboss.weld.injection.WBInjectionPoint;
-import org.jboss.weld.introspector.WBClass;
+import org.jboss.weld.injection.WeldInjectionPoint;
+import org.jboss.weld.introspector.WeldClass;
public class DecoratorImpl<T> extends ManagedBean<T> implements
Decorator<T>
{
@@ -71,18 +71,18 @@
* @param manager the current manager
* @return a Bean
*/
- public static <T> DecoratorImpl<T> of(WBClass<T> clazz,
BeanManagerImpl manager)
+ public static <T> DecoratorImpl<T> of(WeldClass<T> clazz,
BeanManagerImpl manager)
{
return new DecoratorImpl<T>(clazz, manager);
}
- private WBInjectionPoint<?, ?> delegateInjectionPoint;
+ private WeldInjectionPoint<?, ?> delegateInjectionPoint;
private Set<Annotation> delegateBindings;
private Type delegateType;
private Set<Type> delegateTypes;
private Set<Type> decoratedTypes;
- protected DecoratorImpl(WBClass<T> type, BeanManagerImpl manager)
+ protected DecoratorImpl(WeldClass<T> type, BeanManagerImpl manager)
{
super(type, new
StringBuilder().append(Decorator.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(type.getName()).toString(),
manager);
}
@@ -116,7 +116,7 @@
@Override
protected void checkDelegateInjectionPoints()
{
- for (WBInjectionPoint<?, ?> injectionPoint : getDelegateInjectionPoints())
+ for (WeldInjectionPoint<?, ?> injectionPoint : getDelegateInjectionPoints())
{
if (injectionPoint instanceof MethodInjectionPoint<?, ?> &&
!injectionPoint.isAnnotationPresent(Inject.class))
{
@@ -197,7 +197,7 @@
return decoratedTypes;
}
- public WBInjectionPoint<?, ?> getDelegateInjectionPoint()
+ public WeldInjectionPoint<?, ?> getDelegateInjectionPoint()
{
return delegateInjectionPoint;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/DisposalMethod.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -33,14 +33,14 @@
import org.jboss.weld.DefinitionException;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.injection.MethodInjectionPoint;
-import org.jboss.weld.introspector.WBMethod;
+import org.jboss.weld.introspector.WeldMethod;
public class DisposalMethod<X, T> extends AbstractReceiverBean<X, T, Method>
{
protected MethodInjectionPoint<T, ?> disposalMethodInjectionPoint;
- protected DisposalMethod(BeanManagerImpl manager, WBMethod<T, X> disposalMethod,
AbstractClassBean<X> declaringBean)
+ protected DisposalMethod(BeanManagerImpl manager, WeldMethod<T, X>
disposalMethod, AbstractClassBean<X> declaringBean)
{
super(new
StringBuilder().append(DisposalMethod.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(declaringBean.getAnnotatedItem().getName()).append(disposalMethod.getSignature().toString()).toString(),
declaringBean, manager);
this.disposalMethodInjectionPoint = MethodInjectionPoint.of(this, disposalMethod);
@@ -66,12 +66,12 @@
}
@Override
- public WBMethod<T, ?> getAnnotatedItem()
+ public WeldMethod<T, ?> getAnnotatedItem()
{
return disposalMethodInjectionPoint;
}
- public static <X, T> DisposalMethod<X, T> of(BeanManagerImpl manager,
WBMethod<T, X> disposalMethod, AbstractClassBean<X> declaringBean)
+ public static <X, T> DisposalMethod<X, T> of(BeanManagerImpl manager,
WeldMethod<T, X> disposalMethod, AbstractClassBean<X> declaringBean)
{
return new DisposalMethod<X, T>(manager, disposalMethod, declaringBean);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/InterceptorImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -21,7 +21,7 @@
import org.jboss.interceptor.registry.InterceptorClassMetadataRegistry;
import org.jboss.interceptor.proxy.DirectClassInterceptionHandler;
import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.introspector.WBClass;
+import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import javax.enterprise.inject.spi.InterceptionType;
@@ -40,14 +40,14 @@
private final Set<Annotation> interceptorBindingTypes;
- protected InterceptorImpl(WBClass<T> type, BeanManagerImpl manager)
+ protected InterceptorImpl(WeldClass<T> type, BeanManagerImpl manager)
{
super(type, new
StringBuilder().append(Interceptor.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(type.getName()).toString(),
manager);
this.interceptorClassMetadata =
InterceptorClassMetadataRegistry.getRegistry().getInterceptorClassMetadata(type.getJavaClass());
this.interceptorBindingTypes = flattenInterceptorBindings(manager,
getAnnotatedItem().getAnnotations());
}
- public static <T> InterceptorImpl<T> of(WBClass<T> type,
BeanManagerImpl manager)
+ public static <T> InterceptorImpl<T> of(WeldClass<T> type,
BeanManagerImpl manager)
{
return new InterceptorImpl(type, manager);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2009-10-08 06:11:18
UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/ManagedBean.java 2009-10-08 06:32:51
UTC (rev 3895)
@@ -41,11 +41,11 @@
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.injection.ConstructorInjectionPoint;
import org.jboss.weld.injection.InjectionContextImpl;
-import org.jboss.weld.injection.WBInjectionPoint;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.WBConstructor;
-import org.jboss.weld.introspector.WBField;
-import org.jboss.weld.introspector.WBMethod;
+import org.jboss.weld.injection.WeldInjectionPoint;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldConstructor;
+import org.jboss.weld.introspector.WeldField;
+import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.log.LogProvider;
import org.jboss.weld.log.Logging;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
@@ -67,10 +67,10 @@
// The constructor
private ConstructorInjectionPoint<T> constructor;
- private Set<WBInjectionPoint<?, ?>> ejbInjectionPoints;
- private Set<WBInjectionPoint<?, ?>> persistenceContextInjectionPoints;
- private Set<WBInjectionPoint<?, ?>> persistenceUnitInjectionPoints;
- private Set<WBInjectionPoint<?, ?>> resourceInjectionPoints;
+ private Set<WeldInjectionPoint<?, ?>> ejbInjectionPoints;
+ private Set<WeldInjectionPoint<?, ?>> persistenceContextInjectionPoints;
+ private Set<WeldInjectionPoint<?, ?>> persistenceUnitInjectionPoints;
+ private Set<WeldInjectionPoint<?, ?>> resourceInjectionPoints;
private ManagedBean<?> specializedBean;
@@ -82,7 +82,7 @@
* @param manager the current manager
* @return A Web Bean
*/
- public static <T> ManagedBean<T> of(WBClass<T> clazz,
BeanManagerImpl manager)
+ public static <T> ManagedBean<T> of(WeldClass<T> clazz,
BeanManagerImpl manager)
{
return new ManagedBean<T>(clazz, new
StringBuilder().append(ManagedBean.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(clazz.getName()).toString(),
manager);
}
@@ -93,7 +93,7 @@
* @param type The type of the bean
* @param manager The Bean manager
*/
- protected ManagedBean(WBClass<T> type, String idSuffix, BeanManagerImpl
manager)
+ protected ManagedBean(WeldClass<T> type, String idSuffix, BeanManagerImpl
manager)
{
super(type, idSuffix, manager);
initType();
@@ -252,9 +252,9 @@
if (decorator instanceof DecoratorImpl<?>)
{
DecoratorImpl<?> decoratorBean = (DecoratorImpl<?>)
decorator;
- for (WBMethod<?, ?> decoratorMethod :
decoratorBean.getAnnotatedItem().getWBMethods())
+ for (WeldMethod<?, ?> decoratorMethod :
decoratorBean.getAnnotatedItem().getWeldMethods())
{
- WBMethod<?, ?> method =
getAnnotatedItem().getWBMethod(decoratorMethod.getSignature());
+ WeldMethod<?, ?> method =
getAnnotatedItem().getWBMethod(decoratorMethod.getSignature());
if (method != null && !method.isStatic() &&
!method.isPrivate() && method.isFinal())
{
throw new DefinitionException("Decorated bean method " +
method + " (decorated by "+ decoratorMethod + ") cannot be declarted
final");
@@ -275,7 +275,7 @@
super.checkBeanImplementation();
if (isNormalScoped())
{
- for (WBField<?, ?> field : getAnnotatedItem().getWBFields())
+ for (WeldField<?, ?> field : getAnnotatedItem().getWeldFields())
{
if (field.isPublic() && !field.isStatic())
{
@@ -301,7 +301,7 @@
protected void preSpecialize(BeanDeployerEnvironment environment)
{
super.preSpecialize(environment);
- if
(environment.getEjbDescriptors().contains(getAnnotatedItem().getWBSuperclass().getJavaClass()))
+ if
(environment.getEjbDescriptors().contains(getAnnotatedItem().getWeldSuperclass().getJavaClass()))
{
throw new DefinitionException("Simple bean must specialize a simple
bean");
}
@@ -310,11 +310,11 @@
@Override
protected void specialize(BeanDeployerEnvironment environment)
{
- if (environment.getClassBean(getAnnotatedItem().getWBSuperclass()) == null)
+ if (environment.getClassBean(getAnnotatedItem().getWeldSuperclass()) == null)
{
throw new DefinitionException(toString() + " does not specialize a
bean");
}
- AbstractClassBean<?> specializedBean =
environment.getClassBean(getAnnotatedItem().getWBSuperclass());
+ AbstractClassBean<?> specializedBean =
environment.getClassBean(getAnnotatedItem().getWeldSuperclass());
if (!(specializedBean instanceof ManagedBean))
{
throw new DefinitionException(toString() + " doesn't have a simple bean
as a superclass " + specializedBean);
@@ -340,7 +340,7 @@
*
* @return The constructor
*/
- public WBConstructor<T> getConstructor()
+ public WeldConstructor<T> getConstructor()
{
return constructor;
}
@@ -444,8 +444,8 @@
builder.interceptPreDestroy().with(classDeclaredInterceptors);
}
- List<WBMethod<?, ?>> businessMethods =
Beans.getInterceptableBusinessMethods(getAnnotatedItem());
- for (WBMethod<?, ?> method : businessMethods)
+ List<WeldMethod<?, ?>> businessMethods =
Beans.getInterceptableBusinessMethods(getAnnotatedItem());
+ for (WeldMethod<?, ?> method : businessMethods)
{
boolean excludeClassInterceptors =
method.isAnnotationPresent(InterceptionUtils.getExcludeClassInterceptorsAnnotationClass());
Class<?>[] methodDeclaredInterceptors = null;
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/NewManagedBean.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -23,7 +23,7 @@
import javax.enterprise.context.Dependent;
import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.introspector.WBClass;
+import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.literal.NewLiteral;
/**
@@ -41,7 +41,7 @@
* @param manager The Bean manager
* @return a new NewSimpleBean instance
*/
- public static <T> NewManagedBean<T> of(WBClass<T> clazz,
BeanManagerImpl manager)
+ public static <T> NewManagedBean<T> of(WeldClass<T> clazz,
BeanManagerImpl manager)
{
return new NewManagedBean<T>(clazz, new
StringBuilder().append(NewManagedBean.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(clazz.getName()).toString(),
manager);
}
@@ -54,7 +54,7 @@
* @param type An annotated class
* @param manager The Bean manager
*/
- protected NewManagedBean(final WBClass<T> type, String idSuffix, BeanManagerImpl
manager)
+ protected NewManagedBean(final WeldClass<T> type, String idSuffix,
BeanManagerImpl manager)
{
super(type, idSuffix, manager);
this.bindings = new HashSet<Annotation>();
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/NewSessionBean.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -24,7 +24,7 @@
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.ejb.InternalEjbDescriptor;
-import org.jboss.weld.introspector.WBClass;
+import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.literal.NewLiteral;
import org.jboss.weld.resources.ClassTransformer;
@@ -45,7 +45,7 @@
*/
public static <T> NewSessionBean<T> of(InternalEjbDescriptor<T>
ejbDescriptor, BeanManagerImpl manager)
{
- WBClass<T> type =
manager.getServices().get(ClassTransformer.class).loadClass(ejbDescriptor.getBeanClass());
+ WeldClass<T> type =
manager.getServices().get(ClassTransformer.class).loadClass(ejbDescriptor.getBeanClass());
return new NewSessionBean<T>(type, ejbDescriptor, new
StringBuilder().append(NewSessionBean.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(ejbDescriptor.getEjbName()).toString(),
manager);
}
@@ -57,7 +57,7 @@
* @param type An annotated class
* @param manager The Bean manager
*/
- protected NewSessionBean(final WBClass<T> type, InternalEjbDescriptor<T>
ejbDescriptor, String idSuffix, BeanManagerImpl manager)
+ protected NewSessionBean(final WeldClass<T> type, InternalEjbDescriptor<T>
ejbDescriptor, String idSuffix, BeanManagerImpl manager)
{
super(type, ejbDescriptor, idSuffix, manager);
this.bindings = new HashSet<Annotation>();
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java 2009-10-08 06:11:18
UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerField.java 2009-10-08 06:32:51
UTC (rev 3895)
@@ -25,7 +25,7 @@
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
-import org.jboss.weld.introspector.WBField;
+import org.jboss.weld.introspector.WeldField;
import org.jboss.weld.util.Names;
/**
@@ -38,7 +38,7 @@
public class ProducerField<X, T> extends AbstractProducerBean<X, T, Field>
{
// The underlying field
- private WBField<T, X> field;
+ private WeldField<T, X> field;
private final String id;
/**
@@ -49,7 +49,7 @@
* @param manager the current manager
* @return A producer field
*/
- public static <X, T> ProducerField<X, T> of(WBField<T, X> field,
AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
+ public static <X, T> ProducerField<X, T> of(WeldField<T, X> field,
AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
{
return new ProducerField<X, T>(field, declaringBean, manager);
}
@@ -61,7 +61,7 @@
* @param declaringBean The declaring bean
* @param manager The Bean manager
*/
- protected ProducerField(WBField<T, X> field, AbstractClassBean<X>
declaringBean, BeanManagerImpl manager)
+ protected ProducerField(WeldField<T, X> field, AbstractClassBean<X>
declaringBean, BeanManagerImpl manager)
{
super(new
StringBuilder().append(ProducerField.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(declaringBean.getAnnotatedItem().getName()).append(field.getName()).toString(),
declaringBean, manager);
this.field = field;
@@ -104,7 +104,7 @@
* @return The annotated item
*/
@Override
- public WBField<T, X> getAnnotatedItem()
+ public WeldField<T, X> getAnnotatedItem()
{
return field;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/ProducerMethod.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -32,8 +32,8 @@
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.injection.ParameterInjectionPoint;
-import org.jboss.weld.introspector.WBMethod;
-import org.jboss.weld.introspector.WBParameter;
+import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.introspector.WeldParameter;
import org.jboss.weld.util.Names;
/**
@@ -62,12 +62,12 @@
* @param manager the current manager
* @return A producer Web Bean
*/
- public static <X, T> ProducerMethod<X, T> of(WBMethod<T, X> method,
AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
+ public static <X, T> ProducerMethod<X, T> of(WeldMethod<T, X>
method, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
{
return new ProducerMethod<X, T>(method, declaringBean, manager);
}
- protected ProducerMethod(WBMethod<T, X> method, AbstractClassBean<X>
declaringBean, BeanManagerImpl manager)
+ protected ProducerMethod(WeldMethod<T, X> method, AbstractClassBean<X>
declaringBean, BeanManagerImpl manager)
{
super(new
StringBuilder().append(ProducerMethod.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(declaringBean.getAnnotatedItem().getName()).append(".").append(method.getSignature().toString()).toString(),
declaringBean, manager);
this.method = MethodInjectionPoint.of(this, method);
@@ -112,7 +112,7 @@
*/
protected void initProducerMethodInjectableParameters()
{
- for (WBParameter<?, ?> parameter : method.getWBParameters())
+ for (WeldParameter<?, ?> parameter : method.getWBParameters())
{
addInjectionPoint(ParameterInjectionPoint.of(this, parameter));
}
@@ -205,7 +205,7 @@
* @return The annotated item
*/
@Override
- public WBMethod<T, X> getAnnotatedItem()
+ public WeldMethod<T, X> getAnnotatedItem()
{
return method;
}
@@ -262,7 +262,7 @@
@Override
protected void preSpecialize(BeanDeployerEnvironment environment)
{
- if
(getDeclaringBean().getAnnotatedItem().getWBSuperclass().getDeclaredWBMethod(getAnnotatedItem().getAnnotatedMethod())
== null)
+ if
(getDeclaringBean().getAnnotatedItem().getWeldSuperclass().getDeclaredWeldMethod(getAnnotatedItem().getAnnotatedMethod())
== null)
{
throw new DefinitionException("Specialized producer method does not
override a method on the direct superclass");
}
@@ -271,7 +271,7 @@
@Override
protected void specialize(BeanDeployerEnvironment environment)
{
- WBMethod<?, ?> superClassMethod =
getDeclaringBean().getAnnotatedItem().getWBSuperclass().getWBMethod(getAnnotatedItem().getAnnotatedMethod());
+ WeldMethod<?, ?> superClassMethod =
getDeclaringBean().getAnnotatedItem().getWeldSuperclass().getWeldMethod(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/weld/bean/RIBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java 2009-10-08 06:11:18 UTC
(rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/RIBean.java 2009-10-08 06:32:51 UTC
(rev 3895)
@@ -25,7 +25,7 @@
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
-import org.jboss.weld.injection.WBInjectionPoint;
+import org.jboss.weld.injection.WeldInjectionPoint;
/**
* Abstract base class with functions specific to RI built-in beans
@@ -74,7 +74,7 @@
public abstract boolean isPrimitive();
- public abstract Set<WBInjectionPoint<?, ?>>
getAnnotatedInjectionPoints();
+ public abstract Set<WeldInjectionPoint<?, ?>>
getAnnotatedInjectionPoints();
public Set<InjectionPoint> getInjectionPoints()
{
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2009-10-08 06:11:18
UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/SessionBean.java 2009-10-08 06:32:51
UTC (rev 3895)
@@ -47,8 +47,8 @@
import org.jboss.weld.ejb.spi.BusinessInterfaceDescriptor;
import org.jboss.weld.ejb.spi.EjbServices;
import org.jboss.weld.injection.InjectionContextImpl;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.WBMethod;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.log.Log;
import org.jboss.weld.log.Logging;
import org.jboss.weld.resources.ClassTransformer;
@@ -84,7 +84,7 @@
*/
public static <T> SessionBean<T> of(InternalEjbDescriptor<T>
ejbDescriptor, BeanManagerImpl manager)
{
- WBClass<T> type =
manager.getServices().get(ClassTransformer.class).loadClass(ejbDescriptor.getBeanClass());
+ WeldClass<T> type =
manager.getServices().get(ClassTransformer.class).loadClass(ejbDescriptor.getBeanClass());
return new SessionBean<T>(type, ejbDescriptor, new
StringBuilder().append(SessionBean.class.getSimpleName()).append(BEAN_ID_SEPARATOR).append(ejbDescriptor.getEjbName()).toString(),
manager);
}
@@ -94,7 +94,7 @@
* @param type The type of the bean
* @param manager The Bean manager
*/
- protected SessionBean(WBClass<T> type, InternalEjbDescriptor<T>
ejbDescriptor, String idSuffix, BeanManagerImpl manager)
+ protected SessionBean(WeldClass<T> type, InternalEjbDescriptor<T>
ejbDescriptor, String idSuffix, BeanManagerImpl manager)
{
super(type, idSuffix, manager);
initType();
@@ -185,7 +185,7 @@
{
super.preSpecialize(environment);
// We appear to check this twice?
- if
(!environment.getEjbDescriptors().contains(getAnnotatedItem().getWBSuperclass().getJavaClass()))
+ if
(!environment.getEjbDescriptors().contains(getAnnotatedItem().getWeldSuperclass().getJavaClass()))
{
throw new DefinitionException("Annotation defined specializing EJB must
have EJB superclass");
}
@@ -194,11 +194,11 @@
@Override
protected void specialize(BeanDeployerEnvironment environment)
{
- if (environment.getClassBean(getAnnotatedItem().getWBSuperclass()) == null)
+ if (environment.getClassBean(getAnnotatedItem().getWeldSuperclass()) == null)
{
throw new IllegalStateException(toString() + " does not specialize a
bean");
}
- AbstractClassBean<?> specializedBean =
environment.getClassBean(getAnnotatedItem().getWBSuperclass());
+ AbstractClassBean<?> specializedBean =
environment.getClassBean(getAnnotatedItem().getWeldSuperclass());
if (!(specializedBean instanceof SessionBean<?>))
{
throw new IllegalStateException(toString() + " doesn't have a session
bean as a superclass " + specializedBean);
@@ -351,7 +351,7 @@
*/
protected void checkObserverMethods()
{
- for (WBMethod<?, ?> method :
this.annotatedItem.getDeclaredWBMethodsWithAnnotatedParameters(Observes.class))
+ for (WeldMethod<?, ?> method :
this.annotatedItem.getDeclaredWeldMethodsWithAnnotatedParameters(Observes.class))
{
if (!method.isStatic())
{
@@ -364,7 +364,7 @@
}
// TODO must be a nicer way to do this!
- public boolean isMethodExistsOnTypes(WBMethod<?, ?> method)
+ public boolean isMethodExistsOnTypes(WeldMethod<?, ?> method)
{
for (Type type : getTypes())
{
Modified:
ri/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/AbstractBuiltInBean.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -27,7 +27,7 @@
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
-import org.jboss.weld.injection.WBInjectionPoint;
+import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.literal.AnyLiteral;
import org.jboss.weld.literal.DefaultLiteral;
@@ -78,7 +78,7 @@
}
@Override
- public Set<WBInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
+ public Set<WeldInjectionPoint<?, ?>> getAnnotatedInjectionPoints()
{
return Collections.emptySet();
}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ExtensionBean.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ExtensionBean.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/ExtensionBean.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -25,7 +25,7 @@
import javax.enterprise.inject.spi.Extension;
import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.introspector.WBClass;
+import org.jboss.weld.introspector.WeldClass;
/**
* @author pmuir
@@ -36,10 +36,10 @@
private static final String ID_PREFIX = "Extension";
- private final WBClass<Extension> clazz;
+ private final WeldClass<Extension> clazz;
private final Extension instance;
- public ExtensionBean(BeanManagerImpl manager, WBClass<Extension> clazz,
Extension instance)
+ public ExtensionBean(BeanManagerImpl manager, WeldClass<Extension> clazz,
Extension instance)
{
super(new
StringBuilder().append(ID_PREFIX).append(BEAN_ID_SEPARATOR).append(clazz.getName()).toString(),
manager);
this.clazz = clazz;
Modified:
ri/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/facade/InstanceImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/facade/InstanceImpl.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/bean/builtin/facade/InstanceImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -31,7 +31,7 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.resolution.ResolvableWBClass;
+import org.jboss.weld.resolution.ResolvableWeldClass;
/**
* Helper implementation for Instance for getting instances
@@ -62,7 +62,7 @@
public T get(Annotation... bindings)
{
Annotation[] annotations = mergeInBindings(bindings);
- Bean<T> bean = getManager().getBean(ResolvableWBClass.<T>of(getType(),
annotations, getManager()), annotations);
+ Bean<T> bean =
getManager().getBean(ResolvableWeldClass.<T>of(getType(), annotations,
getManager()), annotations);
@SuppressWarnings("unchecked")
T instance = (T) getManager().getReference(bean, getType(),
getManager().createCreationalContext(bean));
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bean/ee/EEResourceProducerField.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/bean/ee/EEResourceProducerField.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/bean/ee/EEResourceProducerField.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -21,7 +21,7 @@
import org.jboss.weld.bean.ProducerField;
import org.jboss.weld.bootstrap.BeanDeployerEnvironment;
import org.jboss.weld.ejb.EJBApiAbstraction;
-import org.jboss.weld.introspector.WBField;
+import org.jboss.weld.introspector.WeldField;
import org.jboss.weld.persistence.PersistenceApiAbstraction;
import org.jboss.weld.ws.WSApiAbstraction;
@@ -40,12 +40,12 @@
* @param manager the current manager
* @return A producer field
*/
- public static <X, T> EEResourceProducerField<X, T> of(WBField<T, X>
field, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
+ public static <X, T> EEResourceProducerField<X, T> of(WeldField<T,
X> field, AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
{
return new EEResourceProducerField<X, T>(field, declaringBean, manager);
}
- protected EEResourceProducerField(WBField<T, X> field,
AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
+ protected EEResourceProducerField(WeldField<T, X> field,
AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
{
super(field, declaringBean, manager);
}
Modified:
ri/trunk/impl/src/main/java/org/jboss/weld/bean/ee/PersistenceContextProducerField.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/bean/ee/PersistenceContextProducerField.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/bean/ee/PersistenceContextProducerField.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -20,7 +20,7 @@
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.AbstractClassBean;
-import org.jboss.weld.introspector.WBField;
+import org.jboss.weld.introspector.WeldField;
/**
* @author pmuir
@@ -37,7 +37,7 @@
* @param manager the current manager
* @return A producer field
*/
- public static <X, T extends EntityManager> EEResourceProducerField<X, T>
of(WBField<T, X> field, AbstractClassBean<X> declaringBean, BeanManagerImpl
manager)
+ public static <X, T extends EntityManager> EEResourceProducerField<X, T>
of(WeldField<T, X> field, AbstractClassBean<X> declaringBean, BeanManagerImpl
manager)
{
return new PersistenceContextProducerField<X, T>(field, declaringBean,
manager);
}
@@ -47,7 +47,7 @@
* @param declaringBean
* @param manager
*/
- protected PersistenceContextProducerField(WBField<T, X> field,
AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
+ protected PersistenceContextProducerField(WeldField<T, X> field,
AbstractClassBean<X> declaringBean, BeanManagerImpl manager)
{
super(field, declaringBean, manager);
}
Modified:
ri/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/ClientProxyMethodHandler.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -27,7 +27,7 @@
import javax.enterprise.inject.spi.Bean;
import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.context.WBCreationalContext;
+import org.jboss.weld.context.WeldCreationalContext;
import org.jboss.weld.log.LogProvider;
import org.jboss.weld.log.Logging;
import org.jboss.weld.util.Reflections;
@@ -54,7 +54,7 @@
private final BeanManagerImpl manager;
- private static final ThreadLocal<WBCreationalContext<?>>
currentCreationalContext = new ThreadLocal<WBCreationalContext<?>>();
+ private static final ThreadLocal<WeldCreationalContext<?>>
currentCreationalContext = new ThreadLocal<WeldCreationalContext<?>>();
/**
* Constructor
@@ -120,7 +120,7 @@
private <T> T getProxiedInstance(Bean<T> bean)
{
- WBCreationalContext<T> creationalContext;
+ WeldCreationalContext<T> creationalContext;
boolean outer;
if (currentCreationalContext.get() == null)
{
Modified:
ri/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyMethodHandler.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyMethodHandler.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/bean/proxy/DecoratorProxyMethodHandler.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -27,7 +27,7 @@
import org.jboss.weld.bean.DecoratorImpl;
import org.jboss.weld.context.SerializableContextualInstance;
import org.jboss.weld.introspector.MethodSignature;
-import org.jboss.weld.introspector.WBMethod;
+import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.introspector.jlr.MethodSignatureImpl;
/**
@@ -79,7 +79,7 @@
MethodSignature methodSignature = new MethodSignatureImpl(method);
for (SerializableContextualInstance<DecoratorImpl<Object>, Object>
beanInstance : decoratorInstances)
{
- WBMethod<?, ?> decoratorMethod =
beanInstance.getContextual().get().getAnnotatedItem().getWBMethod(methodSignature);
+ WeldMethod<?, ?> decoratorMethod =
beanInstance.getContextual().get().getAnnotatedItem().getWBMethod(methodSignature);
if (decoratorMethod != null)
{
return decoratorMethod.invokeOnInstance(beanInstance.getInstance(), args);
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/AbstractBeanDeployer.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -51,9 +51,9 @@
import org.jboss.weld.ejb.spi.EjbServices;
import org.jboss.weld.event.ObserverFactory;
import org.jboss.weld.event.ObserverMethodImpl;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.WBField;
-import org.jboss.weld.introspector.WBMethod;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldField;
+import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.jsf.JsfApiAbstraction;
import org.jboss.weld.log.LogProvider;
import org.jboss.weld.log.Logging;
@@ -141,17 +141,17 @@
}
- protected <X> void createProducerMethods(AbstractClassBean<X>
declaringBean, WBClass<X> annotatedClass)
+ protected <X> void createProducerMethods(AbstractClassBean<X>
declaringBean, WeldClass<X> annotatedClass)
{
- for (WBMethod<?, X> method :
annotatedClass.getDeclaredAnnotatedWBMethods(Produces.class))
+ for (WeldMethod<?, X> method :
annotatedClass.getDeclaredAnnotatedWeldMethods(Produces.class))
{
createProducerMethod(declaringBean, method);
}
}
- protected <X> void createDisposalMethods(AbstractClassBean<X>
declaringBean, WBClass<X> annotatedClass)
+ protected <X> void createDisposalMethods(AbstractClassBean<X>
declaringBean, WeldClass<X> annotatedClass)
{
- for (WBMethod<?, X> method :
annotatedClass.getDeclaredWBMethodsWithAnnotatedParameters(Disposes.class))
+ for (WeldMethod<?, X> method :
annotatedClass.getDeclaredWeldMethodsWithAnnotatedParameters(Disposes.class))
{
DisposalMethod<X, ?> disposalBean = DisposalMethod.of(manager, method,
declaringBean);
disposalBean.initialize(getEnvironment());
@@ -159,13 +159,13 @@
}
}
- protected <X, T> void createProducerMethod(AbstractClassBean<X>
declaringBean, WBMethod<T, X> annotatedMethod)
+ protected <X, T> void createProducerMethod(AbstractClassBean<X>
declaringBean, WeldMethod<T, X> annotatedMethod)
{
ProducerMethod<X, T> bean = ProducerMethod.of(annotatedMethod, declaringBean,
manager);
getEnvironment().addBean(bean);
}
- protected <X, T> void createProducerField(AbstractClassBean<X>
declaringBean, WBField<T, X> field)
+ protected <X, T> void createProducerField(AbstractClassBean<X>
declaringBean, WeldField<T, X> field)
{
ProducerField<X, T> bean;
if (isPersistenceContextProducerField(field))
@@ -200,23 +200,23 @@
manager.fireEvent(eventType, payload);
}
- protected <X> void createProducerFields(AbstractClassBean<X>
declaringBean, WBClass<X> annotatedClass)
+ protected <X> void createProducerFields(AbstractClassBean<X>
declaringBean, WeldClass<X> annotatedClass)
{
- for (WBField<?, X> field :
annotatedClass.getDeclaredAnnotatedWBFields(Produces.class))
+ for (WeldField<?, X> field :
annotatedClass.getDeclaredAnnotatedWeldFields(Produces.class))
{
createProducerField(declaringBean, field);
}
}
- protected <X> void createObserverMethods(RIBean<X> declaringBean,
WBClass<X> annotatedClass)
+ protected <X> void createObserverMethods(RIBean<X> declaringBean,
WeldClass<X> annotatedClass)
{
- for (WBMethod<?, X> method :
annotatedClass.getDeclaredWBMethodsWithAnnotatedParameters(Observes.class))
+ for (WeldMethod<?, X> method :
annotatedClass.getDeclaredWeldMethodsWithAnnotatedParameters(Observes.class))
{
createObserverMethod(declaringBean, method);
}
}
- protected <X, T> void createObserverMethod(RIBean<X> declaringBean,
WBMethod<T, X> method)
+ protected <X, T> void createObserverMethod(RIBean<X> declaringBean,
WeldMethod<T, X> method)
{
ObserverMethodImpl<X, T> observer = ObserverFactory.create(method,
declaringBean, manager);
getEnvironment().addObserver(observer);
@@ -234,7 +234,7 @@
return;
}
- protected <T> void createSimpleBean(WBClass<T> annotatedClass)
+ protected <T> void createSimpleBean(WeldClass<T> annotatedClass)
{
ManagedBean<T> bean = ManagedBean.of(annotatedClass, manager);
getEnvironment().addBean(bean);
@@ -242,13 +242,13 @@
getEnvironment().addBean(NewManagedBean.of(annotatedClass, manager));
}
- protected <T> void createDecorator(WBClass<T> annotatedClass)
+ protected <T> void createDecorator(WeldClass<T> annotatedClass)
{
DecoratorImpl<T> bean = DecoratorImpl.of(annotatedClass, manager);
getEnvironment().addBean(bean);
}
- protected <T> void createInterceptor(WBClass<T> annotatedClass)
+ protected <T> void createInterceptor(WeldClass<T> annotatedClass)
{
InterceptorImpl<T> bean = InterceptorImpl.of(annotatedClass, manager);
getEnvironment().addBean(bean);
@@ -270,7 +270,7 @@
* The type to inspect
* @return True if simple Web Bean, false otherwise
*/
- protected boolean isTypeManagedBeanOrDecorator(WBClass<?> clazz)
+ protected boolean isTypeManagedBeanOrDecorator(WeldClass<?> clazz)
{
Class<?> javaClass = clazz.getJavaClass();
EJBApiAbstraction ejbApiAbstraction =
manager.getServices().get(EJBApiAbstraction.class);
@@ -288,7 +288,7 @@
hasSimpleWebBeanConstructor(clazz);
}
- protected boolean isEEResourceProducerField(WBField<?, ?> field)
+ protected boolean isEEResourceProducerField(WeldField<?, ?> field)
{
EJBApiAbstraction ejbApiAbstraction =
manager.getServices().get(EJBApiAbstraction.class);
PersistenceApiAbstraction persistenceApiAbstraction =
manager.getServices().get(PersistenceApiAbstraction.class);
@@ -296,15 +296,15 @@
return field.isAnnotationPresent(ejbApiAbstraction.EJB_ANNOTATION_CLASS) ||
field.isAnnotationPresent(ejbApiAbstraction.RESOURCE_ANNOTATION_CLASS) ||
field.isAnnotationPresent(persistenceApiAbstraction.PERSISTENCE_UNIT_ANNOTATION_CLASS) ||
field.isAnnotationPresent(wsApiAbstraction.WEB_SERVICE_REF_ANNOTATION_CLASS);
}
- protected boolean isPersistenceContextProducerField(WBField<?, ?> field)
+ protected boolean isPersistenceContextProducerField(WeldField<?, ?> field)
{
PersistenceApiAbstraction persistenceApiAbstraction =
manager.getServices().get(PersistenceApiAbstraction.class);
return
field.isAnnotationPresent(persistenceApiAbstraction.PERSISTENCE_CONTEXT_ANNOTATION_CLASS);
}
- private static boolean hasSimpleWebBeanConstructor(WBClass<?> type)
+ private static boolean hasSimpleWebBeanConstructor(WeldClass<?> type)
{
- return type.getNoArgsWBConstructor() != null ||
type.getAnnotatedWBConstructors(Inject.class).size() > 0;
+ return type.getNoArgsWeldConstructor() != null ||
type.getAnnotatedWeldConstructors(Inject.class).size() > 0;
}
public E getEnvironment()
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployer.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployer.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -28,7 +28,7 @@
import org.jboss.weld.bootstrap.events.ProcessAnnotatedTypeImpl;
import org.jboss.weld.ejb.EjbDescriptors;
import org.jboss.weld.ejb.InternalEjbDescriptor;
-import org.jboss.weld.introspector.WBClass;
+import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.resources.ClassTransformer;
/**
@@ -40,7 +40,7 @@
private final BeanManagerImpl deploymentManager;
- private final Set<WBClass<?>> classes;
+ private final Set<WeldClass<?>> classes;
/**
* @param manager
@@ -49,7 +49,7 @@
public BeanDeployer(BeanManagerImpl manager, BeanManagerImpl deploymentManager,
EjbDescriptors ejbDescriptors)
{
super(manager, new BeanDeployerEnvironment(ejbDescriptors, manager));
- this.classes = new HashSet<WBClass<?>>();
+ this.classes = new HashSet<WeldClass<?>>();
this.deploymentManager = deploymentManager;
}
@@ -62,9 +62,9 @@
deploymentManager.fireEvent(event);
if (!event.isVeto())
{
- if (event.getAnnotatedType() instanceof WBClass<?>)
+ if (event.getAnnotatedType() instanceof WeldClass<?>)
{
- classes.add((WBClass<?>) event.getAnnotatedType());
+ classes.add((WeldClass<?>) event.getAnnotatedType());
}
else
{
@@ -77,7 +77,7 @@
private static <X> ProcessAnnotatedTypeImpl<X>
createProcessAnnotatedTypeEvent(Class<X> clazz, ClassTransformer classTransformer)
{
- WBClass<X> annotatedType = classTransformer.loadClass(clazz);
+ WeldClass<X> annotatedType = classTransformer.loadClass(clazz);
return new ProcessAnnotatedTypeImpl<X>(annotatedType) {};
}
@@ -100,7 +100,7 @@
public BeanDeployer createBeans()
{
- for (WBClass<?> clazz : classes)
+ for (WeldClass<?> clazz : classes)
{
boolean managedBeanOrDecorator =
!getEnvironment().getEjbDescriptors().contains(clazz.getJavaClass()) &&
isTypeManagedBeanOrDecorator(clazz);
if (managedBeanOrDecorator &&
clazz.isAnnotationPresent(Decorator.class))
Modified:
ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/BeanDeployerEnvironment.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -39,16 +39,16 @@
import org.jboss.weld.bean.builtin.ExtensionBean;
import org.jboss.weld.ejb.EjbDescriptors;
import org.jboss.weld.event.ObserverMethodImpl;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.WBMethod;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.resolution.ResolvableFactory;
import org.jboss.weld.resolution.TypeSafeDisposerResolver;
public class BeanDeployerEnvironment
{
- private final Map<WBClass<?>, AbstractClassBean<?>> classBeanMap;
- private final Map<WBMethod<?, ?>, ProducerMethod<?, ?>>
producerMethodBeanMap;
+ private final Map<WeldClass<?>, AbstractClassBean<?>> classBeanMap;
+ private final Map<WeldMethod<?, ?>, ProducerMethod<?, ?>>
producerMethodBeanMap;
private final Set<RIBean<?>> beans;
private final Set<ObserverMethodImpl<?, ?>> observers;
private final List<DisposalMethod<?, ?>> allDisposalBeans;
@@ -60,8 +60,8 @@
public BeanDeployerEnvironment(EjbDescriptors ejbDescriptors, BeanManagerImpl
manager)
{
- this.classBeanMap = new HashMap<WBClass<?>,
AbstractClassBean<?>>();
- this.producerMethodBeanMap = new HashMap<WBMethod<?, ?>,
ProducerMethod<?, ?>>();
+ this.classBeanMap = new HashMap<WeldClass<?>,
AbstractClassBean<?>>();
+ this.producerMethodBeanMap = new HashMap<WeldMethod<?, ?>,
ProducerMethod<?, ?>>();
this.allDisposalBeans = new ArrayList<DisposalMethod<?, ?>>();
this.resolvedDisposalBeans = new HashSet<DisposalMethod<?, ?>>();
this.beans = new HashSet<RIBean<?>>();
@@ -72,7 +72,7 @@
this.disposalMethodResolver = new TypeSafeDisposerResolver(manager,
allDisposalBeans);
}
- public <X, T> ProducerMethod<X, T> getProducerMethod(WBMethod<X, T>
method)
+ public <X, T> ProducerMethod<X, T> getProducerMethod(WeldMethod<X,
T> method)
{
if (!producerMethodBeanMap.containsKey(method))
{
@@ -86,7 +86,7 @@
}
}
- public AbstractClassBean<?> getClassBean(WBClass<?> clazz)
+ public AbstractClassBean<?> getClassBean(WeldClass<?> clazz)
{
if (!classBeanMap.containsKey(clazz))
{
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployer.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployer.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/bootstrap/ExtensionBeanDeployer.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -24,7 +24,7 @@
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.Container;
import org.jboss.weld.bean.builtin.ExtensionBean;
-import org.jboss.weld.introspector.WBClass;
+import org.jboss.weld.introspector.WeldClass;
import org.jboss.weld.resources.ClassTransformer;
/**
@@ -49,7 +49,7 @@
for (Extension extension : extensions)
{
@SuppressWarnings("unchecked")
- WBClass<Extension> clazz = (WBClass<Extension>)
classTransformer.loadClass(extension.getClass());
+ WeldClass<Extension> clazz = (WeldClass<Extension>)
classTransformer.loadClass(extension.getClass());
ExtensionBean bean = new ExtensionBean(getManager(), clazz, extension);
this.
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/context/CreationalContextImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/context/CreationalContextImpl.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/context/CreationalContextImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -23,7 +23,7 @@
import javax.enterprise.context.spi.Contextual;
import javax.enterprise.context.spi.CreationalContext;
-public class CreationalContextImpl<T> implements CreationalContext<T>,
WBCreationalContext<T>, Serializable
+public class CreationalContextImpl<T> implements CreationalContext<T>,
WeldCreationalContext<T>, Serializable
{
private static final long serialVersionUID = 7375854583908262422L;
@@ -54,7 +54,7 @@
incompleteInstances.put(contextual, incompleteInstance);
}
- public <S> WBCreationalContext<S> getCreationalContext(Contextual<S>
Contextual)
+ public <S> WeldCreationalContext<S>
getCreationalContext(Contextual<S> Contextual)
{
return new CreationalContextImpl<S>(Contextual, new
HashMap<Contextual<?>, Object>(incompleteInstances),
dependentInstancesStore);
}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/context/DependentContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/context/DependentContext.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/context/DependentContext.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -60,9 +60,9 @@
if (creationalContext != null)
{
T instance = contextual.create(creationalContext);
- if (creationalContext instanceof WBCreationalContext<?>)
+ if (creationalContext instanceof WeldCreationalContext<?>)
{
- WBCreationalContext<T> creationalContextImpl =
(WBCreationalContext<T>) creationalContext;
+ WeldCreationalContext<T> creationalContextImpl =
(WeldCreationalContext<T>) creationalContext;
ContextualInstance<T> beanInstance = new
SerializableContextualInstance<Contextual<T>, T>(contextual, instance,
creationalContext);
creationalContextImpl.getParentDependentInstancesStore().addDependentInstance(beanInstance);
}
Deleted:
ri/trunk/impl/src/main/java/org/jboss/weld/context/ForwardingWBCreationalContext.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/context/ForwardingWBCreationalContext.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/context/ForwardingWBCreationalContext.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,79 +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.weld.context;
-
-import javax.enterprise.context.spi.Contextual;
-
-
-/**
- * @author pmuir
- *
- */
-public abstract class ForwardingWBCreationalContext<T> implements
WBCreationalContext<T>
-{
-
- protected abstract WBCreationalContext<T> delegate();
-
- public void push(T incompleteInstance)
- {
- delegate().push(incompleteInstance);
- }
-
- public void release()
- {
- delegate().release();
- }
-
- public boolean containsIncompleteInstance(Contextual<?> bean)
- {
- return delegate().containsIncompleteInstance(bean);
- }
-
- public <S> WBCreationalContext<S> getCreationalContext(Contextual<S>
Contextual)
- {
- return delegate().getCreationalContext(Contextual);
- }
-
- public <S> S getIncompleteInstance(Contextual<S> bean)
- {
- return delegate().getIncompleteInstance(bean);
- }
-
- public DependentInstancesStore getParentDependentInstancesStore()
- {
- return delegate().getParentDependentInstancesStore();
- }
-
- @Override
- public boolean equals(Object obj)
- {
- return delegate().equals(obj);
- }
-
- @Override
- public int hashCode()
- {
- return delegate().hashCode();
- }
-
- @Override
- public String toString()
- {
- return delegate().toString();
- }
-
-}
Copied:
ri/trunk/impl/src/main/java/org/jboss/weld/context/ForwardingWeldCreationalContext.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/context/ForwardingWBCreationalContext.java)
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/context/ForwardingWeldCreationalContext.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/context/ForwardingWeldCreationalContext.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +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 org.jboss.weld.context;
+
+import javax.enterprise.context.spi.Contextual;
+
+
+/**
+ * @author pmuir
+ *
+ */
+public abstract class ForwardingWeldCreationalContext<T> implements
WeldCreationalContext<T>
+{
+
+ protected abstract WeldCreationalContext<T> delegate();
+
+ public void push(T incompleteInstance)
+ {
+ delegate().push(incompleteInstance);
+ }
+
+ public void release()
+ {
+ delegate().release();
+ }
+
+ public boolean containsIncompleteInstance(Contextual<?> bean)
+ {
+ return delegate().containsIncompleteInstance(bean);
+ }
+
+ public <S> WeldCreationalContext<S>
getCreationalContext(Contextual<S> Contextual)
+ {
+ return delegate().getCreationalContext(Contextual);
+ }
+
+ public <S> S getIncompleteInstance(Contextual<S> bean)
+ {
+ return delegate().getIncompleteInstance(bean);
+ }
+
+ public DependentInstancesStore getParentDependentInstancesStore()
+ {
+ return delegate().getParentDependentInstancesStore();
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ return delegate().equals(obj);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return delegate().hashCode();
+ }
+
+ @Override
+ public String toString()
+ {
+ return delegate().toString();
+ }
+
+}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/context/WBCreationalContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/context/WBCreationalContext.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/context/WBCreationalContext.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,42 +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.weld.context;
-
-import javax.enterprise.context.spi.Contextual;
-import javax.enterprise.context.spi.CreationalContext;
-
-/**
- * @author pmuir
- *
- * @param <T>
- */
-public interface WBCreationalContext<T> extends CreationalContext<T>
-{
-
- public abstract void push(T incompleteInstance);
-
- public abstract <S> WBCreationalContext<S>
getCreationalContext(Contextual<S> Contextual);
-
- public abstract <S> S getIncompleteInstance(Contextual<S> bean);
-
- public abstract boolean containsIncompleteInstance(Contextual<?> bean);
-
- public abstract DependentInstancesStore getParentDependentInstancesStore();
-
- public abstract void release();
-
-}
\ No newline at end of file
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/context/WeldCreationalContext.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/context/WBCreationalContext.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/context/WeldCreationalContext.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/context/WeldCreationalContext.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +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 org.jboss.weld.context;
+
+import javax.enterprise.context.spi.Contextual;
+import javax.enterprise.context.spi.CreationalContext;
+
+/**
+ * @author pmuir
+ *
+ * @param <T>
+ */
+public interface WeldCreationalContext<T> extends CreationalContext<T>
+{
+
+ public abstract void push(T incompleteInstance);
+
+ public abstract <S> WeldCreationalContext<S>
getCreationalContext(Contextual<S> Contextual);
+
+ public abstract <S> S getIncompleteInstance(Contextual<S> bean);
+
+ public abstract boolean containsIncompleteInstance(Contextual<?> bean);
+
+ public abstract DependentInstancesStore getParentDependentInstancesStore();
+
+ public abstract void release();
+
+}
\ No newline at end of file
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/el/ELCreationalContext.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/el/ELCreationalContext.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/el/ELCreationalContext.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -7,19 +7,19 @@
import javax.enterprise.context.Dependent;
import javax.enterprise.inject.spi.Bean;
-import org.jboss.weld.context.ForwardingWBCreationalContext;
-import org.jboss.weld.context.WBCreationalContext;
+import org.jboss.weld.context.ForwardingWeldCreationalContext;
+import org.jboss.weld.context.WeldCreationalContext;
-abstract class ELCreationalContext<T> extends
ForwardingWBCreationalContext<T>
+abstract class ELCreationalContext<T> extends
ForwardingWeldCreationalContext<T>
{
- public static <X> ELCreationalContext<X> of(final
WBCreationalContext<X> creationalContext)
+ public static <X> ELCreationalContext<X> of(final
WeldCreationalContext<X> creationalContext)
{
return new ELCreationalContext<X>()
{
@Override
- protected WBCreationalContext<X> delegate()
+ protected WeldCreationalContext<X> delegate()
{
return creationalContext;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/event/ObserverFactory.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/event/ObserverFactory.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/event/ObserverFactory.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -21,8 +21,8 @@
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.RIBean;
-import org.jboss.weld.introspector.WBMethod;
-import org.jboss.weld.introspector.WBParameter;
+import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.introspector.WeldParameter;
import org.jboss.weld.transaction.spi.TransactionServices;
/**
@@ -41,7 +41,7 @@
* @param manager The Bean manager
* @return An observer implementation built from the method abstraction
*/
- public static <X, T> ObserverMethodImpl<X, T> create(WBMethod<T, X>
method, RIBean<X> declaringBean, BeanManagerImpl manager)
+ public static <X, T> ObserverMethodImpl<X, T> create(WeldMethod<T,
X> method, RIBean<X> declaringBean, BeanManagerImpl manager)
{
ObserverMethodImpl<X, T> result = null;
TransactionPhase transactionPhase = getTransactionalPhase(method);
@@ -62,9 +62,9 @@
* @param observer The observer method
* @return true if the observer method is annotated as transactional
*/
- public static TransactionPhase getTransactionalPhase(WBMethod<?, ?> observer)
+ public static TransactionPhase getTransactionalPhase(WeldMethod<?, ?> observer)
{
- WBParameter<?, ?> parameter =
observer.getAnnotatedWBParameters(Observes.class).iterator().next();
+ WeldParameter<?, ?> parameter =
observer.getAnnotatedWBParameters(Observes.class).iterator().next();
return parameter.getAnnotation(Observes.class).during();
}
}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/event/ObserverMethodImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -41,8 +41,8 @@
import org.jboss.weld.DefinitionException;
import org.jboss.weld.bean.RIBean;
import org.jboss.weld.injection.MethodInjectionPoint;
-import org.jboss.weld.introspector.WBMethod;
-import org.jboss.weld.introspector.WBParameter;
+import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.introspector.WeldParameter;
import org.jboss.weld.manager.api.ExecutorServices;
/**
@@ -75,7 +75,7 @@
* @param declaringBean The observer bean
* @param manager The Bean manager
*/
- protected ObserverMethodImpl(final WBMethod<T, X> observer, final
RIBean<X> declaringBean, final BeanManagerImpl manager)
+ protected ObserverMethodImpl(final WeldMethod<T, X> observer, final
RIBean<X> declaringBean, final BeanManagerImpl manager)
{
this.manager = manager;
this.declaringBean = declaringBean;
@@ -95,7 +95,7 @@
private void checkObserverMethod()
{
// Make sure exactly one and only one parameter is annotated with Observes
- List<WBParameter<?, ?>> eventObjects =
this.observerMethod.getAnnotatedParameters(Observes.class);
+ List<WeldParameter<?, ?>> eventObjects =
this.observerMethod.getAnnotatedParameters(Observes.class);
if (this.notifyType.equals(Notify.IF_EXISTS) &&
declaringBean.getScope().equals(Dependent.class))
{
throw new DefinitionException(this + " is invalid because it is a
conditional observer method, and is declared by a @Dependent scoped bean");
@@ -108,7 +108,7 @@
// variable or wildcard
if (eventObjects.size() > 0)
{
- WBParameter<?, ?> eventParam = eventObjects.iterator().next();
+ WeldParameter<?, ?> eventParam = eventObjects.iterator().next();
if (eventParam.isParameterizedType())
{
for (Type type : eventParam.getActualTypeArguments())
@@ -125,7 +125,7 @@
}
}
// Check for parameters annotated with @Disposes
- List<WBParameter<?, ?>> disposeParams =
this.observerMethod.getAnnotatedParameters(Disposes.class);
+ List<WeldParameter<?, ?>> 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/weld/event/TransactionalObserverMethodImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/event/TransactionalObserverMethodImpl.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/event/TransactionalObserverMethodImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -21,7 +21,7 @@
import org.jboss.weld.BeanManagerImpl;
import org.jboss.weld.bean.RIBean;
-import org.jboss.weld.introspector.WBMethod;
+import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.transaction.spi.TransactionServices;
/**
@@ -38,7 +38,7 @@
* @param observerBean The bean declaring the observer method
* @param manager The JCDI manager in use
*/
- protected TransactionalObserverMethodImpl(WBMethod<T, X> observer,
RIBean<X> observerBean, TransactionPhase transactionPhase, BeanManagerImpl manager)
+ protected TransactionalObserverMethodImpl(WeldMethod<T, X> observer,
RIBean<X> observerBean, TransactionPhase transactionPhase, BeanManagerImpl manager)
{
super(observer, observerBean, manager);
this.transactionPhase = transactionPhase;
Modified:
ri/trunk/impl/src/main/java/org/jboss/weld/injection/ConstructorInjectionPoint.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/injection/ConstructorInjectionPoint.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/injection/ConstructorInjectionPoint.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -35,17 +35,17 @@
import javax.enterprise.inject.spi.Decorator;
import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.introspector.ForwardingWBConstructor;
-import org.jboss.weld.introspector.WBConstructor;
-import org.jboss.weld.introspector.WBParameter;
+import org.jboss.weld.introspector.ForwardingWeldConstructor;
+import org.jboss.weld.introspector.WeldConstructor;
+import org.jboss.weld.introspector.WeldParameter;
-public class ConstructorInjectionPoint<T> extends ForwardingWBConstructor<T>
implements WBInjectionPoint<T, Constructor<T>>
+public class ConstructorInjectionPoint<T> extends
ForwardingWeldConstructor<T> implements WeldInjectionPoint<T,
Constructor<T>>
{
private abstract class ForwardingParameterInjectionPointList extends
AbstractList<ParameterInjectionPoint<?, ?>>
{
- protected abstract List<? extends WBParameter<?, ?>> delegate();
+ protected abstract List<? extends WeldParameter<?, ?>> delegate();
protected abstract Bean<?> declaringBean();;
@@ -66,15 +66,15 @@
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
private final Bean<?> declaringBean;
- private final WBConstructor<T> constructor;
+ private final WeldConstructor<T> constructor;
private final boolean delegate;
- public static <T> ConstructorInjectionPoint<T> of(Bean<?>
declaringBean, WBConstructor<T> constructor)
+ public static <T> ConstructorInjectionPoint<T> of(Bean<?>
declaringBean, WeldConstructor<T> constructor)
{
return new ConstructorInjectionPoint<T>(declaringBean, constructor);
}
- protected ConstructorInjectionPoint(Bean<?> declaringBean,
WBConstructor<T> constructor)
+ protected ConstructorInjectionPoint(Bean<?> declaringBean,
WeldConstructor<T> constructor)
{
this.declaringBean = declaringBean;
this.constructor = constructor;
@@ -82,7 +82,7 @@
}
@Override
- protected WBConstructor<T> delegate()
+ protected WeldConstructor<T> delegate()
{
return constructor;
}
@@ -125,7 +125,7 @@
@Override
public List<ParameterInjectionPoint<?, ?>> getWBParameters()
{
- final List<? extends WBParameter<?, ?>> delegate =
super.getWBParameters();
+ final List<? extends WeldParameter<?, ?>> delegate =
super.getWBParameters();
return new ForwardingParameterInjectionPointList()
{
@@ -136,7 +136,7 @@
}
@Override
- protected List<? extends WBParameter<?, ?>> delegate()
+ protected List<? extends WeldParameter<?, ?>> delegate()
{
return delegate;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/injection/FieldInjectionPoint.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/injection/FieldInjectionPoint.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/injection/FieldInjectionPoint.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -31,24 +31,24 @@
import javax.enterprise.inject.spi.Decorator;
import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.introspector.ForwardingWBField;
-import org.jboss.weld.introspector.WBField;
+import org.jboss.weld.introspector.ForwardingWeldField;
+import org.jboss.weld.introspector.WeldField;
-public class FieldInjectionPoint<T, X> extends ForwardingWBField<T, X>
implements WBInjectionPoint<T, Field>
+public class FieldInjectionPoint<T, X> extends ForwardingWeldField<T, X>
implements WeldInjectionPoint<T, Field>
{
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
private final Bean<?> declaringBean;
- private final WBField<T, X> field;
+ private final WeldField<T, X> field;
private final boolean delegate;
- public static <T, X> FieldInjectionPoint<T, X> of(Bean<?>
declaringBean, WBField<T, X> field)
+ public static <T, X> FieldInjectionPoint<T, X> of(Bean<?>
declaringBean, WeldField<T, X> field)
{
return new FieldInjectionPoint<T, X>(declaringBean, field);
}
- protected FieldInjectionPoint(Bean<?> declaringBean, WBField<T, X> field)
+ protected FieldInjectionPoint(Bean<?> declaringBean, WeldField<T, X>
field)
{
this.declaringBean = declaringBean;
this.field = field;
@@ -56,7 +56,7 @@
}
@Override
- protected WBField<T, X> delegate()
+ protected WeldField<T, X> delegate()
{
return field;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/injection/MethodInjectionPoint.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/injection/MethodInjectionPoint.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/injection/MethodInjectionPoint.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -35,17 +35,17 @@
import javax.enterprise.inject.spi.Decorator;
import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.introspector.ForwardingWBMethod;
-import org.jboss.weld.introspector.WBMethod;
-import org.jboss.weld.introspector.WBParameter;
+import org.jboss.weld.introspector.ForwardingWeldMethod;
+import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.introspector.WeldParameter;
-public class MethodInjectionPoint<T, X> extends ForwardingWBMethod<T, X>
implements WBInjectionPoint<T, Method>
+public class MethodInjectionPoint<T, X> extends ForwardingWeldMethod<T, X>
implements WeldInjectionPoint<T, Method>
{
private abstract class ForwardingParameterInjectionPointList extends
AbstractList<ParameterInjectionPoint<?, ?>>
{
- protected abstract List<? extends WBParameter<?, ?>> delegate();
+ protected abstract List<? extends WeldParameter<?, ?>> delegate();
protected abstract Bean<?> declaringBean();;
@@ -66,15 +66,15 @@
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
private final Bean<?> declaringBean;
- private final WBMethod<T, X> method;
+ private final WeldMethod<T, X> method;
private final boolean delegate;
- public static <T, X> MethodInjectionPoint<T, X> of(Bean<?>
declaringBean, WBMethod<T, X> method)
+ public static <T, X> MethodInjectionPoint<T, X> of(Bean<?>
declaringBean, WeldMethod<T, X> method)
{
return new MethodInjectionPoint<T, X>(declaringBean, method);
}
- protected MethodInjectionPoint(Bean<?> declaringBean, WBMethod<T, X>
method)
+ protected MethodInjectionPoint(Bean<?> declaringBean, WeldMethod<T, X>
method)
{
this.declaringBean = declaringBean;
this.method = method;
@@ -82,7 +82,7 @@
}
@Override
- protected WBMethod<T, X> delegate()
+ protected WeldMethod<T, X> delegate()
{
return method;
}
@@ -202,7 +202,7 @@
@Override
public List<ParameterInjectionPoint<?, ?>> getWBParameters()
{
- final List<? extends WBParameter<?, ?>> delegate =
super.getWBParameters();
+ final List<? extends WeldParameter<?, ?>> delegate =
super.getWBParameters();
return new ForwardingParameterInjectionPointList()
{
@@ -213,7 +213,7 @@
}
@Override
- protected List<? extends WBParameter<?, ?>> delegate()
+ protected List<? extends WeldParameter<?, ?>> delegate()
{
return delegate;
}
Modified:
ri/trunk/impl/src/main/java/org/jboss/weld/injection/ParameterInjectionPoint.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/injection/ParameterInjectionPoint.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/injection/ParameterInjectionPoint.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -28,24 +28,24 @@
import javax.enterprise.inject.spi.Decorator;
import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.introspector.ForwardingWBParameter;
-import org.jboss.weld.introspector.WBParameter;
+import org.jboss.weld.introspector.ForwardingWeldParameter;
+import org.jboss.weld.introspector.WeldParameter;
-public class ParameterInjectionPoint<T, X> extends ForwardingWBParameter<T,
X> implements WBInjectionPoint<T, Object>
+public class ParameterInjectionPoint<T, X> extends ForwardingWeldParameter<T,
X> implements WeldInjectionPoint<T, Object>
{
private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
- public static <T, X> ParameterInjectionPoint<T, X> of(Bean<?>
declaringBean, WBParameter<T, X> parameter)
+ public static <T, X> ParameterInjectionPoint<T, X> of(Bean<?>
declaringBean, WeldParameter<T, X> parameter)
{
return new ParameterInjectionPoint<T, X>(declaringBean, parameter);
}
private final Bean<?> declaringBean;
- private final WBParameter<T, X> parameter;
+ private final WeldParameter<T, X> parameter;
private final boolean delegate;
- private ParameterInjectionPoint(Bean<?> declaringBean, WBParameter<T, X>
parameter)
+ private ParameterInjectionPoint(Bean<?> declaringBean, WeldParameter<T, X>
parameter)
{
this.declaringBean = declaringBean;
this.parameter = parameter;
@@ -53,7 +53,7 @@
}
@Override
- protected WBParameter<T, X> delegate()
+ protected WeldParameter<T, X> delegate()
{
return parameter;
}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/injection/WBInjectionPoint.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/injection/WBInjectionPoint.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/injection/WBInjectionPoint.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -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.weld.injection;
-
-import javax.enterprise.inject.spi.InjectionPoint;
-
-import org.jboss.weld.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);
-
-}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/injection/WeldInjectionPoint.java (from
rev 3879, ri/trunk/impl/src/main/java/org/jboss/weld/injection/WBInjectionPoint.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/injection/WeldInjectionPoint.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/injection/WeldInjectionPoint.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -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.weld.injection;
+
+import javax.enterprise.inject.spi.InjectionPoint;
+
+import org.jboss.weld.introspector.WeldAnnotated;
+
+public interface WeldInjectionPoint<T, S> extends InjectionPoint,
WeldAnnotated<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/weld/introspector/AnnotationStore.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/AnnotationStore.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/AnnotationStore.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -16,7 +16,7 @@
*/
package org.jboss.weld.introspector;
-import static org.jboss.weld.introspector.WBAnnotated.MAPPED_METAANNOTATIONS;
+import static org.jboss.weld.introspector.WeldAnnotated.MAPPED_METAANNOTATIONS;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
Deleted:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBAnnotated.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBAnnotated.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBAnnotated.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,139 +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.weld.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> extends ForwardingAnnotated<T,
S> implements WBAnnotated<T, S>
-{
-
- public Type[] getActualTypeArguments()
- {
- return delegate().getActualTypeArguments();
- }
-
- public Set<Annotation> getMetaAnnotations(Class<? extends Annotation>
metaAnnotationType)
- {
- return delegate().getMetaAnnotations(metaAnnotationType);
- }
-
- public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation>
metaAnnotationType)
- {
- return delegate().getMetaAnnotationsAsArray(metaAnnotationType);
- }
-
- @Deprecated
- public Set<Annotation> getQualifiers()
- {
- return delegate().getQualifiers();
- }
-
- @Deprecated
- public Annotation[] getBindingsAsArray()
- {
- return delegate().getBindingsAsArray();
- }
-
- public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends
Annotation> metaAnnotationType)
- {
- return delegate().getDeclaredMetaAnnotations(metaAnnotationType);
- }
-
- public String getName()
- {
- return delegate().getName();
- }
-
- public Class<T> getJavaClass()
- {
- return delegate().getJavaClass();
- }
-
- public boolean isAssignableFrom(WBAnnotated<?, ?> that)
- {
- return delegate().isAssignableFrom(that);
- }
-
- public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
- {
- return delegate().isAssignableFrom(type, actualTypeArguments);
- }
-
- public boolean isFinal()
- {
- return delegate().isFinal();
- }
-
- public boolean isStatic()
- {
- return delegate().isStatic();
- }
-
- public boolean isProxyable()
- {
- return delegate().isProxyable();
- }
-
- public boolean isPublic()
- {
- return delegate().isPublic();
- }
-
- public boolean isPrivate()
- {
- return delegate().isPrivate();
- }
-
- public boolean isPackagePrivate()
- {
- return delegate().isPackagePrivate();
- }
-
- public Package getPackage()
- {
- return delegate().getPackage();
- }
-
- @Override
- protected abstract WBAnnotated<T, S> delegate();
-
- public boolean isDeclaredAnnotationPresent(Class<? extends Annotation>
annotationType)
- {
- return delegate().isDeclaredAnnotationPresent(annotationType);
- }
-
- public Set<Type> getInterfaceOnlyFlattenedTypeHierarchy()
- {
- return delegate().getInterfaceOnlyFlattenedTypeHierarchy();
- }
-
- public boolean isParameterizedType()
- {
- return delegate().isParameterizedType();
- }
-
-}
Deleted:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBAnnotation.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBAnnotation.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBAnnotation.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -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.weld.introspector;
-
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
-public abstract class ForwardingWBAnnotation<T extends Annotation> extends
ForwardingWBClass<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();
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBClass.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBClass.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBClass.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,172 +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.weld.introspector;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.Set;
-
-public abstract class ForwardingWBClass<T> extends ForwardingWBAnnotated<T,
Class<T>> implements WBClass<T>
-{
-
- @Override
- protected abstract WBClass<T> delegate();
-
- public Set<WBConstructor<T>> getAnnotatedWBConstructors(Class<? extends
Annotation> annotationType)
- {
- return delegate().getAnnotatedWBConstructors(annotationType);
- }
-
- public Set<WBField<?, ?>> getAnnotatedWBFields(Class<? extends
Annotation> annotationType)
- {
- return delegate().getAnnotatedWBFields(annotationType);
- }
-
- public Set<WBMethod<?, ?>> getAnnotatedWBMethods(Class<? extends
Annotation> annotationType)
- {
- return delegate().getAnnotatedWBMethods(annotationType);
- }
-
- public WBConstructor<T> getNoArgsWBConstructor()
- {
- return delegate().getNoArgsWBConstructor();
- }
-
- public Set<WBConstructor<T>> getWBConstructors()
- {
- return delegate().getWBConstructors();
- }
-
- public Set<WBMethod<?, ?>> getWBMethods()
- {
- return delegate().getWBMethods();
- }
-
- public Set<WBField<?, T>> getDeclaredAnnotatedWBFields(Class<? extends
Annotation> annotationType)
- {
- return delegate().getDeclaredAnnotatedWBFields(annotationType);
- }
-
- public Set<WBMethod<?, T>> getDeclaredAnnotatedWBMethods(Class<?
extends Annotation> annotationType)
- {
- return delegate().getDeclaredAnnotatedWBMethods(annotationType);
- }
-
- public Set<WBMethod<?, T>>
getDeclaredWBMethodsWithAnnotatedParameters(Class<? extends Annotation>
annotationType)
- {
- return delegate().getDeclaredWBMethodsWithAnnotatedParameters(annotationType);
- }
-
- public Set<WBField<?, ?>> getWBFields()
- {
- return delegate().getWBFields();
- }
-
- public Set<WBField<?, ?>> getMetaAnnotatedWBFields(Class<? extends
Annotation> metaAnnotationType)
- {
- return delegate().getMetaAnnotatedWBFields(metaAnnotationType);
- }
-
- @Deprecated
- public WBMethod<?, ?> getWBMethod(Method method)
- {
- return delegate().getWBMethod(method);
- }
-
- public <M> WBMethod<M, ?> getWBMethod(MethodSignature signature)
- {
- return delegate().getWBMethod(signature);
- }
-
- public Set<WBMethod<?, ?>> getWBMethodsWithAnnotatedParameters(Class<?
extends Annotation> annotationType)
- {
- return delegate().getWBMethodsWithAnnotatedParameters(annotationType);
- }
-
- public Set<WBConstructor<?>>
getWBConstructorsWithAnnotatedParameters(Class<? extends Annotation>
annotationType)
- {
- return delegate().getWBConstructorsWithAnnotatedParameters(annotationType);
- }
-
- public WBClass<?> getWBSuperclass()
- {
- return delegate().getWBSuperclass();
- }
-
- public boolean isNonStaticMemberClass()
- {
- return delegate().isNonStaticMemberClass();
- }
-
- @Override
- public boolean isParameterizedType()
- {
- return delegate().isParameterizedType();
- }
-
- public boolean isAbstract()
- {
- return delegate().isAbstract();
- }
-
- public boolean isEnum()
- {
- return delegate().isEnum();
- }
-
- @Deprecated
- public WBMethod<?, ?> getDeclaredWBMethod(Method method)
- {
- return delegate().getDeclaredWBMethod(method);
- }
-
- public <F> WBField<F, ?> getDeclaredWBField(String fieldName,
WBClass<F> expectedType)
- {
- return delegate().getDeclaredWBField(fieldName, expectedType);
- }
-
- public <M> WBMethod<M, ?> getDeclaredWBMethod(MethodSignature signature,
WBClass<M> expectedReturnType)
- {
- return delegate().getDeclaredWBMethod(signature, expectedReturnType);
- }
-
- public WBConstructor<T> getDeclaredWBConstructor(ConstructorSignature
signature)
- {
- return delegate().getDeclaredWBConstructor(signature);
- }
-
- public <U> WBClass<? extends U> asWBSubclass(WBClass<U> clazz)
- {
- return delegate().asWBSubclass(clazz);
- }
-
- public <S> S cast(Object object)
- {
- return delegate().<S>cast(object);
- }
-
- public boolean isEquivalent(Class<?> clazz)
- {
- return delegate().isEquivalent(clazz);
- }
-
- public String getSimpleName()
- {
- return delegate().getSimpleName();
- }
-
-}
Deleted:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBConstructor.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBConstructor.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBConstructor.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,62 +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.weld.introspector;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-
-import javax.enterprise.inject.spi.AnnotatedParameter;
-
-public abstract class ForwardingWBConstructor<T> extends ForwardingWBMember<T,
T, Constructor<T>> implements WBConstructor<T>
-{
-
- @Override
- protected abstract WBConstructor<T> delegate();
-
- public List<WBParameter<?, ?>> getAnnotatedWBParameters(Class<? extends
Annotation> annotationType)
- {
- return delegate().getAnnotatedWBParameters(annotationType);
- }
-
- public WBClass<T> getDeclaringType()
- {
- return delegate().getDeclaringType();
- }
-
- public List<? extends WBParameter<?, ?>> getWBParameters()
- {
- return delegate().getWBParameters();
- }
-
- public T newInstance(Object... parameters) throws IllegalArgumentException,
InstantiationException, IllegalAccessException, InvocationTargetException
- {
- return delegate().newInstance(parameters);
- }
-
- public ConstructorSignature getSignature()
- {
- return delegate().getSignature();
- }
-
- public List<AnnotatedParameter<T>> getParameters()
- {
- return delegate().getParameters();
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBField.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBField.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBField.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,52 +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.weld.introspector;
-
-import java.lang.reflect.Field;
-
-public abstract class ForwardingWBField<T, X> extends ForwardingWBMember<T, X,
Field> implements WBField<T, X>
-{
-
- @Override
- protected abstract WBField<T, X> delegate();
-
- public T get(Object instance)
- {
- return delegate().get(instance);
- }
-
- public WBClass<X> getDeclaringType()
- {
- return delegate().getDeclaringType();
- }
-
- 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/weld/introspector/ForwardingWBMember.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBMember.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBMember.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,37 +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.weld.introspector;
-
-import java.lang.reflect.Member;
-
-public abstract class ForwardingWBMember<T, X, S extends Member> extends
ForwardingWBAnnotated<T, S> implements WBMember<T, X, S>
-{
-
- @Override
- protected abstract WBMember<T, X, S> delegate();
-
- public S getJavaMember()
- {
- return delegate().getJavaMember();
- }
-
- public WBClass<X> getDeclaringType()
- {
- return delegate().getDeclaringType();
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBMethod.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBMethod.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBMethod.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,87 +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.weld.introspector;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.List;
-
-import javax.enterprise.inject.spi.AnnotatedParameter;
-
-public abstract class ForwardingWBMethod<T, X> extends ForwardingWBMember<T,X,
Method> implements WBMethod<T, X>
-{
-
- @Override
- protected abstract WBMethod<T, X> delegate();
-
- public Method getAnnotatedMethod()
- {
- return delegate().getAnnotatedMethod();
- }
-
- public List<WBParameter<?, ?>> getAnnotatedParameters(Class<? extends
Annotation> metaAnnotationType)
- {
- return delegate().getAnnotatedWBParameters(metaAnnotationType);
- }
-
- public Class<?>[] getParameterTypesAsArray()
- {
- return delegate().getParameterTypesAsArray();
- }
-
- public List<? extends WBParameter<?, ?>> getWBParameters()
- {
- return delegate().getWBParameters();
- }
-
- 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();
- }
-
- public List<WBParameter<?, ?>> getAnnotatedWBParameters(Class<? extends
Annotation> metaAnnotationType)
- {
- return delegate().getAnnotatedWBParameters(metaAnnotationType);
- }
-
- public List<AnnotatedParameter<X>> getParameters()
- {
- return delegate().getParameters();
- }
-
-}
Deleted:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBParameter.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBParameter.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBParameter.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -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.weld.introspector;
-
-import javax.enterprise.inject.spi.AnnotatedCallable;
-
-
-public abstract class ForwardingWBParameter<T, X> extends
ForwardingWBAnnotated<T, Object> implements WBParameter<T, X>
-{
-
- @Override
- protected abstract WBParameter<T, X> delegate();
-
- public AnnotatedCallable<X> getDeclaringCallable()
- {
- return delegate().getDeclaringCallable();
- }
-
- public int getPosition()
- {
- return delegate().getPosition();
- }
-
-}
Copied:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotated.java (from
rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBAnnotated.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotated.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotated.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,139 @@
+/*
+ * 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.weld.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 ForwardingWeldAnnotated<T, S> extends
ForwardingAnnotated<T, S> implements WeldAnnotated<T, S>
+{
+
+ public Type[] getActualTypeArguments()
+ {
+ return delegate().getActualTypeArguments();
+ }
+
+ public Set<Annotation> getMetaAnnotations(Class<? extends Annotation>
metaAnnotationType)
+ {
+ return delegate().getMetaAnnotations(metaAnnotationType);
+ }
+
+ public Annotation[] getMetaAnnotationsAsArray(Class<? extends Annotation>
metaAnnotationType)
+ {
+ return delegate().getMetaAnnotationsAsArray(metaAnnotationType);
+ }
+
+ @Deprecated
+ public Set<Annotation> getQualifiers()
+ {
+ return delegate().getQualifiers();
+ }
+
+ @Deprecated
+ public Annotation[] getBindingsAsArray()
+ {
+ return delegate().getBindingsAsArray();
+ }
+
+ public Set<Annotation> getDeclaredMetaAnnotations(Class<? extends
Annotation> metaAnnotationType)
+ {
+ return delegate().getDeclaredMetaAnnotations(metaAnnotationType);
+ }
+
+ public String getName()
+ {
+ return delegate().getName();
+ }
+
+ public Class<T> getJavaClass()
+ {
+ return delegate().getJavaClass();
+ }
+
+ public boolean isAssignableFrom(WeldAnnotated<?, ?> that)
+ {
+ return delegate().isAssignableFrom(that);
+ }
+
+ public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
+ {
+ return delegate().isAssignableFrom(type, actualTypeArguments);
+ }
+
+ public boolean isFinal()
+ {
+ return delegate().isFinal();
+ }
+
+ public boolean isStatic()
+ {
+ return delegate().isStatic();
+ }
+
+ public boolean isProxyable()
+ {
+ return delegate().isProxyable();
+ }
+
+ public boolean isPublic()
+ {
+ return delegate().isPublic();
+ }
+
+ public boolean isPrivate()
+ {
+ return delegate().isPrivate();
+ }
+
+ public boolean isPackagePrivate()
+ {
+ return delegate().isPackagePrivate();
+ }
+
+ public Package getPackage()
+ {
+ return delegate().getPackage();
+ }
+
+ @Override
+ protected abstract WeldAnnotated<T, S> delegate();
+
+ public boolean isDeclaredAnnotationPresent(Class<? extends Annotation>
annotationType)
+ {
+ return delegate().isDeclaredAnnotationPresent(annotationType);
+ }
+
+ public Set<Type> getInterfaceOnlyFlattenedTypeHierarchy()
+ {
+ return delegate().getInterfaceOnlyFlattenedTypeHierarchy();
+ }
+
+ public boolean isParameterizedType()
+ {
+ return delegate().isParameterizedType();
+ }
+
+}
Copied:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotation.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBAnnotation.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotation.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldAnnotation.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -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.weld.introspector;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+public abstract class ForwardingWeldAnnotation<T extends Annotation> extends
ForwardingWeldClass<T> implements WeldAnnotation<T>
+{
+
+ @Override
+ protected abstract WeldAnnotation<T> delegate();
+
+ public Set<WeldMethod<?, ?>> getAnnotatedMembers(Class<? extends
Annotation> annotationType)
+ {
+ return delegate().getAnnotatedMembers(annotationType);
+ }
+
+ public Set<WeldMethod<?, ?>> getMembers()
+ {
+ return delegate().getMembers();
+ }
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBClass.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldClass.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,172 @@
+/*
+ * 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.weld.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.Set;
+
+public abstract class ForwardingWeldClass<T> extends ForwardingWeldAnnotated<T,
Class<T>> implements WeldClass<T>
+{
+
+ @Override
+ protected abstract WeldClass<T> delegate();
+
+ public Set<WeldConstructor<T>> getAnnotatedWeldConstructors(Class<?
extends Annotation> annotationType)
+ {
+ return delegate().getAnnotatedWeldConstructors(annotationType);
+ }
+
+ public Set<WeldField<?, ?>> getAnnotatedWeldFields(Class<? extends
Annotation> annotationType)
+ {
+ return delegate().getAnnotatedWeldFields(annotationType);
+ }
+
+ public Set<WeldMethod<?, ?>> getAnnotatedWeldMethods(Class<? extends
Annotation> annotationType)
+ {
+ return delegate().getAnnotatedWeldMethods(annotationType);
+ }
+
+ public WeldConstructor<T> getNoArgsWeldConstructor()
+ {
+ return delegate().getNoArgsWeldConstructor();
+ }
+
+ public Set<WeldConstructor<T>> getWeldConstructors()
+ {
+ return delegate().getWeldConstructors();
+ }
+
+ public Set<WeldMethod<?, ?>> getWeldMethods()
+ {
+ return delegate().getWeldMethods();
+ }
+
+ public Set<WeldField<?, T>> getDeclaredAnnotatedWeldFields(Class<?
extends Annotation> annotationType)
+ {
+ return delegate().getDeclaredAnnotatedWeldFields(annotationType);
+ }
+
+ public Set<WeldMethod<?, T>> getDeclaredAnnotatedWeldMethods(Class<?
extends Annotation> annotationType)
+ {
+ return delegate().getDeclaredAnnotatedWeldMethods(annotationType);
+ }
+
+ public Set<WeldMethod<?, T>>
getDeclaredWeldMethodsWithAnnotatedParameters(Class<? extends Annotation>
annotationType)
+ {
+ return delegate().getDeclaredWeldMethodsWithAnnotatedParameters(annotationType);
+ }
+
+ public Set<WeldField<?, ?>> getWeldFields()
+ {
+ return delegate().getWeldFields();
+ }
+
+ public Set<WeldField<?, ?>> getMetaAnnotatedWeldFields(Class<? extends
Annotation> metaAnnotationType)
+ {
+ return delegate().getMetaAnnotatedWeldFields(metaAnnotationType);
+ }
+
+ @Deprecated
+ public WeldMethod<?, ?> getWeldMethod(Method method)
+ {
+ return delegate().getWeldMethod(method);
+ }
+
+ public <M> WeldMethod<M, ?> getWBMethod(MethodSignature signature)
+ {
+ return delegate().getWBMethod(signature);
+ }
+
+ public Set<WeldMethod<?, ?>>
getWeldMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
+ {
+ return delegate().getWeldMethodsWithAnnotatedParameters(annotationType);
+ }
+
+ public Set<WeldConstructor<?>>
getWeldConstructorsWithAnnotatedParameters(Class<? extends Annotation>
annotationType)
+ {
+ return delegate().getWeldConstructorsWithAnnotatedParameters(annotationType);
+ }
+
+ public WeldClass<?> getWeldSuperclass()
+ {
+ return delegate().getWeldSuperclass();
+ }
+
+ public boolean isNonStaticMemberClass()
+ {
+ return delegate().isNonStaticMemberClass();
+ }
+
+ @Override
+ public boolean isParameterizedType()
+ {
+ return delegate().isParameterizedType();
+ }
+
+ public boolean isAbstract()
+ {
+ return delegate().isAbstract();
+ }
+
+ public boolean isEnum()
+ {
+ return delegate().isEnum();
+ }
+
+ @Deprecated
+ public WeldMethod<?, ?> getDeclaredWeldMethod(Method method)
+ {
+ return delegate().getDeclaredWeldMethod(method);
+ }
+
+ public <F> WeldField<F, ?> getDeclaredWeldField(String fieldName,
WeldClass<F> expectedType)
+ {
+ return delegate().getDeclaredWeldField(fieldName, expectedType);
+ }
+
+ public <M> WeldMethod<M, ?> getDeclaredWeldMethod(MethodSignature
signature, WeldClass<M> expectedReturnType)
+ {
+ return delegate().getDeclaredWeldMethod(signature, expectedReturnType);
+ }
+
+ public WeldConstructor<T> getDeclaredWeldConstructor(ConstructorSignature
signature)
+ {
+ return delegate().getDeclaredWeldConstructor(signature);
+ }
+
+ public <U> WeldClass<? extends U> asWeldSubclass(WeldClass<U>
clazz)
+ {
+ return delegate().asWeldSubclass(clazz);
+ }
+
+ public <S> S cast(Object object)
+ {
+ return delegate().<S>cast(object);
+ }
+
+ public boolean isEquivalent(Class<?> clazz)
+ {
+ return delegate().isEquivalent(clazz);
+ }
+
+ public String getSimpleName()
+ {
+ return delegate().getSimpleName();
+ }
+
+}
Copied:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldConstructor.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBConstructor.java)
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldConstructor.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldConstructor.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,62 @@
+/*
+ * 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.weld.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
+
+import javax.enterprise.inject.spi.AnnotatedParameter;
+
+public abstract class ForwardingWeldConstructor<T> extends
ForwardingWeldMember<T, T, Constructor<T>> implements
WeldConstructor<T>
+{
+
+ @Override
+ protected abstract WeldConstructor<T> delegate();
+
+ public List<WeldParameter<?, ?>> getAnnotatedWBParameters(Class<?
extends Annotation> annotationType)
+ {
+ return delegate().getAnnotatedWBParameters(annotationType);
+ }
+
+ public WeldClass<T> getDeclaringType()
+ {
+ return delegate().getDeclaringType();
+ }
+
+ public List<? extends WeldParameter<?, ?>> getWBParameters()
+ {
+ return delegate().getWBParameters();
+ }
+
+ public T newInstance(Object... parameters) throws IllegalArgumentException,
InstantiationException, IllegalAccessException, InvocationTargetException
+ {
+ return delegate().newInstance(parameters);
+ }
+
+ public ConstructorSignature getSignature()
+ {
+ return delegate().getSignature();
+ }
+
+ public List<AnnotatedParameter<T>> getParameters()
+ {
+ return delegate().getParameters();
+ }
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldField.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBField.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldField.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldField.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,52 @@
+/*
+ * 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.weld.introspector;
+
+import java.lang.reflect.Field;
+
+public abstract class ForwardingWeldField<T, X> extends ForwardingWeldMember<T,
X, Field> implements WeldField<T, X>
+{
+
+ @Override
+ protected abstract WeldField<T, X> delegate();
+
+ public T get(Object instance)
+ {
+ return delegate().get(instance);
+ }
+
+ public WeldClass<X> getDeclaringType()
+ {
+ return delegate().getDeclaringType();
+ }
+
+ 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();
+ }
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldMember.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBMember.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldMember.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldMember.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,37 @@
+/*
+ * 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.weld.introspector;
+
+import java.lang.reflect.Member;
+
+public abstract class ForwardingWeldMember<T, X, S extends Member> extends
ForwardingWeldAnnotated<T, S> implements WeldMember<T, X, S>
+{
+
+ @Override
+ protected abstract WeldMember<T, X, S> delegate();
+
+ public S getJavaMember()
+ {
+ return delegate().getJavaMember();
+ }
+
+ public WeldClass<X> getDeclaringType()
+ {
+ return delegate().getDeclaringType();
+ }
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldMethod.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBMethod.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldMethod.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldMethod.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,87 @@
+/*
+ * 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.weld.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import javax.enterprise.inject.spi.AnnotatedParameter;
+
+public abstract class ForwardingWeldMethod<T, X> extends
ForwardingWeldMember<T,X, Method> implements WeldMethod<T, X>
+{
+
+ @Override
+ protected abstract WeldMethod<T, X> delegate();
+
+ public Method getAnnotatedMethod()
+ {
+ return delegate().getAnnotatedMethod();
+ }
+
+ public List<WeldParameter<?, ?>> getAnnotatedParameters(Class<? extends
Annotation> metaAnnotationType)
+ {
+ return delegate().getAnnotatedWBParameters(metaAnnotationType);
+ }
+
+ public Class<?>[] getParameterTypesAsArray()
+ {
+ return delegate().getParameterTypesAsArray();
+ }
+
+ public List<? extends WeldParameter<?, ?>> getWBParameters()
+ {
+ return delegate().getWBParameters();
+ }
+
+ 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();
+ }
+
+ public List<WeldParameter<?, ?>> getAnnotatedWBParameters(Class<?
extends Annotation> metaAnnotationType)
+ {
+ return delegate().getAnnotatedWBParameters(metaAnnotationType);
+ }
+
+ public List<AnnotatedParameter<X>> getParameters()
+ {
+ return delegate().getParameters();
+ }
+
+}
Copied:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldParameter.java (from
rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWBParameter.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldParameter.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/ForwardingWeldParameter.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -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.weld.introspector;
+
+import javax.enterprise.inject.spi.AnnotatedCallable;
+
+
+public abstract class ForwardingWeldParameter<T, X> extends
ForwardingWeldAnnotated<T, Object> implements WeldParameter<T, X>
+{
+
+ @Override
+ protected abstract WeldParameter<T, X> delegate();
+
+ public AnnotatedCallable<X> getDeclaringCallable()
+ {
+ return delegate().getDeclaringCallable();
+ }
+
+ public int getPosition()
+ {
+ return delegate().getPosition();
+ }
+
+}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBAnnotated.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBAnnotated.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBAnnotated.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,198 +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.weld.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.NormalScope;
-import javax.enterprise.inject.spi.Annotated;
-import javax.enterprise.inject.stereotype.Stereotype;
-import javax.inject.Qualifier;
-import javax.inject.Scope;
-import javax.interceptor.InterceptorBinding;
-
-/**
- * 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> extends Annotated
-{
-
- // 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(Qualifier.class, Stereotype.class, Scope.class,
NormalScope.class, InterceptorBinding.class));
-
- /**
- * 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> getQualifiers();
-
- /**
- * 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();
-
- /**
- * 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 isDeclaredAnnotationPresent(Class<? extends Annotation>
annotationType);
-
- /**
- * Gets the type of the element
- *
- * @return The type of the element
- */
- public Class<T> getJavaClass();
-
- /**
- * 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();
-
- public boolean isPrivate();
-
- public boolean isPackagePrivate();
-
- public Package getPackage();
-
- /**
- * 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 boolean isParameterizedType();
-
-}
\ No newline at end of file
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBAnnotation.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBAnnotation.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBAnnotation.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,53 +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.weld.introspector;
-
-import java.lang.annotation.Annotation;
-import java.util.Set;
-
-/**
- * Represents a meta annotation
- *
- * @author Pete Muir
- *
- */
-public interface WBAnnotation<T extends Annotation> extends WBClass<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);
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBCallable.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBCallable.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBCallable.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,49 +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.weld.introspector;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Member;
-import java.util.List;
-
-import javax.enterprise.inject.spi.AnnotatedCallable;
-
-/**
- * @author pmuir
- *
- */
-public interface WBCallable<T, X, S extends Member> extends WBMember<T, X,
S>, AnnotatedCallable<X>
-{
-
- /**
- * 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<?, ?>> getWBParameters();
-
- /**
- * 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<?, ?>> getAnnotatedWBParameters(Class<? extends
Annotation> metaAnnotationType);
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBClass.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBClass.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBClass.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,235 +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.weld.introspector;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.Set;
-
-import javax.enterprise.inject.spi.AnnotatedType;
-
-/**
- * Represents a Class
- *
- * @author Pete Muir
- *
- */
-public interface WBClass<T> extends WBAnnotated<T, Class<T>>,
AnnotatedType<T>
-{
-
- /**
- * Gets all fields on the type
- *
- * @return A set of abstracted fields
- */
- public Set<WBField<?, ?>> getWBFields();
-
- /**
- * Gets all fields on the type
- *
- * @return A set of abstracted fields
- */
- public Set<WBMethod<?, ?>> getWBMethods();
-
- /**
- * Gets all fields on the type
- *
- * @return A set of abstracted fields
- */
- public Set<WBMethod<?, ?>> getDeclaredWBMethods();
-
- /**
- * 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, ?> getDeclaredWBField(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<?, ?>> getAnnotatedWBFields(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<?, T>> getDeclaredAnnotatedWBFields(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<?, ?>> getMetaAnnotatedWBFields(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>> getAnnotatedWBConstructors(Class<? extends
Annotation> annotationType);
-
- /**
- * Gets all constructors
- *
- * @return A set of abstracted constructors
- */
- public Set<WBConstructor<T>> getWBConstructors();
-
- /**
- * Gets the no-args constructor
- *
- * @return The no-args constructor, or null if not defined
- */
- public WBConstructor<T> getNoArgsWBConstructor();
-
- /**
- * 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> getDeclaredWBConstructor(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<?, ?>> getAnnotatedWBMethods(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<?, T>> getDeclaredAnnotatedWBMethods(Class<?
extends Annotation> annotationType);
-
- /**
- * Find the annotated method for a given methodDescriptor
- *
- * @param methodDescriptor
- * @return
- *
- */
- public WBMethod<?, ?> getWBMethod(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, ?> getDeclaredWBMethod(MethodSignature signature,
WBClass<M> expectedReturnType);
-
- /**
- * Get a method by name
- *
- * @param <M> the expected return type
- * @param signature the name of the method
- * @return the method, or null if it doesn't exist
- */
- public <M> WBMethod<M, ?> getWBMethod(MethodSignature signature);
-
- // TODO Replace with AnnotatedMethod variant
- @Deprecated
- public WBMethod<?, ?> getDeclaredWBMethod(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<?, ?>> getWBMethodsWithAnnotatedParameters(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<?>>
getWBConstructorsWithAnnotatedParameters(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<?, T>>
getDeclaredWBMethodsWithAnnotatedParameters(Class<? extends Annotation>
annotationType);
-
- /**
- * Gets the superclass.
- *
- * @return The abstracted superclass, null if there is no superclass
- */
- public WBClass<?> getWBSuperclass();
-
- /**
- * 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> asWBSubclass(WBClass<U> clazz);
-
- /**
- * 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();
-
-}
\ No newline at end of file
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBConstructor.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBConstructor.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBConstructor.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,50 +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.weld.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.Set;
-
-import javax.decorator.Decorates;
-import javax.enterprise.inject.spi.AnnotatedConstructor;
-
-/**
- * Represents a Class Constructor
- *
- * @author Pete Muir
- *
- */
-public interface WBConstructor<T> extends WBCallable<T, T,
Constructor<T>>, AnnotatedConstructor<T>
-{
-
- @SuppressWarnings("unchecked")
- public static final Set<Class<? extends Annotation>>
MAPPED_PARAMETER_ANNOTATIONS = new HashSet<Class<? extends
Annotation>>(Arrays.asList(Decorates.class));
-
- /**
- * Creates a new instance of the class, using this constructor
- *
- * @return The created instance
- */
- public T newInstance(Object... parameters) throws IllegalArgumentException,
InstantiationException, IllegalAccessException, InvocationTargetException;
-
- public ConstructorSignature getSignature();
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBField.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBField.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBField.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,53 +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.weld.introspector;
-
-import java.lang.reflect.Field;
-
-import javax.enterprise.inject.spi.AnnotatedField;
-
-/**
- * AnnotatedField provides a uniform access to the annotations on an annotated
- * field
- *
- * @author Pete Muir
- *
- */
-public interface WBField<T, X> extends WBMember<T, X, Field>,
AnnotatedField<X>
-{
-
- /**
- * 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 the property name of the field
- *
- * @return The name
- */
- public String getPropertyName();
-
- public boolean isTransient();
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBMember.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBMember.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBMember.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -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.weld.introspector;
-
-import java.lang.reflect.Member;
-
-import javax.enterprise.inject.spi.AnnotatedMember;
-/**
- * AnnotedMember provides enhanced access to an annotated member
- *
- * @author Pete Muir
- *
- */
-public interface WBMember<T, X, S extends Member> extends WBAnnotated<T, S>,
AnnotatedMember<X>
-{
-
- public S getJavaMember();
-
- /**
- * Gets an abstraction of the declaring class
- *
- * @return The declaring class
- */
- public WBClass<X> getDeclaringType();
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBMethod.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBMethod.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBMethod.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,85 +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.weld.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.Set;
-
-import javax.enterprise.event.Observes;
-import javax.enterprise.inject.Disposes;
-import javax.enterprise.inject.spi.AnnotatedMethod;
-
-/**
- * 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, X> extends WBCallable<T, X, Method>,
AnnotatedMethod<X>
-{
- @SuppressWarnings("unchecked")
- public static final Set<Class<? extends Annotation>>
MAPPED_PARAMETER_ANNOTATIONS = new HashSet<Class<? extends
Annotation>>(Arrays.asList(Disposes.class, Observes.class, Disposes.class));
-
- /**
- * 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 Bean manager
- * @return A reference to the instance
- */
- public T invokeOnInstance(Object instance, Object... parameters) throws
IllegalArgumentException, SecurityException, IllegalAccessException,
InvocationTargetException, NoSuchMethodException;
-
- /**
- * 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/weld/introspector/WBParameter.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBParameter.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBParameter.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,31 +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.weld.introspector;
-
-import javax.enterprise.inject.spi.AnnotatedParameter;
-
-/**
- * AnnotatedParameter provides a uniform access to a method parameter defined
- * either in Java or XML
- *
- * @author Pete Muir
- * @param <T>
- */
-public interface WBParameter<T, X> extends WBAnnotated<T, Object>,
AnnotatedParameter<X>
-{
-
-}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldAnnotated.java (from
rev 3879, ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBAnnotated.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldAnnotated.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldAnnotated.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,198 @@
+/*
+ * 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.weld.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.NormalScope;
+import javax.enterprise.inject.spi.Annotated;
+import javax.enterprise.inject.stereotype.Stereotype;
+import javax.inject.Qualifier;
+import javax.inject.Scope;
+import javax.interceptor.InterceptorBinding;
+
+/**
+ * AnnotatedItem provides a uniform access to the annotations on an annotated
+ * item defined either in Java or XML
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WeldAnnotated<T, S> extends Annotated
+{
+
+ // 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(Qualifier.class, Stereotype.class, Scope.class,
NormalScope.class, InterceptorBinding.class));
+
+ /**
+ * 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> getQualifiers();
+
+ /**
+ * 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();
+
+ /**
+ * 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 isDeclaredAnnotationPresent(Class<? extends Annotation>
annotationType);
+
+ /**
+ * Gets the type of the element
+ *
+ * @return The type of the element
+ */
+ public Class<T> getJavaClass();
+
+ /**
+ * 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(WeldAnnotated<?, ?> 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();
+
+ public boolean isPrivate();
+
+ public boolean isPackagePrivate();
+
+ public Package getPackage();
+
+ /**
+ * 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 boolean isParameterizedType();
+
+}
\ No newline at end of file
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldAnnotation.java (from
rev 3879, ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBAnnotation.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldAnnotation.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldAnnotation.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,53 @@
+/*
+ * 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.weld.introspector;
+
+import java.lang.annotation.Annotation;
+import java.util.Set;
+
+/**
+ * Represents a meta annotation
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WeldAnnotation<T extends Annotation> extends WeldClass<T>
+{
+ /**
+ * Gets all members
+ *
+ * @return A set of abstracted members
+ */
+ public Set<WeldMethod<?, ?>> 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<WeldMethod<?, ?>> getAnnotatedMembers(Class<? extends
Annotation> annotationType);
+
+ /**
+ * Get an annotation member by name
+ *
+ * @param memberName
+ * @return
+ */
+ public <A> WeldMethod<A, ?> getMember(String memberName,
WeldClass<A> expectedType);
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldCallable.java (from
rev 3879, ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBCallable.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldCallable.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldCallable.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,49 @@
+/*
+ * 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.weld.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Member;
+import java.util.List;
+
+import javax.enterprise.inject.spi.AnnotatedCallable;
+
+/**
+ * @author pmuir
+ *
+ */
+public interface WeldCallable<T, X, S extends Member> extends WeldMember<T, X,
S>, AnnotatedCallable<X>
+{
+
+ /**
+ * Gets the abstracted parameters of the method
+ *
+ * @return A list of parameters. Returns an empty list if no parameters are
+ * present.
+ */
+ public List<? extends WeldParameter<?, ?>> getWBParameters();
+
+ /**
+ * 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<WeldParameter<?, ?>> getAnnotatedWBParameters(Class<?
extends Annotation> metaAnnotationType);
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldClass.java (from rev
3879, ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBClass.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldClass.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldClass.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,236 @@
+/*
+ * 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.weld.introspector;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.AnnotatedType;
+
+/**
+ * Represents a Class
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WeldClass<T> extends WeldAnnotated<T, Class<T>>,
AnnotatedType<T>
+{
+
+ /**
+ * Gets all fields on the type
+ *
+ * @return A set of abstracted fields
+ */
+ public Set<WeldField<?, ?>> getWeldFields();
+
+ /**
+ * Gets all fields on the type
+ *
+ * @return A set of abstracted fields
+ */
+ public Set<WeldMethod<?, ?>> getWeldMethods();
+
+ /**
+ * Gets all fields on the type
+ *
+ * @return A set of abstracted fields
+ */
+ public Set<WeldMethod<?, ?>> getDeclaredWeldMethods();
+
+ /**
+ * 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> WeldField<F, ?> getDeclaredWeldField(String fieldName,
WeldClass<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<WeldField<?, ?>> getAnnotatedWeldFields(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<WeldField<?, T>> getDeclaredAnnotatedWeldFields(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<WeldField<?, ?>> getMetaAnnotatedWeldFields(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<WeldConstructor<T>> getAnnotatedWeldConstructors(Class<?
extends Annotation> annotationType);
+
+ /**
+ * Gets all constructors
+ *
+ * @return A set of abstracted constructors
+ */
+ public Set<WeldConstructor<T>> getWeldConstructors();
+
+ /**
+ * Gets the no-args constructor
+ *
+ * @return The no-args constructor, or null if not defined
+ */
+ public WeldConstructor<T> getNoArgsWeldConstructor();
+
+ /**
+ * 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 WeldConstructor<T> getDeclaredWeldConstructor(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<WeldMethod<?, ?>> getAnnotatedWeldMethods(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<WeldMethod<?, T>> getDeclaredAnnotatedWeldMethods(Class<?
extends Annotation> annotationType);
+
+ /**
+ * Find the annotated method for a given methodDescriptor
+ *
+ * @param methodDescriptor
+ * @return
+ *
+ */
+ public WeldMethod<?, ?> getWeldMethod(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> WeldMethod<M, ?> getDeclaredWeldMethod(MethodSignature
signature,
+ WeldClass<M> expectedReturnType);
+
+ /**
+ * Get a method by name
+ *
+ * @param <M> the expected return type
+ * @param signature the name of the method
+ * @return the method, or null if it doesn't exist
+ */
+ public <M> WeldMethod<M, ?> getWBMethod(MethodSignature signature);
+
+ // TODO Replace with AnnotatedMethod variant
+ @Deprecated
+ public WeldMethod<?, ?> getDeclaredWeldMethod(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<WeldMethod<?, ?>>
getWeldMethodsWithAnnotatedParameters(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<WeldConstructor<?>>
getWeldConstructorsWithAnnotatedParameters(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<WeldMethod<?, T>>
getDeclaredWeldMethodsWithAnnotatedParameters(Class<? extends Annotation>
annotationType);
+
+ /**
+ * Gets the superclass.
+ *
+ * @return The abstracted superclass, null if there is no superclass
+ */
+ public WeldClass<?> getWeldSuperclass();
+
+ /**
+ * 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> WeldClass<? extends U> asWeldSubclass(WeldClass<U>
clazz);
+
+ /**
+ * 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();
+
+}
\ No newline at end of file
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldConstructor.java (from
rev 3879, ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBConstructor.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldConstructor.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldConstructor.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,50 @@
+/*
+ * 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.weld.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.Set;
+
+import javax.decorator.Decorates;
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+
+/**
+ * Represents a Class Constructor
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WeldConstructor<T> extends WeldCallable<T, T,
Constructor<T>>, AnnotatedConstructor<T>
+{
+
+ @SuppressWarnings("unchecked")
+ public static final Set<Class<? extends Annotation>>
MAPPED_PARAMETER_ANNOTATIONS = new HashSet<Class<? extends
Annotation>>(Arrays.asList(Decorates.class));
+
+ /**
+ * Creates a new instance of the class, using this constructor
+ *
+ * @return The created instance
+ */
+ public T newInstance(Object... parameters) throws IllegalArgumentException,
InstantiationException, IllegalAccessException, InvocationTargetException;
+
+ public ConstructorSignature getSignature();
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldField.java (from rev
3879, ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBField.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldField.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldField.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,53 @@
+/*
+ * 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.weld.introspector;
+
+import java.lang.reflect.Field;
+
+import javax.enterprise.inject.spi.AnnotatedField;
+
+/**
+ * AnnotatedField provides a uniform access to the annotations on an annotated
+ * field
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WeldField<T, X> extends WeldMember<T, X, Field>,
AnnotatedField<X>
+{
+
+ /**
+ * 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 the property name of the field
+ *
+ * @return The name
+ */
+ public String getPropertyName();
+
+ public boolean isTransient();
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldMember.java (from rev
3879, ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBMember.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldMember.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldMember.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -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.weld.introspector;
+
+import java.lang.reflect.Member;
+
+import javax.enterprise.inject.spi.AnnotatedMember;
+/**
+ * AnnotedMember provides enhanced access to an annotated member
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WeldMember<T, X, S extends Member> extends WeldAnnotated<T,
S>, AnnotatedMember<X>
+{
+
+ public S getJavaMember();
+
+ /**
+ * Gets an abstraction of the declaring class
+ *
+ * @return The declaring class
+ */
+ public WeldClass<X> getDeclaringType();
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldMethod.java (from rev
3894, ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBMethod.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldMethod.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldMethod.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,85 @@
+/*
+ * 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.weld.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.Set;
+
+import javax.enterprise.event.Observes;
+import javax.enterprise.inject.Disposes;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+
+/**
+ * AnnotatedType provides a uniform access to the annotations on an annotated
+ * class defined either in Java or XML
+ *
+ * @author Pete Muir
+ *
+ */
+public interface WeldMethod<T, X> extends WeldCallable<T, X, Method>,
AnnotatedMethod<X>
+{
+ @SuppressWarnings("unchecked")
+ public static final Set<Class<? extends Annotation>>
MAPPED_PARAMETER_ANNOTATIONS = new HashSet<Class<? extends
Annotation>>(Arrays.asList(Disposes.class, Observes.class, Disposes.class));
+
+ /**
+ * 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 Bean manager
+ * @return A reference to the instance
+ */
+ public T invokeOnInstance(Object instance, Object... parameters) throws
IllegalArgumentException, SecurityException, IllegalAccessException,
InvocationTargetException, NoSuchMethodException;
+
+ /**
+ * 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();
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldParameter.java (from
rev 3879, ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WBParameter.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldParameter.java
(rev 0)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/introspector/WeldParameter.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,31 @@
+/*
+ * 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.weld.introspector;
+
+import javax.enterprise.inject.spi.AnnotatedParameter;
+
+/**
+ * AnnotatedParameter provides a uniform access to a method parameter defined
+ * either in Java or XML
+ *
+ * @author Pete Muir
+ * @param <T>
+ */
+public interface WeldParameter<T, X> extends WeldAnnotated<T, Object>,
AnnotatedParameter<X>
+{
+
+}
Deleted:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBAnnotated.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBAnnotated.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBAnnotated.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,293 +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.weld.introspector.jlr;
-
-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;
-
-import org.jboss.weld.introspector.AnnotationStore;
-import org.jboss.weld.introspector.WBAnnotated;
-import org.jboss.weld.util.Proxies;
-import org.jboss.weld.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.weld.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.weld.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.getJavaClass().equals(that.getJavaClass());
- }
- 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.weld.introspector.WBAnnotated#isAssignableFrom(WBAnnotated)
- */
- public boolean isAssignableFrom(WBAnnotated<?, ?> that)
- {
- return isAssignableFrom(that.getJavaClass(), that.getActualTypeArguments());
- }
-
- public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
- {
- return Reflections.isAssignableFrom(getJavaClass(), getActualTypeArguments(), type,
actualTypeArguments);
- }
-
- public boolean isAssignableFrom(Type type)
- {
- return Reflections.isAssignableFrom(getBaseType(), type);
- }
-
- /**
- * Gets the hash code of the actual type
- *
- * @return The hash code
- */
- @Override
- public int hashCode()
- {
- return getJavaClass().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> getQualifiers()
- {
- 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.weld.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.weld.introspector.WBAnnotated#isProxyable()
- */
- public boolean isProxyable()
- {
- return proxyable;
- }
-
- public Class<T> getJavaClass()
- {
- return rawType;
- }
-
- public Type[] getActualTypeArguments()
- {
- return Arrays.copyOf(actualTypeArguments, actualTypeArguments.length);
- }
-
- 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
Deleted:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBCallable.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBCallable.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBCallable.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -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.weld.introspector.jlr;
-
-import java.lang.reflect.Member;
-import java.lang.reflect.Type;
-
-import org.jboss.weld.introspector.AnnotationStore;
-import org.jboss.weld.introspector.WBCallable;
-import org.jboss.weld.introspector.WBClass;
-
-/**
- * @author pmuir
- *
- */
-public abstract class AbstractWBCallable<T, X, S extends Member> extends
AbstractWBMember<T, X, S> implements WBCallable<T, X, S>
-{
-
-
-
- protected AbstractWBCallable(AnnotationStore annotatedItemHelper, Member member,
Class<T> rawType, Type type, WBClass<X> declaringType)
- {
- super(annotatedItemHelper, member, rawType, type, declaringType);
- }
-
-}
Deleted:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBMember.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBMember.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBMember.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,172 +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.weld.introspector.jlr;
-
-import java.lang.reflect.Member;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Type;
-
-import org.jboss.weld.introspector.AnnotationStore;
-import org.jboss.weld.introspector.ForwardingWBMember;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.WBMember;
-import org.jboss.weld.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, X, S extends Member> extends
AbstractWBAnnotated<T, S> implements WBMember<T, X, S>
-{
-
- static abstract class WrappableForwardingAnnotatedMember<T, X, S extends Member>
extends ForwardingWBMember<T, X, S> implements WrappableAnnotatedItem<T, S>
- {
-
- }
-
- // The name of the member
- private final String name;
-
- // Cached string representation
- private String toString;
- private final boolean _public;
- private final boolean _private;
- private final boolean _packagePrivate;
- private final Package _package;
- private final WBClass<X> declaringType;
-
- /**
- * Constructor
- *
- * @param annotationMap The annotation map
- */
- protected AbstractWBMember(AnnotationStore annotatedItemHelper, Member member,
Class<T> rawType, Type type, WBClass<X> declaringType)
- {
- super(annotatedItemHelper, rawType, type);
- name = member.getName();
- this._public = Modifier.isPublic(member.getModifiers());
- this._private = Modifier.isPrivate(member.getModifiers());
- this._packagePrivate = Reflections.isPackagePrivate(member.getModifiers());
- this._package = member.getDeclaringClass().getPackage();
- this.declaringType = declaringType;
- }
-
- /**
- * Indicates if the member is static
- *
- * @return True if static, false otherwise
- *
- * @see org.jboss.weld.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.weld.introspector.WBAnnotated#isFinal()
- */
- public boolean isFinal()
- {
- return Reflections.isFinal(getDelegate());
- }
-
- public boolean isTransient()
- {
- return Reflections.isTransient(getDelegate());
- }
-
- public boolean isPublic()
- {
- return _public;
- }
-
- public boolean isPrivate()
- {
- return _private;
- }
-
- public boolean isPackagePrivate()
- {
- return _packagePrivate;
- }
-
- public Package getPackage()
- {
- return _package;
- }
-
- /**
- * Gets the current value of the member
- *
- * @param beanManager The Bean 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.weld.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 getJavaMember()
- {
- return getDelegate();
- }
-
- public WBClass<X> getDeclaringType()
- {
- return declaringType;
- }
-
-}
Copied:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldAnnotated.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBAnnotated.java)
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldAnnotated.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldAnnotated.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,293 @@
+/*
+ * 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.weld.introspector.jlr;
+
+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;
+
+import org.jboss.weld.introspector.AnnotationStore;
+import org.jboss.weld.introspector.WeldAnnotated;
+import org.jboss.weld.util.Proxies;
+import org.jboss.weld.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.weld.introspector.WeldAnnotated
+ */
+public abstract class AbstractWeldAnnotated<T, S> implements WeldAnnotated<T,
S>
+{
+
+ interface WrappableAnnotatedItem<T, S> extends WeldAnnotated<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 AbstractWeldAnnotated(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 AbstractWeldAnnotated(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.weld.introspector.WeldAnnotated#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 WeldAnnotated)
+ {
+ WeldAnnotated<?, ?> that = (WeldAnnotated<?, ?>) other;
+ return this.getAnnotations().equals(that.getAnnotations()) &&
this.getJavaClass().equals(that.getJavaClass());
+ }
+ 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.weld.introspector.WeldAnnotated#isAssignableFrom(WeldAnnotated)
+ */
+ public boolean isAssignableFrom(WeldAnnotated<?, ?> that)
+ {
+ return isAssignableFrom(that.getJavaClass(), that.getActualTypeArguments());
+ }
+
+ public boolean isAssignableFrom(Class<?> type, Type[] actualTypeArguments)
+ {
+ return Reflections.isAssignableFrom(getJavaClass(), getActualTypeArguments(), type,
actualTypeArguments);
+ }
+
+ public boolean isAssignableFrom(Type type)
+ {
+ return Reflections.isAssignableFrom(getBaseType(), type);
+ }
+
+ /**
+ * Gets the hash code of the actual type
+ *
+ * @return The hash code
+ */
+ @Override
+ public int hashCode()
+ {
+ return getJavaClass().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> getQualifiers()
+ {
+ 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.weld.introspector.WeldAnnotated#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.weld.introspector.WeldAnnotated#isProxyable()
+ */
+ public boolean isProxyable()
+ {
+ return proxyable;
+ }
+
+ public Class<T> getJavaClass()
+ {
+ return rawType;
+ }
+
+ public Type[] getActualTypeArguments()
+ {
+ return Arrays.copyOf(actualTypeArguments, actualTypeArguments.length);
+ }
+
+ 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
Copied:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldCallable.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBCallable.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldCallable.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldCallable.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -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.weld.introspector.jlr;
+
+import java.lang.reflect.Member;
+import java.lang.reflect.Type;
+
+import org.jboss.weld.introspector.AnnotationStore;
+import org.jboss.weld.introspector.WeldCallable;
+import org.jboss.weld.introspector.WeldClass;
+
+/**
+ * @author pmuir
+ *
+ */
+public abstract class AbstractWeldCallable<T, X, S extends Member> extends
AbstractWeldMember<T, X, S> implements WeldCallable<T, X, S>
+{
+
+
+
+ protected AbstractWeldCallable(AnnotationStore annotatedItemHelper, Member member,
Class<T> rawType, Type type, WeldClass<X> declaringType)
+ {
+ super(annotatedItemHelper, member, rawType, type, declaringType);
+ }
+
+}
Copied:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldMember.java (from
rev 3894,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWBMember.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldMember.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/AbstractWeldMember.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,172 @@
+/*
+ * 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.weld.introspector.jlr;
+
+import java.lang.reflect.Member;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Type;
+
+import org.jboss.weld.introspector.AnnotationStore;
+import org.jboss.weld.introspector.ForwardingWeldMember;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldMember;
+import org.jboss.weld.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 AbstractWeldMember<T, X, S extends Member> extends
AbstractWeldAnnotated<T, S> implements WeldMember<T, X, S>
+{
+
+ static abstract class WrappableForwardingAnnotatedMember<T, X, S extends Member>
extends ForwardingWeldMember<T, X, S> implements WrappableAnnotatedItem<T, S>
+ {
+
+ }
+
+ // The name of the member
+ private final String name;
+
+ // Cached string representation
+ private String toString;
+ private final boolean _public;
+ private final boolean _private;
+ private final boolean _packagePrivate;
+ private final Package _package;
+ private final WeldClass<X> declaringType;
+
+ /**
+ * Constructor
+ *
+ * @param annotationMap The annotation map
+ */
+ protected AbstractWeldMember(AnnotationStore annotatedItemHelper, Member member,
Class<T> rawType, Type type, WeldClass<X> declaringType)
+ {
+ super(annotatedItemHelper, rawType, type);
+ name = member.getName();
+ this._public = Modifier.isPublic(member.getModifiers());
+ this._private = Modifier.isPrivate(member.getModifiers());
+ this._packagePrivate = Reflections.isPackagePrivate(member.getModifiers());
+ this._package = member.getDeclaringClass().getPackage();
+ this.declaringType = declaringType;
+ }
+
+ /**
+ * Indicates if the member is static
+ *
+ * @return True if static, false otherwise
+ *
+ * @see org.jboss.weld.introspector.WeldAnnotated#isStatic()
+ */
+ public boolean isStatic()
+ {
+ return Reflections.isStatic(getDelegate());
+ }
+
+ /**
+ * Indicates if the member if final
+ *
+ * @return True if final, false otherwise
+ *
+ * @see org.jboss.weld.introspector.WeldAnnotated#isFinal()
+ */
+ public boolean isFinal()
+ {
+ return Reflections.isFinal(getDelegate());
+ }
+
+ public boolean isTransient()
+ {
+ return Reflections.isTransient(getDelegate());
+ }
+
+ public boolean isPublic()
+ {
+ return _public;
+ }
+
+ public boolean isPrivate()
+ {
+ return _private;
+ }
+
+ public boolean isPackagePrivate()
+ {
+ return _packagePrivate;
+ }
+
+ public Package getPackage()
+ {
+ return _package;
+ }
+
+ /**
+ * Gets the current value of the member
+ *
+ * @param beanManager The Bean 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.weld.introspector.WeldAnnotated#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 getJavaMember()
+ {
+ return getDelegate();
+ }
+
+ public WeldClass<X> getDeclaringType()
+ {
+ return declaringType;
+ }
+
+}
Modified:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/ConstructorSignatureImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/ConstructorSignatureImpl.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/ConstructorSignatureImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -19,7 +19,7 @@
import java.util.Arrays;
import org.jboss.weld.introspector.ConstructorSignature;
-import org.jboss.weld.introspector.WBConstructor;
+import org.jboss.weld.introspector.WeldConstructor;
public class ConstructorSignatureImpl implements ConstructorSignature
{
@@ -28,7 +28,7 @@
private final String[] parameterTypes;
- public ConstructorSignatureImpl(WBConstructor<?> method)
+ public ConstructorSignatureImpl(WeldConstructor<?> method)
{
this.parameterTypes = new String[method.getWBParameters().size()];
for (int i = 0; i < method.getWBParameters().size(); i++)
Modified:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/MethodSignatureImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/MethodSignatureImpl.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/MethodSignatureImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -20,7 +20,7 @@
import java.util.Arrays;
import org.jboss.weld.introspector.MethodSignature;
-import org.jboss.weld.introspector.WBMethod;
+import org.jboss.weld.introspector.WeldMethod;
public class MethodSignatureImpl implements MethodSignature
{
@@ -30,7 +30,7 @@
private final String methodName;
private final String[] parameterTypes;
- public MethodSignatureImpl(WBMethod<?, ?> method)
+ public MethodSignatureImpl(WeldMethod<?, ?> method)
{
this.methodName = method.getName();
this.parameterTypes = new String[method.getWBParameters().size()];
Deleted:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBAnnotationImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBAnnotationImpl.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBAnnotationImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,154 +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.weld.introspector.jlr;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.weld.introspector.AnnotationStore;
-import org.jboss.weld.introspector.WBAnnotation;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.WBMethod;
-import org.jboss.weld.resources.ClassTransformer;
-import org.jboss.weld.util.Names;
-
-import com.google.common.base.Supplier;
-import com.google.common.collect.Multimaps;
-import com.google.common.collect.SetMultimap;
-
-/**
- * Represents an annotated annotation
- *
- * This class is immutable and therefore threadsafe
- *
- * @author Pete Muir
- *
- * @param <T>
- */
-public class WBAnnotationImpl<T extends Annotation> extends WBClassImpl<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 final 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(annotationType, annotationType, null, AnnotationStore.of(annotationType,
classTransformer.getTypeStore().get(annotationType),
classTransformer.getTypeStore().get(annotationType), classTransformer.getTypeStore()),
classTransformer);
- this.clazz = annotationType;
- this.toString = "class " + Names.classToString(getDelegate());
- members = new HashSet<WBMethod<?, ?>>();
- annotatedMembers = Multimaps.newSetMultimap(new HashMap<Class<? extends
Annotation>, Collection<WBMethod<?, ?>>>(), new
Supplier<Set<WBMethod<?, ?>>>()
- {
-
- public Set<WBMethod<?, ?>> get()
- {
- return new HashSet<WBMethod<?, ?>>();
- }
-
- });
- this.namedMembers = new HashMap<String, WBMethod<?, ?>>();
- for (Method member : clazz.getDeclaredMethods())
- {
- WBMethod<?, ?> annotatedMethod = WBMethodImpl.of(member, this,
classTransformer);
- 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.weld.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.weld.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()
- {
- return toString;
- }
-
- @Override
- public Class<T> getDelegate()
- {
- return clazz;
- }
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBClassImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBClassImpl.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBClassImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,771 +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.weld.introspector.jlr;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
-import java.lang.reflect.Type;
-import java.util.Arrays;
-import java.util.Collection;
-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.AnnotatedConstructor;
-import javax.enterprise.inject.spi.AnnotatedField;
-import javax.enterprise.inject.spi.AnnotatedMethod;
-import javax.enterprise.inject.spi.AnnotatedType;
-
-import org.jboss.weld.introspector.AnnotationStore;
-import org.jboss.weld.introspector.ConstructorSignature;
-import org.jboss.weld.introspector.MethodSignature;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.WBConstructor;
-import org.jboss.weld.introspector.WBField;
-import org.jboss.weld.introspector.WBMethod;
-import org.jboss.weld.resources.ClassTransformer;
-import org.jboss.weld.util.Names;
-import org.jboss.weld.util.Reflections;
-
-import com.google.common.base.Supplier;
-import com.google.common.collect.Multimaps;
-import com.google.common.collect.SetMultimap;
-
-/**
- * Represents an annotated class
- *
- * This class is immutable, and therefore threadsafe
- *
- * @author Pete Muir
- *
- * @param <T>
- */
-public class WBClassImpl<T> extends AbstractWBAnnotated<T, Class<T>>
implements WBClass<T>
-{
-
-// The superclass abstraction of the type
- private final WBClass<?> superclass;
- // The name of the type
- private final String name;
-
- private final String _simpleName;
- private final boolean _public;
- private final boolean _private;
- private final boolean _packagePrivate;
- private final Package _package;
-
- 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<?,
T>> 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;
- private final Map<MethodSignature, WBMethod<?, ?>> methodsBySignature;
- // 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<?,
T>> declaredAnnotatedMethods;
- // The map from annotation type to method with a parameter with annotation
- private final SetMultimap<Class<? extends Annotation>, WBMethod<?,
T>> 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 final 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)
- {
- AnnotationStore annotationStore = AnnotationStore.of(clazz.getAnnotations(),
clazz.getDeclaredAnnotations(), classTransformer.getTypeStore());
- return new WBClassImpl<T>(clazz, clazz, null, annotationStore,
classTransformer);
- }
-
- public static <T> WBClass<T> of(AnnotatedType<T> annotatedType,
ClassTransformer classTransformer)
- {
- AnnotationStore annotationStore =
AnnotationStore.of(annotatedType.getAnnotations(), annotatedType.getAnnotations(),
classTransformer.getTypeStore());
- return new WBClassImpl<T>(annotatedType.getJavaClass(),
annotatedType.getBaseType(), annotatedType, annotationStore, classTransformer);
- }
-
- protected WBClassImpl(Class<T> rawType, Type type, AnnotatedType<T>
annotatedType, AnnotationStore annotationStore, ClassTransformer classTransformer)
- {
- super(annotationStore, rawType, type);
- this.toString = "class " + Names.classToString(rawType);
- this.name = rawType.getName();
- this._simpleName = rawType.getSimpleName();
- if (rawType.getSuperclass() != null)
- {
- this.superclass = classTransformer.loadClass(rawType.getSuperclass());
- }
- else
- {
- this.superclass = null;
- }
- this._public = Modifier.isFinal(rawType.getModifiers());
- this._private = Modifier.isPrivate(rawType.getModifiers());
- this._packagePrivate = Reflections.isPackagePrivate(rawType.getModifiers());
- this._package = rawType.getPackage();
- this.fields = new HashSet<WBField<?, ?>>();
- this.annotatedFields = Multimaps.newSetMultimap(new HashMap<Class<? extends
Annotation>, Collection<WBField<?, ?>>>(), new Supplier<
Set<WBField<?, ?>>>()
- {
-
- public Set<WBField<?, ?>> get()
- {
- return new HashSet<WBField<?, ?>>();
- }
-
- });
- this.metaAnnotatedFields = Multimaps.newSetMultimap(new HashMap<Class<?
extends Annotation>, Collection<WBField<?, ?>>>(), new Supplier<
Set<WBField<?, ?>>>()
- {
-
- public Set<WBField<?, ?>> get()
- {
- return new HashSet<WBField<?, ?>>();
- }
-
- });
- this.declaredFields = new HashSet<WBField<?, ?>>();
- this.declaredFieldsByName = new HashMap<String, WBField<?, ?>>();
- this.declaredAnnotatedFields = Multimaps.newSetMultimap(new HashMap<Class<?
extends Annotation>, Collection<WBField<?, T>>>(), new Supplier<
Set<WBField<?, T>>>()
- {
-
- public Set<WBField<?, T>> get()
- {
- return new HashSet<WBField<?, T>>();
- }
-
- });
- this.declaredMetaAnnotatedFields = Multimaps.newSetMultimap(new
HashMap<Class<? extends Annotation>, Collection<WBField<?, ?>>>(),
new Supplier< Set<WBField<?, ?>>>()
- {
-
- public Set<WBField<?, ?>> get()
- {
- return new HashSet<WBField<?, ?>>();
- }
-
- });
- this._nonStaticMemberClass = Reflections.isNonStaticInnerClass(rawType);
- this._abstract = Reflections.isAbstract(rawType);
- this._enum = rawType.isEnum();
-
-
- Map<Field, AnnotatedField<? super T>> annotatedTypeFields = new
HashMap<Field, AnnotatedField<? super T>>();
- if (annotatedType != null)
- {
- for (AnnotatedField<? super T> annotatedField :
annotatedType.getFields())
- {
- annotatedTypeFields.put(annotatedField.getJavaMember(), annotatedField);
- }
- }
-
- for (Class<?> c = rawType; c != Object.class && c != null; c =
c.getSuperclass())
- {
- for (Field field : c.getDeclaredFields())
- {
- if (!field.isAccessible())
- {
- field.setAccessible(true);
- }
- WBField<?, T> annotatedField = null;
- if (annotatedTypeFields.containsKey(field))
- {
- annotatedField = WBFieldImpl.of(annotatedTypeFields.get(field),
this.<T>getDeclaringWBClass(field, classTransformer), classTransformer);
- }
- else
- {
- annotatedField = WBFieldImpl.of(field,
this.<T>getDeclaringWBClass(field, classTransformer), classTransformer);
- }
-
- 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 = Multimaps.newSetMultimap(new HashMap<Class<?
extends Annotation>, Collection<WBConstructor<T>>>(), new Supplier<
Set<WBConstructor<T>>>()
- {
-
- public Set<WBConstructor<T>> get()
- {
- return new HashSet<WBConstructor<T>>();
- }
-
- });
- this.constructorsByAnnotatedParameters = Multimaps.newSetMultimap(new
HashMap<Class<? extends Annotation>,
Collection<WBConstructor<?>>>(), new Supplier<
Set<WBConstructor<?>>>()
- {
-
- public Set<WBConstructor<?>> get()
- {
- return new HashSet<WBConstructor<?>>();
- }
-
- });
-
- Map<Constructor<? super T>, AnnotatedConstructor<T>>
annotatedTypeConstructors = new HashMap<Constructor<? super T>,
AnnotatedConstructor<T>>();
- if (annotatedType != null)
- {
- for (AnnotatedConstructor<T> annotated : annotatedType.getConstructors())
- {
- annotatedTypeConstructors.put(annotated.getJavaMember(), annotated);
- }
- }
-
- this.declaredConstructorsBySignature = new HashMap<ConstructorSignature,
WBConstructor<?>>();
- for (Constructor<?> constructor : rawType.getDeclaredConstructors())
- {
- WBConstructor<T> annotatedConstructor = null;
- if (annotatedTypeConstructors.containsKey(constructor))
- {
- WBClass<T> declaringClass = this.getDeclaringWBClass(constructor,
classTransformer);
- annotatedConstructor =
WBConstructorImpl.of(annotatedTypeConstructors.get(constructor), declaringClass,
classTransformer);
- }
- else
- {
- // TODO Fix this cast
- Constructor<T> c = (Constructor<T>) constructor;
- annotatedConstructor = WBConstructorImpl.of(c,
this.<T>getDeclaringWBClass(c, classTransformer), classTransformer);
- }
-
- 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.putAll(annotation.annotationType(), new
HashSet<WBConstructor<T>>());
- }
-
annotatedConstructors.get(annotation.annotationType()).add(annotatedConstructor);
- }
-
- for (Class<? extends Annotation> annotationType :
WBConstructor.MAPPED_PARAMETER_ANNOTATIONS)
- {
- if (annotatedConstructor.getAnnotatedWBParameters(annotationType).size() >
0)
- {
- constructorsByAnnotatedParameters.put(annotationType,
annotatedConstructor);
- }
- }
- }
-
- this.methods = new HashSet<WBMethod<?, ?>>();
- this.annotatedMethods = Multimaps.newSetMultimap(new HashMap<Class<? extends
Annotation>, Collection<WBMethod<?, ?>>>(), new Supplier<
Set<WBMethod<?, ?>>>()
- {
-
- public Set<WBMethod<?, ?>> get()
- {
- return new HashSet<WBMethod<?, ?>>();
- }
-
- });
- this.methodsByAnnotatedParameters = Multimaps.newSetMultimap(new
HashMap<Class<? extends Annotation>, Collection<WBMethod<?,
?>>>(), new Supplier< Set<WBMethod<?, ?>>>()
- {
-
- public Set<WBMethod<?, ?>> get()
- {
- return new HashSet<WBMethod<?, ?>>();
- }
-
- });
- this.declaredMethods = new HashSet<WBMethod<?, ?>>();
- this.declaredAnnotatedMethods = Multimaps.newSetMultimap(new HashMap<Class<?
extends Annotation>, Collection<WBMethod<?, T>>>(), new Supplier<
Set<WBMethod<?, T>>>()
- {
-
- public Set<WBMethod<?, T>> get()
- {
- return new HashSet<WBMethod<?, T>>();
- }
-
- });
- this.declaredMethodsByAnnotatedParameters = Multimaps.newSetMultimap(new
HashMap<Class<? extends Annotation>, Collection<WBMethod<?,
T>>>(), new Supplier< Set<WBMethod<?, T>>>()
- {
-
- public Set<WBMethod<?, T>> get()
- {
- return new HashSet<WBMethod<?, T>>();
- }
-
- });
- this.declaredMethodsBySignature = new HashMap<MethodSignature, WBMethod<?,
?>>();
- this.methodsBySignature = new HashMap<MethodSignature, WBMethod<?,
?>>();
-
- Map<Method, AnnotatedMethod<?>> annotatedTypeMethods = new
HashMap<Method, AnnotatedMethod<?>>();
- if (annotatedType != null)
- {
- for (AnnotatedMethod<?> annotated : annotatedType.getMethods())
- {
- annotatedTypeMethods.put(annotated.getJavaMember(), annotated);
- }
- }
-
- for (Class<?> c = rawType; c != Object.class && c != null; c =
c.getSuperclass())
- {
- for (Method method : c.getDeclaredMethods())
- {
- if (!method.isAccessible())
- {
- method.setAccessible(true);
- }
-
- WBMethod<?, T> annotatedMethod = null;
- if (annotatedTypeMethods.containsKey(method))
- {
- annotatedMethod = WBMethodImpl.of(annotatedTypeMethods.get(method), this,
classTransformer);
- }
- else
- {
- annotatedMethod = WBMethodImpl.of(method,
this.<T>getDeclaringWBClass(method, classTransformer), classTransformer);
- }
- this.methods.add(annotatedMethod);
- this.methodsBySignature.put(annotatedMethod.getSignature(),
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.getAnnotatedWBParameters(annotationType).size() >
0)
- {
- methodsByAnnotatedParameters.put(annotationType, annotatedMethod);
- if (c == rawType)
- {
- this.declaredMethodsByAnnotatedParameters.put(annotationType,
annotatedMethod);
- }
- }
- }
- }
- }
- }
-
- @SuppressWarnings("unchecked")
- private <X> WBClass<X> getDeclaringWBClass(Member member, ClassTransformer
transformer)
- {
- if (member.getDeclaringClass().equals(getJavaClass()))
- {
- return (WBClass<X>) this;
- }
- else
- {
- return transformer.loadClass((Class<X>) member.getDeclaringClass());
- }
- }
-
- /**
- * Gets the implementing class
- *
- * @return The class
- */
- public Class<? extends T> getAnnotatedClass()
- {
- return getJavaClass();
- }
-
- /**
- * Gets the delegate (class)
- *
- * @return The class
- */
- @Override
- public Class<T> getDelegate()
- {
- return getJavaClass();
- }
-
- /**
- * Gets the abstracted fields of the class
- *
- * Initializes the fields if they are null
- *
- * @return The set of abstracted fields
- */
- public Set<WBField<?, ?>> getWBFields()
- {
- return Collections.unmodifiableSet(fields);
- }
-
- public Set<WBField<?, ?>> getDeclaredFields()
- {
- return Collections.unmodifiableSet(declaredFields);
- }
-
- public <F> WBField<F, ?> getDeclaredWBField(String fieldName,
WBClass<F> expectedType)
- {
- return (WBField<F, ?>) declaredFieldsByName.get(fieldName);
- }
-
- public Set<WBField<?, T>> getDeclaredAnnotatedWBFields(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>> getWBConstructors()
- {
- return Collections.unmodifiableSet(constructors);
- }
-
- public WBConstructor<T> getDeclaredWBConstructor(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<?, ?>> getMetaAnnotatedWBFields(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<?, ?>> getAnnotatedWBFields(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.weld.introspector.WBClass#getAnnotatedWBMethods(Class)
- */
- public Set<WBMethod<?, ?>> getAnnotatedWBMethods(Class<? extends
Annotation> annotationType)
- {
- return Collections.unmodifiableSet(annotatedMethods.get(annotationType));
- }
-
- public Set<WBMethod<?, T>> getDeclaredAnnotatedWBMethods(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.weld.introspector.WBClass#getAnnotatedWBConstructors(Class)
- */
- public Set<WBConstructor<T>> getAnnotatedWBConstructors(Class<? extends
Annotation> annotationType)
- {
- return Collections.unmodifiableSet(annotatedConstructors.get(annotationType));
- }
-
- public WBConstructor<T> getNoArgsWBConstructor()
- {
- return constructorsByArgumentMap.get(NO_ARGUMENTS);
- }
-
- public Set<WBMethod<?, ?>> getWBMethodsWithAnnotatedParameters(Class<?
extends Annotation> annotationType)
- {
- return
Collections.unmodifiableSet(methodsByAnnotatedParameters.get(annotationType));
- }
-
- public Set<WBConstructor<?>>
getWBConstructorsWithAnnotatedParameters(Class<? extends Annotation>
annotationType)
- {
- return
Collections.unmodifiableSet(constructorsByAnnotatedParameters.get(annotationType));
- }
-
- public Set<WBMethod<?, T>>
getDeclaredWBMethodsWithAnnotatedParameters(Class<? extends Annotation>
annotationType)
- {
- return
Collections.unmodifiableSet(declaredMethodsByAnnotatedParameters.get(annotationType));
- }
-
- public WBMethod<?, ?> getWBMethod(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 Set<WBMethod<?, ?>> getWBMethods()
- {
- return Collections.unmodifiableSet(methods);
- }
-
- public WBMethod<?, ?> getDeclaredWBMethod(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;
- }
-
- public Set<WBMethod<?, ?>> getDeclaredWBMethods()
- {
- return declaredMethods;
- }
-
- @SuppressWarnings("unchecked")
- public <M> WBMethod<M, ?> getDeclaredWBMethod(MethodSignature signature,
WBClass<M> expectedReturnType)
- {
- return (WBMethod<M, ?>) declaredMethodsBySignature.get(signature);
- }
-
- @SuppressWarnings("unchecked")
- public <M> WBMethod<M, ?> getWBMethod(MethodSignature signature)
- {
- return (WBMethod<M, ?>) methodsBySignature.get(signature);
- }
-
- /**
- * Gets a string representation of the class
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- return toString;
- }
-
- public String getSimpleName()
- {
- return _simpleName;
- }
-
- /**
- * Indicates if the type is static
- *
- * @return True if static, false otherwise
- *
- * @see org.jboss.weld.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.weld.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.weld.introspector.WBAnnotated#getName()
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Gets the superclass abstraction of the type
- *
- * @return The superclass abstraction
- */
- public WBClass<?> getWBSuperclass()
- {
- return superclass;
- }
-
- public boolean isEquivalent(Class<?> clazz)
- {
- return getDelegate().equals(clazz);
- }
-
- public boolean isPrivate()
- {
- return _private;
- }
-
- public boolean isPackagePrivate()
- {
- return _packagePrivate;
- }
-
- public Package getPackage()
- {
- return _package;
- }
-
- @SuppressWarnings("unchecked")
- public <U> WBClass<? extends U> asWBSubclass(WBClass<U> clazz)
- {
- return (WBClass<? extends U>) this;
- }
-
- @SuppressWarnings("unchecked")
- public <S> S cast(Object object)
- {
- return (S) object;
- }
-
- @SuppressWarnings("unchecked")
- public Set<AnnotatedConstructor<T>> getConstructors()
- {
- return (Set) constructors;
- }
-
- @SuppressWarnings("unchecked")
- public Set<AnnotatedField<? super T>> getFields()
- {
- return (Set) fields;
- }
-
- @SuppressWarnings("unchecked")
- public Set<AnnotatedMethod<? super T>> getMethods()
- {
- return (Set) methods;
- }
-
-}
\ No newline at end of file
Deleted:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBConstructorImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBConstructorImpl.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBConstructorImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,287 +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.weld.introspector.jlr;
-
-import static org.jboss.weld.util.Reflections.ensureAccessible;
-
-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.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.enterprise.inject.spi.AnnotatedConstructor;
-import javax.enterprise.inject.spi.AnnotatedParameter;
-
-import org.jboss.weld.BeanManagerImpl;
-import org.jboss.weld.introspector.AnnotationStore;
-import org.jboss.weld.introspector.ConstructorSignature;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.WBConstructor;
-import org.jboss.weld.introspector.WBParameter;
-import org.jboss.weld.resources.ClassTransformer;
-
-import com.google.common.base.Supplier;
-import com.google.common.collect.ListMultimap;
-import com.google.common.collect.Multimaps;
-
-/**
- * Represents an annotated constructor
- *
- * This class is immutable, and therefore threadsafe
- *
- * @author Pete Muir
- *
- * @param <T>
- */
-public class WBConstructorImpl<T> extends AbstractWBCallable<T, 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;
-
- private final ConstructorSignature signature;
-
- // Cached string representation
- private final String toString;
-
- public static <T> WBConstructor<T> of(Constructor<T> constructor,
WBClass<T> declaringClass, ClassTransformer classTransformer)
- {
- AnnotationStore annotationStore = AnnotationStore.of(constructor,
classTransformer.getTypeStore());
- return new WBConstructorImpl<T>(ensureAccessible(constructor), null,
annotationStore, declaringClass, classTransformer);
- }
-
- public static <T> WBConstructor<T> of(AnnotatedConstructor<T>
annotatedConstructor, WBClass<T> declaringClass, ClassTransformer
classTransformer)
- {
- AnnotationStore annotationStore =
AnnotationStore.of(annotatedConstructor.getAnnotations(),
annotatedConstructor.getAnnotations(), classTransformer.getTypeStore());
- return new
WBConstructorImpl<T>(ensureAccessible(annotatedConstructor.getJavaMember()),
annotatedConstructor, annotationStore, declaringClass, classTransformer);
- }
-
- /**
- * Constructor
- *
- * Initializes the superclass with the build annotations map
- *
- * @param constructor The constructor method
- * @param declaringClass The declaring class
- */
- private WBConstructorImpl(Constructor<T> constructor,
AnnotatedConstructor<T> annotatedConstructor, AnnotationStore annotationStore,
WBClass<T> declaringClass, ClassTransformer classTransformer)
- {
- super(annotationStore, constructor, constructor.getDeclaringClass(),
constructor.getDeclaringClass(), declaringClass);
- this.toString = new StringBuilder().append("constructor
").append(constructor.toString()).toString();
- this.constructor = constructor;
-
- this.parameters = new ArrayList<WBParameter<?, ?>>();
- annotatedParameters = Multimaps.newListMultimap(new HashMap<Class<? extends
Annotation>, Collection<WBParameter<?, ?>>>(), new Supplier<
List<WBParameter<?, ?>>>()
- {
-
- public List<WBParameter<?, ?>> get()
- {
- return new ArrayList<WBParameter<?, ?>>();
- }
-
- });
-
- Map<Integer, AnnotatedParameter<?>> annotatedTypeParameters = new
HashMap<Integer, AnnotatedParameter<?>>();
-
- if (annotatedConstructor != null)
- {
- for (AnnotatedParameter<?> annotated :
annotatedConstructor.getParameters())
- {
- annotatedTypeParameters.put(annotated.getPosition(), annotated);
- }
- }
-
- for (int i = 0; i < constructor.getParameterTypes().length; i++)
- {
- if (constructor.getParameterAnnotations()[i].length > 0 ||
annotatedTypeParameters.containsKey(i))
- {
- Class<?> clazz = constructor.getParameterTypes()[i];
- Type type = constructor.getGenericParameterTypes()[i];
- WBParameter<?, ?> parameter = null;
- if (annotatedTypeParameters.containsKey(i))
- {
- AnnotatedParameter<?> annotatedParameter =
annotatedTypeParameters.get(i);
- parameter = WBParameterImpl.of(annotatedParameter.getAnnotations(), clazz,
type, this, i, classTransformer);
- }
- else
- {
- parameter = WBParameterImpl.of(constructor.getParameterAnnotations()[i],
clazz, type, this, i, classTransformer);
- }
-
- 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, i, classTransformer);
- 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.weld.introspector.WBConstructor#getWBParameters()
- */
- public List<WBParameter<?, ?>> getWBParameters()
- {
- 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.weld.introspector.WBConstructor#getAnnotatedWBParameters(Class)
- */
- public List<WBParameter<?, ?>> getAnnotatedWBParameters(Class<? extends
Annotation> annotationType)
- {
- return Collections.unmodifiableList(annotatedParameters.get(annotationType));
- }
-
- /**
- * Creates a new instance
- *
- * @param manager The Bean manager
- * @return An instance
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- * @throws InstantiationException
- * @throws IllegalArgumentException
- *
- * @see org.jboss.weld.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.getDeclaringType().equals(that.getDeclaringType()) &&
this.getWBParameters().equals(that.getWBParameters());
- }
- return false;
- }
-
- /**
- * The overridden hashcode
- *
- * Gets the hash code from the delegate
- *
- * @return The hash code
- */
- @Override
- public int hashCode()
- {
- return getDelegate().hashCode();
- }
-
- /**
- * Gets a string representation of the constructor
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- return toString;
- }
-
- public ConstructorSignature getSignature()
- {
- return signature;
- }
-
- public List<AnnotatedParameter<T>> getParameters()
- {
- return Collections.unmodifiableList((List) parameters);
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBFieldImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBFieldImpl.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBFieldImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,153 +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.weld.introspector.jlr;
-
-import static org.jboss.weld.util.Reflections.ensureAccessible;
-
-import java.lang.reflect.Field;
-
-import javax.enterprise.inject.spi.AnnotatedField;
-
-import org.jboss.weld.introspector.AnnotationStore;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.WBField;
-import org.jboss.weld.resources.ClassTransformer;
-import org.jboss.weld.util.Reflections;
-
-/**
- * Represents an annotated field
- *
- * This class is immutable, and therefore threadsafe
- *
- * @author Pete Muir
- *
- * @param <T>
- */
-public class WBFieldImpl<T, X> extends AbstractWBMember<T, X, Field>
implements WBField<T, X>
-{
-
- // The underlying field
- private final Field field;
-
- // Cached string representation
- private final String toString;
-
- public static <T, X> WBFieldImpl<T, X> of(Field field, WBClass<X>
declaringClass, ClassTransformer classTransformer)
- {
- AnnotationStore annotationStore = AnnotationStore.of(field,
classTransformer.getTypeStore());
- return new WBFieldImpl<T, X>(ensureAccessible(field), annotationStore,
declaringClass, classTransformer);
- }
-
- public static <T, X> WBFieldImpl<T, X> of(AnnotatedField<? super X>
annotatedField, WBClass<X> declaringClass, ClassTransformer classTransformer)
- {
- AnnotationStore annotationStore =
AnnotationStore.of(annotatedField.getAnnotations(), annotatedField.getAnnotations(),
classTransformer.getTypeStore());
- return new WBFieldImpl<T,
X>(ensureAccessible(annotatedField.getJavaMember()), annotationStore, declaringClass,
classTransformer);
- }
-
- /**
- * 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
- */
- private WBFieldImpl(Field field, AnnotationStore annotationStore, WBClass<X>
declaringClass, ClassTransformer classTransformer)
- {
- super(annotationStore, field, (Class<T>) field.getType(),
field.getGenericType(), declaringClass);
- this.field = field;
- this.toString = new StringBuilder().append("field
").append(declaringClass.getName()).append(".").append(field.getName()).toString();
- }
-
- /**
- * Gets the underlying field
- *
- * @return The fields
- */
- public Field getAnnotatedField()
- {
- return field;
- }
-
- @Override
- 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.weld.introspector.WBField#getName()
- */
- public String getPropertyName()
- {
- return getName();
- }
-
- /**
- * Gets a string representation of the field
- *
- * @return A string representation
- */
- @Override
- public String toString()
- {
- return this.toString;
- }
-
- @Override
- public boolean equals(Object other)
- {
- if (other instanceof WBField<?, ?>)
- {
- WBField<?, ?> that = (WBField<?, ?>) other;
- return this.getDeclaringType().equals(that.getDeclaringType()) &&
this.getName().equals(that.getName());
- }
- else
- {
- return false;
- }
- }
-
-
- @Override
- public int hashCode()
- {
- return getDelegate().hashCode();
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBMethodImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBMethodImpl.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBMethodImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,259 +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.weld.introspector.jlr;
-
-import static org.jboss.weld.util.Reflections.ensureAccessible;
-
-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.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.enterprise.inject.spi.AnnotatedMethod;
-import javax.enterprise.inject.spi.AnnotatedParameter;
-
-import org.jboss.weld.introspector.AnnotationStore;
-import org.jboss.weld.introspector.MethodSignature;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.WBMethod;
-import org.jboss.weld.introspector.WBParameter;
-import org.jboss.weld.resources.ClassTransformer;
-import org.jboss.weld.util.Reflections;
-
-import com.google.common.base.Supplier;
-import com.google.common.collect.ListMultimap;
-import com.google.common.collect.Multimaps;
-
-/**
- * Represents an annotated method
- *
- * This class is immutable and therefore threadsafe
- *
- * @author Pete Muir
- *
- * @param <T>
- */
-public class WBMethodImpl<T, X> extends AbstractWBCallable<T, X, Method>
implements WBMethod<T, X>
-{
-
- // 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;
-
- // Cached string representation
- private final String toString;
-
- private final MethodSignature signature;
-
- public static <T, X> WBMethodImpl<T, X> of(Method method, WBClass<X>
declaringClass, ClassTransformer classTransformer)
- {
- AnnotationStore annotationStore = AnnotationStore.of(method,
classTransformer.getTypeStore());
- return new WBMethodImpl<T, X>(ensureAccessible(method), null,
annotationStore, declaringClass, classTransformer);
- }
-
- public static <T, X> WBMethodImpl<T, X> of(AnnotatedMethod<T>
method, WBClass<X> declaringClass, ClassTransformer classTransformer)
- {
- AnnotationStore annotationStore = AnnotationStore.of(method.getAnnotations(),
method.getAnnotations(), classTransformer.getTypeStore());
- return new WBMethodImpl<T, X>(ensureAccessible(method.getJavaMember()),
method, annotationStore, declaringClass, classTransformer);
- }
-
- /**
- * 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")
- private WBMethodImpl(Method method, AnnotatedMethod<T> annotatedMethod,
AnnotationStore annotationStore, WBClass<X> declaringClass, ClassTransformer
classTransformer)
- {
- super(annotationStore, method, (Class<T>) method.getReturnType(),
method.getGenericReturnType(), declaringClass);
- this.method = method;
- this.toString = new StringBuilder().append("method
").append(method.toString()).toString();
- this.parameters = new ArrayList<WBParameter<?, ?>>();
- this.annotatedParameters = Multimaps.newListMultimap(new HashMap<Class<?
extends Annotation>, Collection<WBParameter<?, ?>>>(), new Supplier<
List<WBParameter<?, ?>>>()
- {
-
- public List<WBParameter<?, ?>> get()
- {
- return new ArrayList<WBParameter<?, ?>>();
- }
-
- });
-
- Map<Integer, AnnotatedParameter<?>> annotatedTypeParameters = new
HashMap<Integer, AnnotatedParameter<?>>();
-
- if (annotatedMethod != null)
- {
- for (AnnotatedParameter<?> annotated : annotatedMethod.getParameters())
- {
- annotatedTypeParameters.put(annotated.getPosition(), annotated);
- }
- }
-
- for (int i = 0; i < method.getParameterTypes().length; i++)
- {
- if (method.getParameterAnnotations()[i].length > 0 ||
annotatedTypeParameters.containsKey(i))
- {
- Class<? extends Object> clazz = method.getParameterTypes()[i];
- Type type = method.getGenericParameterTypes()[i];
- WBParameter<?, ?> parameter = null;
- if (annotatedTypeParameters.containsKey(i))
- {
- AnnotatedParameter<?> annotatedParameter =
annotatedTypeParameters.get(i);
- parameter = WBParameterImpl.of(annotatedParameter.getAnnotations(), clazz,
type, this, i, classTransformer);
- }
- else
- {
- parameter = WBParameterImpl.of(method.getParameterAnnotations()[i], clazz,
type, this, i, classTransformer);
- }
- 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, i, classTransformer);
- 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;
- }
-
- @Override
- public Method getDelegate()
- {
- return method;
- }
-
- public List<WBParameter<?, ?>> getWBParameters()
- {
- return Collections.unmodifiableList(parameters);
- }
-
- public Class<?>[] getParameterTypesAsArray()
- {
- return method.getParameterTypes();
- }
-
- public List<WBParameter<?, ?>> getAnnotatedWBParameters(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.getDeclaringType().equals(that.getDeclaringType()) &&
this.getName().equals(that.getName()) &&
this.getWBParameters().equals(that.getWBParameters());
- }
- else
- {
- return false;
- }
- }
-
- public boolean isEquivalent(Method method)
- {
- return this.getDeclaringType().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;
- }
-
- @Override
- public String toString()
- {
- return this.toString;
- }
-
- public MethodSignature getSignature()
- {
- return signature;
- }
-
- public List<AnnotatedParameter<X>> getParameters()
- {
- return Collections.unmodifiableList((List) parameters);
- }
-
-}
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBParameterImpl.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBParameterImpl.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBParameterImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,165 +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.weld.introspector.jlr;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Type;
-import java.util.Set;
-
-import javax.enterprise.inject.spi.AnnotatedCallable;
-
-import org.jboss.weld.introspector.AnnotationStore;
-import org.jboss.weld.introspector.WBCallable;
-import org.jboss.weld.introspector.WBParameter;
-import org.jboss.weld.resources.ClassTransformer;
-
-/**
- * Represents a parameter
- *
- * This class is immutable and therefore threadsafe
- *
- * @author Pete Muir
- *
- * @param <T>
- */
-public class WBParameterImpl<T, X> extends AbstractWBAnnotated<T, Object>
implements WBParameter<T, X>
-{
-
- private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
-
- // The final state
- private final boolean _final = false;
- // The static state
- private final boolean _static = false;
- private final boolean _public = false;
- private final boolean _private = false;
- private final boolean _packagePrivate = false;
- private final Package _package;
- private final int position;
- private final WBCallable<?, X, ?> declaringMember;
-
- private final String toString;
-
- public static <T, X> WBParameter<T, X> of(Annotation[] annotations,
Class<T> rawType, Type type, WBCallable<?, X, ?> declaringMember, int
position, ClassTransformer classTransformer)
- {
- return new WBParameterImpl<T, X>(annotations, rawType, type, declaringMember,
position, classTransformer);
- }
-
- public static <T, X> WBParameter<T, X> of(Set<Annotation>
annotations, Class<T> rawType, Type type, WBCallable<?, X, ?> declaringMember,
int position, ClassTransformer classTransformer)
- {
- return new WBParameterImpl<T, X>(annotations.toArray(EMPTY_ANNOTATION_ARRAY),
rawType, type, declaringMember, position, classTransformer);
- }
-
- /**
- * Constructor
- *
- * @param annotations The annotations array
- * @param type The type of the parameter
- */
- protected WBParameterImpl(Annotation[] annotations, Class<T> rawType, Type type,
WBCallable<?, X, ?> declaringMember, int position, ClassTransformer
classTransformer)
- {
- super(AnnotationStore.of(annotations, annotations,
classTransformer.getTypeStore()), rawType, type);
- this.declaringMember = declaringMember;
- this._package = declaringMember.getPackage();
- this.position = position;
- this.toString = new StringBuilder().append("parameter
").append(position).append(" of
").append(declaringMember.toString()).toString();
- }
-
- /**
- * Indicates if the parameter is final
- *
- * @return True if final, false otherwise
- *
- * @see org.jboss.weld.introspector.WBAnnotated#isFinal()
- */
- public boolean isFinal()
- {
- return _final;
- }
-
- /**
- * Indicates if the parameter is static
- *
- * @return True if static, false otherwise
- *
- * @see org.jboss.weld.introspector.WBAnnotated#isStatic()
- */
- public boolean isStatic()
- {
- return _static;
- }
-
- public boolean isPublic()
- {
- return _public;
- }
-
- public boolean isPrivate()
- {
- return _private;
- }
-
- public boolean isPackagePrivate()
- {
- return _packagePrivate;
- }
-
- public Package getPackage()
- {
- return _package;
- }
-
- /**
- * Gets the name of the parameter
- *
- * @throws IllegalArgumentException (not supported)
- *
- * @see org.jboss.weld.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()
- {
- return toString;
- }
-
- public AnnotatedCallable<X> getDeclaringCallable()
- {
- return declaringMember;
- }
-
- public int getPosition()
- {
- return position;
- }
-
- @Override
- public Object getDelegate()
- {
- return null;
- }
-
-}
Copied:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldAnnotationImpl.java (from
rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBAnnotationImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldAnnotationImpl.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldAnnotationImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,154 @@
+/*
+ * 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.weld.introspector.jlr;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.weld.introspector.AnnotationStore;
+import org.jboss.weld.introspector.WeldAnnotation;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.resources.ClassTransformer;
+import org.jboss.weld.util.Names;
+
+import com.google.common.base.Supplier;
+import com.google.common.collect.Multimaps;
+import com.google.common.collect.SetMultimap;
+
+/**
+ * Represents an annotated annotation
+ *
+ * This class is immutable and therefore threadsafe
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public class WeldAnnotationImpl<T extends Annotation> extends
WeldClassImpl<T> implements WeldAnnotation<T>
+{
+
+ // The annotated members map (annotation -> member with annotation)
+ private final SetMultimap<Class<? extends Annotation>, WeldMethod<?,
?>> annotatedMembers;
+ // The implementation class of the annotation
+ private final Class<T> clazz;
+ // The set of abstracted members
+ private final Set<WeldMethod<?, ?>> members;
+
+ private final Map<String, WeldMethod<?, ?>> namedMembers;
+
+ // Cached string representation
+ private final String toString;
+
+ public static <A extends Annotation> WeldAnnotation<A> of(Class<A>
annotationType, ClassTransformer classTransformer)
+ {
+ return new WeldAnnotationImpl<A>(annotationType, classTransformer);
+ }
+
+ /**
+ * Constructor
+ *
+ * Initializes the superclass with the built annotation map
+ *
+ * @param annotationType The annotation type
+ */
+ protected WeldAnnotationImpl(Class<T> annotationType, ClassTransformer
classTransformer)
+ {
+ super(annotationType, annotationType, null, AnnotationStore.of(annotationType,
classTransformer.getTypeStore().get(annotationType),
classTransformer.getTypeStore().get(annotationType), classTransformer.getTypeStore()),
classTransformer);
+ this.clazz = annotationType;
+ this.toString = "class " + Names.classToString(getDelegate());
+ members = new HashSet<WeldMethod<?, ?>>();
+ annotatedMembers = Multimaps.newSetMultimap(new HashMap<Class<? extends
Annotation>, Collection<WeldMethod<?, ?>>>(), new
Supplier<Set<WeldMethod<?, ?>>>()
+ {
+
+ public Set<WeldMethod<?, ?>> get()
+ {
+ return new HashSet<WeldMethod<?, ?>>();
+ }
+
+ });
+ this.namedMembers = new HashMap<String, WeldMethod<?, ?>>();
+ for (Method member : clazz.getDeclaredMethods())
+ {
+ WeldMethod<?, ?> annotatedMethod = WeldMethodImpl.of(member, this,
classTransformer);
+ 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.weld.introspector.WeldAnnotation#getMembers()
+ */
+ public Set<WeldMethod<?, ?>> 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.weld.introspector.WeldAnnotation#getAnnotatedMembers(Class)
+ */
+ public Set<WeldMethod<?, ?>> getAnnotatedMembers(Class<? extends
Annotation> annotationType)
+ {
+ return Collections.unmodifiableSet(annotatedMembers.get(annotationType));
+ }
+
+ public <A> WeldMethod<A, ?> getMember(String memberName,
WeldClass<A> expectedType)
+ {
+ return (WeldMethod<A, ?>) namedMembers.get(memberName);
+ }
+
+ /**
+ * Gets a string representation of the annotation
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ return toString;
+ }
+
+ @Override
+ public Class<T> getDelegate()
+ {
+ return clazz;
+ }
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBClassImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldClassImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,771 @@
+/*
+ * 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.weld.introspector.jlr;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.lang.reflect.Type;
+import java.util.Arrays;
+import java.util.Collection;
+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.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedField;
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedType;
+
+import org.jboss.weld.introspector.AnnotationStore;
+import org.jboss.weld.introspector.ConstructorSignature;
+import org.jboss.weld.introspector.MethodSignature;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldConstructor;
+import org.jboss.weld.introspector.WeldField;
+import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.resources.ClassTransformer;
+import org.jboss.weld.util.Names;
+import org.jboss.weld.util.Reflections;
+
+import com.google.common.base.Supplier;
+import com.google.common.collect.Multimaps;
+import com.google.common.collect.SetMultimap;
+
+/**
+ * Represents an annotated class
+ *
+ * This class is immutable, and therefore threadsafe
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public class WeldClassImpl<T> extends AbstractWeldAnnotated<T,
Class<T>> implements WeldClass<T>
+{
+
+// The superclass abstraction of the type
+ private final WeldClass<?> superclass;
+ // The name of the type
+ private final String name;
+
+ private final String _simpleName;
+ private final boolean _public;
+ private final boolean _private;
+ private final boolean _packagePrivate;
+ private final Package _package;
+
+ private static List<Class<?>> NO_ARGUMENTS = Collections.emptyList();
+
+ // The set of abstracted fields
+ private final Set<WeldField<?, ?>> fields;
+ // The map from annotation type to abstracted field with annotation
+ private final SetMultimap<Class<? extends Annotation>, WeldField<?,
?>> annotatedFields;
+ // The map from annotation type to abstracted field with meta-annotation
+ private final SetMultimap<Class<? extends Annotation>, WeldField<?,
?>> metaAnnotatedFields;
+
+ // The set of abstracted fields
+ private final Set<WeldField<?, ?>> declaredFields;
+ private final Map<String, WeldField<?, ?>> declaredFieldsByName;
+ // The map from annotation type to abstracted field with annotation
+ private final SetMultimap<Class<? extends Annotation>, WeldField<?,
T>> declaredAnnotatedFields;
+ // The map from annotation type to abstracted field with meta-annotation
+ private final SetMultimap<Class<? extends Annotation>, WeldField<?,
?>> declaredMetaAnnotatedFields;
+
+ // The set of abstracted methods
+ private final Set<WeldMethod<?, ?>> methods;
+ private final Map<MethodSignature, WeldMethod<?, ?>>
declaredMethodsBySignature;
+ private final Map<MethodSignature, WeldMethod<?, ?>> methodsBySignature;
+ // The map from annotation type to abstracted method with annotation
+ private final SetMultimap<Class<? extends Annotation>, WeldMethod<?,
?>> annotatedMethods;
+ // The map from annotation type to method with a parameter with annotation
+ private final SetMultimap<Class<? extends Annotation>, WeldMethod<?,
?>> methodsByAnnotatedParameters;
+
+ // The set of abstracted methods
+ private final Set<WeldMethod<?, ?>> declaredMethods;
+ // The map from annotation type to abstracted method with annotation
+ private final SetMultimap<Class<? extends Annotation>, WeldMethod<?,
T>> declaredAnnotatedMethods;
+ // The map from annotation type to method with a parameter with annotation
+ private final SetMultimap<Class<? extends Annotation>, WeldMethod<?,
T>> declaredMethodsByAnnotatedParameters;
+
+ // The set of abstracted constructors
+ private final Set<WeldConstructor<T>> constructors;
+ private final Map<ConstructorSignature, WeldConstructor<?>>
declaredConstructorsBySignature;
+ // The map from annotation type to abstracted constructor with annotation
+ private final SetMultimap<Class<? extends Annotation>,
WeldConstructor<T>> annotatedConstructors;
+ // The map from class list to abstracted constructor
+ private final Map<List<Class<?>>, WeldConstructor<T>>
constructorsByArgumentMap;
+
+ private final SetMultimap<Class<? extends Annotation>,
WeldConstructor<?>> constructorsByAnnotatedParameters;
+
+ // Cached string representation
+ private final String toString;
+
+ private final boolean _nonStaticMemberClass;
+ private final boolean _abstract;
+ private final boolean _enum;
+
+ public static <T> WeldClass<T> of(Class<T> clazz, ClassTransformer
classTransformer)
+ {
+ AnnotationStore annotationStore = AnnotationStore.of(clazz.getAnnotations(),
clazz.getDeclaredAnnotations(), classTransformer.getTypeStore());
+ return new WeldClassImpl<T>(clazz, clazz, null, annotationStore,
classTransformer);
+ }
+
+ public static <T> WeldClass<T> of(AnnotatedType<T> annotatedType,
ClassTransformer classTransformer)
+ {
+ AnnotationStore annotationStore =
AnnotationStore.of(annotatedType.getAnnotations(), annotatedType.getAnnotations(),
classTransformer.getTypeStore());
+ return new WeldClassImpl<T>(annotatedType.getJavaClass(),
annotatedType.getBaseType(), annotatedType, annotationStore, classTransformer);
+ }
+
+ protected WeldClassImpl(Class<T> rawType, Type type, AnnotatedType<T>
annotatedType, AnnotationStore annotationStore, ClassTransformer classTransformer)
+ {
+ super(annotationStore, rawType, type);
+ this.toString = "class " + Names.classToString(rawType);
+ this.name = rawType.getName();
+ this._simpleName = rawType.getSimpleName();
+ if (rawType.getSuperclass() != null)
+ {
+ this.superclass = classTransformer.loadClass(rawType.getSuperclass());
+ }
+ else
+ {
+ this.superclass = null;
+ }
+ this._public = Modifier.isFinal(rawType.getModifiers());
+ this._private = Modifier.isPrivate(rawType.getModifiers());
+ this._packagePrivate = Reflections.isPackagePrivate(rawType.getModifiers());
+ this._package = rawType.getPackage();
+ this.fields = new HashSet<WeldField<?, ?>>();
+ this.annotatedFields = Multimaps.newSetMultimap(new HashMap<Class<? extends
Annotation>, Collection<WeldField<?, ?>>>(), new Supplier<
Set<WeldField<?, ?>>>()
+ {
+
+ public Set<WeldField<?, ?>> get()
+ {
+ return new HashSet<WeldField<?, ?>>();
+ }
+
+ });
+ this.metaAnnotatedFields = Multimaps.newSetMultimap(new HashMap<Class<?
extends Annotation>, Collection<WeldField<?, ?>>>(), new Supplier<
Set<WeldField<?, ?>>>()
+ {
+
+ public Set<WeldField<?, ?>> get()
+ {
+ return new HashSet<WeldField<?, ?>>();
+ }
+
+ });
+ this.declaredFields = new HashSet<WeldField<?, ?>>();
+ this.declaredFieldsByName = new HashMap<String, WeldField<?, ?>>();
+ this.declaredAnnotatedFields = Multimaps.newSetMultimap(new HashMap<Class<?
extends Annotation>, Collection<WeldField<?, T>>>(), new Supplier<
Set<WeldField<?, T>>>()
+ {
+
+ public Set<WeldField<?, T>> get()
+ {
+ return new HashSet<WeldField<?, T>>();
+ }
+
+ });
+ this.declaredMetaAnnotatedFields = Multimaps.newSetMultimap(new
HashMap<Class<? extends Annotation>, Collection<WeldField<?,
?>>>(), new Supplier< Set<WeldField<?, ?>>>()
+ {
+
+ public Set<WeldField<?, ?>> get()
+ {
+ return new HashSet<WeldField<?, ?>>();
+ }
+
+ });
+ this._nonStaticMemberClass = Reflections.isNonStaticInnerClass(rawType);
+ this._abstract = Reflections.isAbstract(rawType);
+ this._enum = rawType.isEnum();
+
+
+ Map<Field, AnnotatedField<? super T>> annotatedTypeFields = new
HashMap<Field, AnnotatedField<? super T>>();
+ if (annotatedType != null)
+ {
+ for (AnnotatedField<? super T> annotatedField :
annotatedType.getFields())
+ {
+ annotatedTypeFields.put(annotatedField.getJavaMember(), annotatedField);
+ }
+ }
+
+ for (Class<?> c = rawType; c != Object.class && c != null; c =
c.getSuperclass())
+ {
+ for (Field field : c.getDeclaredFields())
+ {
+ if (!field.isAccessible())
+ {
+ field.setAccessible(true);
+ }
+ WeldField<?, T> annotatedField = null;
+ if (annotatedTypeFields.containsKey(field))
+ {
+ annotatedField = WeldFieldImpl.of(annotatedTypeFields.get(field),
this.<T>getDeclaringWBClass(field, classTransformer), classTransformer);
+ }
+ else
+ {
+ annotatedField = WeldFieldImpl.of(field,
this.<T>getDeclaringWBClass(field, classTransformer), classTransformer);
+ }
+
+ 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<WeldConstructor<T>>();
+ this.constructorsByArgumentMap = new HashMap<List<Class<?>>,
WeldConstructor<T>>();
+ this.annotatedConstructors = Multimaps.newSetMultimap(new HashMap<Class<?
extends Annotation>, Collection<WeldConstructor<T>>>(), new Supplier<
Set<WeldConstructor<T>>>()
+ {
+
+ public Set<WeldConstructor<T>> get()
+ {
+ return new HashSet<WeldConstructor<T>>();
+ }
+
+ });
+ this.constructorsByAnnotatedParameters = Multimaps.newSetMultimap(new
HashMap<Class<? extends Annotation>,
Collection<WeldConstructor<?>>>(), new Supplier<
Set<WeldConstructor<?>>>()
+ {
+
+ public Set<WeldConstructor<?>> get()
+ {
+ return new HashSet<WeldConstructor<?>>();
+ }
+
+ });
+
+ Map<Constructor<? super T>, AnnotatedConstructor<T>>
annotatedTypeConstructors = new HashMap<Constructor<? super T>,
AnnotatedConstructor<T>>();
+ if (annotatedType != null)
+ {
+ for (AnnotatedConstructor<T> annotated : annotatedType.getConstructors())
+ {
+ annotatedTypeConstructors.put(annotated.getJavaMember(), annotated);
+ }
+ }
+
+ this.declaredConstructorsBySignature = new HashMap<ConstructorSignature,
WeldConstructor<?>>();
+ for (Constructor<?> constructor : rawType.getDeclaredConstructors())
+ {
+ WeldConstructor<T> annotatedConstructor = null;
+ if (annotatedTypeConstructors.containsKey(constructor))
+ {
+ WeldClass<T> declaringClass = this.getDeclaringWBClass(constructor,
classTransformer);
+ annotatedConstructor =
WeldConstructorImpl.of(annotatedTypeConstructors.get(constructor), declaringClass,
classTransformer);
+ }
+ else
+ {
+ // TODO Fix this cast
+ Constructor<T> c = (Constructor<T>) constructor;
+ annotatedConstructor = WeldConstructorImpl.of(c,
this.<T>getDeclaringWBClass(c, classTransformer), classTransformer);
+ }
+
+ 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.putAll(annotation.annotationType(), new
HashSet<WeldConstructor<T>>());
+ }
+
annotatedConstructors.get(annotation.annotationType()).add(annotatedConstructor);
+ }
+
+ for (Class<? extends Annotation> annotationType :
WeldConstructor.MAPPED_PARAMETER_ANNOTATIONS)
+ {
+ if (annotatedConstructor.getAnnotatedWBParameters(annotationType).size() >
0)
+ {
+ constructorsByAnnotatedParameters.put(annotationType,
annotatedConstructor);
+ }
+ }
+ }
+
+ this.methods = new HashSet<WeldMethod<?, ?>>();
+ this.annotatedMethods = Multimaps.newSetMultimap(new HashMap<Class<? extends
Annotation>, Collection<WeldMethod<?, ?>>>(), new Supplier<
Set<WeldMethod<?, ?>>>()
+ {
+
+ public Set<WeldMethod<?, ?>> get()
+ {
+ return new HashSet<WeldMethod<?, ?>>();
+ }
+
+ });
+ this.methodsByAnnotatedParameters = Multimaps.newSetMultimap(new
HashMap<Class<? extends Annotation>, Collection<WeldMethod<?,
?>>>(), new Supplier< Set<WeldMethod<?, ?>>>()
+ {
+
+ public Set<WeldMethod<?, ?>> get()
+ {
+ return new HashSet<WeldMethod<?, ?>>();
+ }
+
+ });
+ this.declaredMethods = new HashSet<WeldMethod<?, ?>>();
+ this.declaredAnnotatedMethods = Multimaps.newSetMultimap(new HashMap<Class<?
extends Annotation>, Collection<WeldMethod<?, T>>>(), new Supplier<
Set<WeldMethod<?, T>>>()
+ {
+
+ public Set<WeldMethod<?, T>> get()
+ {
+ return new HashSet<WeldMethod<?, T>>();
+ }
+
+ });
+ this.declaredMethodsByAnnotatedParameters = Multimaps.newSetMultimap(new
HashMap<Class<? extends Annotation>, Collection<WeldMethod<?,
T>>>(), new Supplier< Set<WeldMethod<?, T>>>()
+ {
+
+ public Set<WeldMethod<?, T>> get()
+ {
+ return new HashSet<WeldMethod<?, T>>();
+ }
+
+ });
+ this.declaredMethodsBySignature = new HashMap<MethodSignature, WeldMethod<?,
?>>();
+ this.methodsBySignature = new HashMap<MethodSignature, WeldMethod<?,
?>>();
+
+ Map<Method, AnnotatedMethod<?>> annotatedTypeMethods = new
HashMap<Method, AnnotatedMethod<?>>();
+ if (annotatedType != null)
+ {
+ for (AnnotatedMethod<?> annotated : annotatedType.getMethods())
+ {
+ annotatedTypeMethods.put(annotated.getJavaMember(), annotated);
+ }
+ }
+
+ for (Class<?> c = rawType; c != Object.class && c != null; c =
c.getSuperclass())
+ {
+ for (Method method : c.getDeclaredMethods())
+ {
+ if (!method.isAccessible())
+ {
+ method.setAccessible(true);
+ }
+
+ WeldMethod<?, T> annotatedMethod = null;
+ if (annotatedTypeMethods.containsKey(method))
+ {
+ annotatedMethod = WeldMethodImpl.of(annotatedTypeMethods.get(method),
this, classTransformer);
+ }
+ else
+ {
+ annotatedMethod = WeldMethodImpl.of(method,
this.<T>getDeclaringWBClass(method, classTransformer), classTransformer);
+ }
+ this.methods.add(annotatedMethod);
+ this.methodsBySignature.put(annotatedMethod.getSignature(),
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 :
WeldMethod.MAPPED_PARAMETER_ANNOTATIONS)
+ {
+ if (annotatedMethod.getAnnotatedWBParameters(annotationType).size() >
0)
+ {
+ methodsByAnnotatedParameters.put(annotationType, annotatedMethod);
+ if (c == rawType)
+ {
+ this.declaredMethodsByAnnotatedParameters.put(annotationType,
annotatedMethod);
+ }
+ }
+ }
+ }
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private <X> WeldClass<X> getDeclaringWBClass(Member member,
ClassTransformer transformer)
+ {
+ if (member.getDeclaringClass().equals(getJavaClass()))
+ {
+ return (WeldClass<X>) this;
+ }
+ else
+ {
+ return transformer.loadClass((Class<X>) member.getDeclaringClass());
+ }
+ }
+
+ /**
+ * Gets the implementing class
+ *
+ * @return The class
+ */
+ public Class<? extends T> getAnnotatedClass()
+ {
+ return getJavaClass();
+ }
+
+ /**
+ * Gets the delegate (class)
+ *
+ * @return The class
+ */
+ @Override
+ public Class<T> getDelegate()
+ {
+ return getJavaClass();
+ }
+
+ /**
+ * Gets the abstracted fields of the class
+ *
+ * Initializes the fields if they are null
+ *
+ * @return The set of abstracted fields
+ */
+ public Set<WeldField<?, ?>> getWeldFields()
+ {
+ return Collections.unmodifiableSet(fields);
+ }
+
+ public Set<WeldField<?, ?>> getDeclaredFields()
+ {
+ return Collections.unmodifiableSet(declaredFields);
+ }
+
+ public <F> WeldField<F, ?> getDeclaredWeldField(String fieldName,
WeldClass<F> expectedType)
+ {
+ return (WeldField<F, ?>) declaredFieldsByName.get(fieldName);
+ }
+
+ public Set<WeldField<?, T>> getDeclaredAnnotatedWeldFields(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<WeldConstructor<T>> getWeldConstructors()
+ {
+ return Collections.unmodifiableSet(constructors);
+ }
+
+ public WeldConstructor<T> getDeclaredWeldConstructor(ConstructorSignature
signature)
+ {
+ return (WeldConstructor<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<WeldField<?, ?>> getMetaAnnotatedWeldFields(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<WeldField<?, ?>> getAnnotatedWeldFields(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.weld.introspector.WeldClass#getAnnotatedWeldMethods(Class)
+ */
+ public Set<WeldMethod<?, ?>> getAnnotatedWeldMethods(Class<? extends
Annotation> annotationType)
+ {
+ return Collections.unmodifiableSet(annotatedMethods.get(annotationType));
+ }
+
+ public Set<WeldMethod<?, T>> getDeclaredAnnotatedWeldMethods(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.weld.introspector.WeldClass#getAnnotatedWeldConstructors(Class)
+ */
+ public Set<WeldConstructor<T>> getAnnotatedWeldConstructors(Class<?
extends Annotation> annotationType)
+ {
+ return Collections.unmodifiableSet(annotatedConstructors.get(annotationType));
+ }
+
+ public WeldConstructor<T> getNoArgsWeldConstructor()
+ {
+ return constructorsByArgumentMap.get(NO_ARGUMENTS);
+ }
+
+ public Set<WeldMethod<?, ?>>
getWeldMethodsWithAnnotatedParameters(Class<? extends Annotation> annotationType)
+ {
+ return
Collections.unmodifiableSet(methodsByAnnotatedParameters.get(annotationType));
+ }
+
+ public Set<WeldConstructor<?>>
getWeldConstructorsWithAnnotatedParameters(Class<? extends Annotation>
annotationType)
+ {
+ return
Collections.unmodifiableSet(constructorsByAnnotatedParameters.get(annotationType));
+ }
+
+ public Set<WeldMethod<?, T>>
getDeclaredWeldMethodsWithAnnotatedParameters(Class<? extends Annotation>
annotationType)
+ {
+ return
Collections.unmodifiableSet(declaredMethodsByAnnotatedParameters.get(annotationType));
+ }
+
+ public WeldMethod<?, ?> getWeldMethod(Method methodDescriptor)
+ {
+ // TODO Should be cached
+ for (WeldMethod<?, ?> annotatedMethod : methods)
+ {
+ if (annotatedMethod.getName().equals(methodDescriptor.getName()) &&
Arrays.equals(annotatedMethod.getParameterTypesAsArray(),
methodDescriptor.getParameterTypes()))
+ {
+ return annotatedMethod;
+ }
+ }
+ return null;
+ }
+
+ public Set<WeldMethod<?, ?>> getWeldMethods()
+ {
+ return Collections.unmodifiableSet(methods);
+ }
+
+ public WeldMethod<?, ?> getDeclaredWeldMethod(Method method)
+ {
+ // TODO Should be cached
+ for (WeldMethod<?, ?> annotatedMethod : declaredMethods)
+ {
+ if (annotatedMethod.getName().equals(method.getName()) &&
Arrays.equals(annotatedMethod.getParameterTypesAsArray(), method.getParameterTypes()))
+ {
+ return annotatedMethod;
+ }
+ }
+ return null;
+ }
+
+ public Set<WeldMethod<?, ?>> getDeclaredWeldMethods()
+ {
+ return declaredMethods;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <M> WeldMethod<M, ?> getDeclaredWeldMethod(MethodSignature
signature, WeldClass<M> expectedReturnType)
+ {
+ return (WeldMethod<M, ?>) declaredMethodsBySignature.get(signature);
+ }
+
+ @SuppressWarnings("unchecked")
+ public <M> WeldMethod<M, ?> getWBMethod(MethodSignature signature)
+ {
+ return (WeldMethod<M, ?>) methodsBySignature.get(signature);
+ }
+
+ /**
+ * Gets a string representation of the class
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ return toString;
+ }
+
+ public String getSimpleName()
+ {
+ return _simpleName;
+ }
+
+ /**
+ * Indicates if the type is static
+ *
+ * @return True if static, false otherwise
+ *
+ * @see org.jboss.weld.introspector.WeldAnnotated#isStatic()
+ */
+ public boolean isStatic()
+ {
+ return Reflections.isStatic(getDelegate());
+ }
+
+ /**
+ * Indicates if the type if final
+ *
+ * @return True if final, false otherwise
+ *
+ * @see org.jboss.weld.introspector.WeldAnnotated#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.weld.introspector.WeldAnnotated#getName()
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * Gets the superclass abstraction of the type
+ *
+ * @return The superclass abstraction
+ */
+ public WeldClass<?> getWeldSuperclass()
+ {
+ return superclass;
+ }
+
+ public boolean isEquivalent(Class<?> clazz)
+ {
+ return getDelegate().equals(clazz);
+ }
+
+ public boolean isPrivate()
+ {
+ return _private;
+ }
+
+ public boolean isPackagePrivate()
+ {
+ return _packagePrivate;
+ }
+
+ public Package getPackage()
+ {
+ return _package;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <U> WeldClass<? extends U> asWeldSubclass(WeldClass<U>
clazz)
+ {
+ return (WeldClass<? extends U>) this;
+ }
+
+ @SuppressWarnings("unchecked")
+ public <S> S cast(Object object)
+ {
+ return (S) object;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Set<AnnotatedConstructor<T>> getConstructors()
+ {
+ return (Set) constructors;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Set<AnnotatedField<? super T>> getFields()
+ {
+ return (Set) fields;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Set<AnnotatedMethod<? super T>> getMethods()
+ {
+ return (Set) methods;
+ }
+
+}
\ No newline at end of file
Copied:
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldConstructorImpl.java (from
rev 3894,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBConstructorImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldConstructorImpl.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldConstructorImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,287 @@
+/*
+ * 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.weld.introspector.jlr;
+
+import static org.jboss.weld.util.Reflections.ensureAccessible;
+
+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.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.enterprise.inject.spi.AnnotatedConstructor;
+import javax.enterprise.inject.spi.AnnotatedParameter;
+
+import org.jboss.weld.BeanManagerImpl;
+import org.jboss.weld.introspector.AnnotationStore;
+import org.jboss.weld.introspector.ConstructorSignature;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldConstructor;
+import org.jboss.weld.introspector.WeldParameter;
+import org.jboss.weld.resources.ClassTransformer;
+
+import com.google.common.base.Supplier;
+import com.google.common.collect.ListMultimap;
+import com.google.common.collect.Multimaps;
+
+/**
+ * Represents an annotated constructor
+ *
+ * This class is immutable, and therefore threadsafe
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public class WeldConstructorImpl<T> extends AbstractWeldCallable<T, T,
Constructor<T>> implements WeldConstructor<T>
+{
+
+ // The underlying constructor
+ private final Constructor<T> constructor;
+
+ // The list of parameter abstractions
+ private final List<WeldParameter<?, ?>> parameters;
+ // The mapping of annotation -> parameter abstraction
+ private final ListMultimap<Class<? extends Annotation>, WeldParameter<?,
?>> annotatedParameters;
+
+ private final ConstructorSignature signature;
+
+ // Cached string representation
+ private final String toString;
+
+ public static <T> WeldConstructor<T> of(Constructor<T> constructor,
WeldClass<T> declaringClass, ClassTransformer classTransformer)
+ {
+ AnnotationStore annotationStore = AnnotationStore.of(constructor,
classTransformer.getTypeStore());
+ return new WeldConstructorImpl<T>(ensureAccessible(constructor), null,
annotationStore, declaringClass, classTransformer);
+ }
+
+ public static <T> WeldConstructor<T> of(AnnotatedConstructor<T>
annotatedConstructor, WeldClass<T> declaringClass, ClassTransformer
classTransformer)
+ {
+ AnnotationStore annotationStore =
AnnotationStore.of(annotatedConstructor.getAnnotations(),
annotatedConstructor.getAnnotations(), classTransformer.getTypeStore());
+ return new
WeldConstructorImpl<T>(ensureAccessible(annotatedConstructor.getJavaMember()),
annotatedConstructor, annotationStore, declaringClass, classTransformer);
+ }
+
+ /**
+ * Constructor
+ *
+ * Initializes the superclass with the build annotations map
+ *
+ * @param constructor The constructor method
+ * @param declaringClass The declaring class
+ */
+ private WeldConstructorImpl(Constructor<T> constructor,
AnnotatedConstructor<T> annotatedConstructor, AnnotationStore annotationStore,
WeldClass<T> declaringClass, ClassTransformer classTransformer)
+ {
+ super(annotationStore, constructor, constructor.getDeclaringClass(),
constructor.getDeclaringClass(), declaringClass);
+ this.toString = new StringBuilder().append("constructor
").append(constructor.toString()).toString();
+ this.constructor = constructor;
+
+ this.parameters = new ArrayList<WeldParameter<?, ?>>();
+ annotatedParameters = Multimaps.newListMultimap(new HashMap<Class<? extends
Annotation>, Collection<WeldParameter<?, ?>>>(), new Supplier<
List<WeldParameter<?, ?>>>()
+ {
+
+ public List<WeldParameter<?, ?>> get()
+ {
+ return new ArrayList<WeldParameter<?, ?>>();
+ }
+
+ });
+
+ Map<Integer, AnnotatedParameter<?>> annotatedTypeParameters = new
HashMap<Integer, AnnotatedParameter<?>>();
+
+ if (annotatedConstructor != null)
+ {
+ for (AnnotatedParameter<?> annotated :
annotatedConstructor.getParameters())
+ {
+ annotatedTypeParameters.put(annotated.getPosition(), annotated);
+ }
+ }
+
+ for (int i = 0; i < constructor.getParameterTypes().length; i++)
+ {
+ if (constructor.getParameterAnnotations()[i].length > 0 ||
annotatedTypeParameters.containsKey(i))
+ {
+ Class<?> clazz = constructor.getParameterTypes()[i];
+ Type type = constructor.getGenericParameterTypes()[i];
+ WeldParameter<?, ?> parameter = null;
+ if (annotatedTypeParameters.containsKey(i))
+ {
+ AnnotatedParameter<?> annotatedParameter =
annotatedTypeParameters.get(i);
+ parameter = WeldParameterImpl.of(annotatedParameter.getAnnotations(),
clazz, type, this, i, classTransformer);
+ }
+ else
+ {
+ parameter = WeldParameterImpl.of(constructor.getParameterAnnotations()[i],
clazz, type, this, i, classTransformer);
+ }
+
+ 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;
+ }
+ WeldParameter<?, ?> parameter = WeldParameterImpl.of(new Annotation[0],
clazz, type, this, i, classTransformer);
+ 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.weld.introspector.WeldConstructor#getWBParameters()
+ */
+ public List<WeldParameter<?, ?>> getWBParameters()
+ {
+ 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.weld.introspector.WeldConstructor#getAnnotatedWBParameters(Class)
+ */
+ public List<WeldParameter<?, ?>> getAnnotatedWBParameters(Class<?
extends Annotation> annotationType)
+ {
+ return Collections.unmodifiableList(annotatedParameters.get(annotationType));
+ }
+
+ /**
+ * Creates a new instance
+ *
+ * @param manager The Bean manager
+ * @return An instance
+ * @throws InvocationTargetException
+ * @throws IllegalAccessException
+ * @throws InstantiationException
+ * @throws IllegalArgumentException
+ *
+ * @see org.jboss.weld.introspector.WeldConstructor#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 WeldConstructor)
+ {
+ WeldConstructor<?> that = (WeldConstructor<?>) other;
+ return this.getDeclaringType().equals(that.getDeclaringType()) &&
this.getWBParameters().equals(that.getWBParameters());
+ }
+ return false;
+ }
+
+ /**
+ * The overridden hashcode
+ *
+ * Gets the hash code from the delegate
+ *
+ * @return The hash code
+ */
+ @Override
+ public int hashCode()
+ {
+ return getDelegate().hashCode();
+ }
+
+ /**
+ * Gets a string representation of the constructor
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ return toString;
+ }
+
+ public ConstructorSignature getSignature()
+ {
+ return signature;
+ }
+
+ public List<AnnotatedParameter<T>> getParameters()
+ {
+ return Collections.unmodifiableList((List) parameters);
+ }
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldFieldImpl.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBFieldImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldFieldImpl.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldFieldImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,153 @@
+/*
+ * 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.weld.introspector.jlr;
+
+import static org.jboss.weld.util.Reflections.ensureAccessible;
+
+import java.lang.reflect.Field;
+
+import javax.enterprise.inject.spi.AnnotatedField;
+
+import org.jboss.weld.introspector.AnnotationStore;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldField;
+import org.jboss.weld.resources.ClassTransformer;
+import org.jboss.weld.util.Reflections;
+
+/**
+ * Represents an annotated field
+ *
+ * This class is immutable, and therefore threadsafe
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public class WeldFieldImpl<T, X> extends AbstractWeldMember<T, X, Field>
implements WeldField<T, X>
+{
+
+ // The underlying field
+ private final Field field;
+
+ // Cached string representation
+ private final String toString;
+
+ public static <T, X> WeldFieldImpl<T, X> of(Field field,
WeldClass<X> declaringClass, ClassTransformer classTransformer)
+ {
+ AnnotationStore annotationStore = AnnotationStore.of(field,
classTransformer.getTypeStore());
+ return new WeldFieldImpl<T, X>(ensureAccessible(field), annotationStore,
declaringClass, classTransformer);
+ }
+
+ public static <T, X> WeldFieldImpl<T, X> of(AnnotatedField<? super
X> annotatedField, WeldClass<X> declaringClass, ClassTransformer
classTransformer)
+ {
+ AnnotationStore annotationStore =
AnnotationStore.of(annotatedField.getAnnotations(), annotatedField.getAnnotations(),
classTransformer.getTypeStore());
+ return new WeldFieldImpl<T,
X>(ensureAccessible(annotatedField.getJavaMember()), annotationStore, declaringClass,
classTransformer);
+ }
+
+ /**
+ * 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
+ */
+ private WeldFieldImpl(Field field, AnnotationStore annotationStore, WeldClass<X>
declaringClass, ClassTransformer classTransformer)
+ {
+ super(annotationStore, field, (Class<T>) field.getType(),
field.getGenericType(), declaringClass);
+ this.field = field;
+ this.toString = new StringBuilder().append("field
").append(declaringClass.getName()).append(".").append(field.getName()).toString();
+ }
+
+ /**
+ * Gets the underlying field
+ *
+ * @return The fields
+ */
+ public Field getAnnotatedField()
+ {
+ return field;
+ }
+
+ @Override
+ 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.weld.introspector.WeldField#getName()
+ */
+ public String getPropertyName()
+ {
+ return getName();
+ }
+
+ /**
+ * Gets a string representation of the field
+ *
+ * @return A string representation
+ */
+ @Override
+ public String toString()
+ {
+ return this.toString;
+ }
+
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other instanceof WeldField<?, ?>)
+ {
+ WeldField<?, ?> that = (WeldField<?, ?>) other;
+ return this.getDeclaringType().equals(that.getDeclaringType()) &&
this.getName().equals(that.getName());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+
+ @Override
+ public int hashCode()
+ {
+ return getDelegate().hashCode();
+ }
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldMethodImpl.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBMethodImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldMethodImpl.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldMethodImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,259 @@
+/*
+ * 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.weld.introspector.jlr;
+
+import static org.jboss.weld.util.Reflections.ensureAccessible;
+
+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.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.enterprise.inject.spi.AnnotatedMethod;
+import javax.enterprise.inject.spi.AnnotatedParameter;
+
+import org.jboss.weld.introspector.AnnotationStore;
+import org.jboss.weld.introspector.MethodSignature;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.WeldMethod;
+import org.jboss.weld.introspector.WeldParameter;
+import org.jboss.weld.resources.ClassTransformer;
+import org.jboss.weld.util.Reflections;
+
+import com.google.common.base.Supplier;
+import com.google.common.collect.ListMultimap;
+import com.google.common.collect.Multimaps;
+
+/**
+ * Represents an annotated method
+ *
+ * This class is immutable and therefore threadsafe
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public class WeldMethodImpl<T, X> extends AbstractWeldCallable<T, X, Method>
implements WeldMethod<T, X>
+{
+
+ // The underlying method
+ private final Method method;
+
+ // The abstracted parameters
+ private final List<WeldParameter<?, ?>> parameters;
+ // A mapping from annotation type to parameter abstraction with that
+ // annotation present
+ private final ListMultimap<Class<? extends Annotation>, WeldParameter<?,
?>> annotatedParameters;
+
+ // The property name
+ private final String propertyName;
+
+ // Cached string representation
+ private final String toString;
+
+ private final MethodSignature signature;
+
+ public static <T, X> WeldMethodImpl<T, X> of(Method method,
WeldClass<X> declaringClass, ClassTransformer classTransformer)
+ {
+ AnnotationStore annotationStore = AnnotationStore.of(method,
classTransformer.getTypeStore());
+ return new WeldMethodImpl<T, X>(ensureAccessible(method), null,
annotationStore, declaringClass, classTransformer);
+ }
+
+ public static <T, X> WeldMethodImpl<T, X> of(AnnotatedMethod<T>
method, WeldClass<X> declaringClass, ClassTransformer classTransformer)
+ {
+ AnnotationStore annotationStore = AnnotationStore.of(method.getAnnotations(),
method.getAnnotations(), classTransformer.getTypeStore());
+ return new WeldMethodImpl<T, X>(ensureAccessible(method.getJavaMember()),
method, annotationStore, declaringClass, classTransformer);
+ }
+
+ /**
+ * 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")
+ private WeldMethodImpl(Method method, AnnotatedMethod<T> annotatedMethod,
AnnotationStore annotationStore, WeldClass<X> declaringClass, ClassTransformer
classTransformer)
+ {
+ super(annotationStore, method, (Class<T>) method.getReturnType(),
method.getGenericReturnType(), declaringClass);
+ this.method = method;
+ this.toString = new StringBuilder().append("method
").append(method.toString()).toString();
+ this.parameters = new ArrayList<WeldParameter<?, ?>>();
+ this.annotatedParameters = Multimaps.newListMultimap(new HashMap<Class<?
extends Annotation>, Collection<WeldParameter<?, ?>>>(), new
Supplier< List<WeldParameter<?, ?>>>()
+ {
+
+ public List<WeldParameter<?, ?>> get()
+ {
+ return new ArrayList<WeldParameter<?, ?>>();
+ }
+
+ });
+
+ Map<Integer, AnnotatedParameter<?>> annotatedTypeParameters = new
HashMap<Integer, AnnotatedParameter<?>>();
+
+ if (annotatedMethod != null)
+ {
+ for (AnnotatedParameter<?> annotated : annotatedMethod.getParameters())
+ {
+ annotatedTypeParameters.put(annotated.getPosition(), annotated);
+ }
+ }
+
+ for (int i = 0; i < method.getParameterTypes().length; i++)
+ {
+ if (method.getParameterAnnotations()[i].length > 0 ||
annotatedTypeParameters.containsKey(i))
+ {
+ Class<? extends Object> clazz = method.getParameterTypes()[i];
+ Type type = method.getGenericParameterTypes()[i];
+ WeldParameter<?, ?> parameter = null;
+ if (annotatedTypeParameters.containsKey(i))
+ {
+ AnnotatedParameter<?> annotatedParameter =
annotatedTypeParameters.get(i);
+ parameter = WeldParameterImpl.of(annotatedParameter.getAnnotations(),
clazz, type, this, i, classTransformer);
+ }
+ else
+ {
+ parameter = WeldParameterImpl.of(method.getParameterAnnotations()[i],
clazz, type, this, i, classTransformer);
+ }
+ 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];
+ WeldParameter<?, ?> parameter = WeldParameterImpl.of(new Annotation[0],
(Class<Object>) clazz, type, this, i, classTransformer);
+ 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;
+ }
+
+ @Override
+ public Method getDelegate()
+ {
+ return method;
+ }
+
+ public List<WeldParameter<?, ?>> getWBParameters()
+ {
+ return Collections.unmodifiableList(parameters);
+ }
+
+ public Class<?>[] getParameterTypesAsArray()
+ {
+ return method.getParameterTypes();
+ }
+
+ public List<WeldParameter<?, ?>> getAnnotatedWBParameters(Class<?
extends Annotation> annotationType)
+ {
+ return Collections.unmodifiableList(annotatedParameters.get(annotationType));
+ }
+
+ @Override
+ public boolean equals(Object other)
+ {
+ if (other instanceof WeldMethod)
+ {
+ WeldMethod<?, ?> that = (WeldMethod<?, ?>) other;
+ return this.getDeclaringType().equals(that.getDeclaringType()) &&
this.getName().equals(that.getName()) &&
this.getWBParameters().equals(that.getWBParameters());
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public boolean isEquivalent(Method method)
+ {
+ return this.getDeclaringType().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;
+ }
+
+ @Override
+ public String toString()
+ {
+ return this.toString;
+ }
+
+ public MethodSignature getSignature()
+ {
+ return signature;
+ }
+
+ public List<AnnotatedParameter<X>> getParameters()
+ {
+ return Collections.unmodifiableList((List) parameters);
+ }
+
+}
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WBParameterImpl.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/introspector/jlr/WeldParameterImpl.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,165 @@
+/*
+ * 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.weld.introspector.jlr;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.Type;
+import java.util.Set;
+
+import javax.enterprise.inject.spi.AnnotatedCallable;
+
+import org.jboss.weld.introspector.AnnotationStore;
+import org.jboss.weld.introspector.WeldCallable;
+import org.jboss.weld.introspector.WeldParameter;
+import org.jboss.weld.resources.ClassTransformer;
+
+/**
+ * Represents a parameter
+ *
+ * This class is immutable and therefore threadsafe
+ *
+ * @author Pete Muir
+ *
+ * @param <T>
+ */
+public class WeldParameterImpl<T, X> extends AbstractWeldAnnotated<T, Object>
implements WeldParameter<T, X>
+{
+
+ private static final Annotation[] EMPTY_ANNOTATION_ARRAY = new Annotation[0];
+
+ // The final state
+ private final boolean _final = false;
+ // The static state
+ private final boolean _static = false;
+ private final boolean _public = false;
+ private final boolean _private = false;
+ private final boolean _packagePrivate = false;
+ private final Package _package;
+ private final int position;
+ private final WeldCallable<?, X, ?> declaringMember;
+
+ private final String toString;
+
+ public static <T, X> WeldParameter<T, X> of(Annotation[] annotations,
Class<T> rawType, Type type, WeldCallable<?, X, ?> declaringMember, int
position, ClassTransformer classTransformer)
+ {
+ return new WeldParameterImpl<T, X>(annotations, rawType, type,
declaringMember, position, classTransformer);
+ }
+
+ public static <T, X> WeldParameter<T, X> of(Set<Annotation>
annotations, Class<T> rawType, Type type, WeldCallable<?, X, ?>
declaringMember, int position, ClassTransformer classTransformer)
+ {
+ return new WeldParameterImpl<T,
X>(annotations.toArray(EMPTY_ANNOTATION_ARRAY), rawType, type, declaringMember,
position, classTransformer);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param annotations The annotations array
+ * @param type The type of the parameter
+ */
+ protected WeldParameterImpl(Annotation[] annotations, Class<T> rawType, Type
type, WeldCallable<?, X, ?> declaringMember, int position, ClassTransformer
classTransformer)
+ {
+ super(AnnotationStore.of(annotations, annotations,
classTransformer.getTypeStore()), rawType, type);
+ this.declaringMember = declaringMember;
+ this._package = declaringMember.getPackage();
+ this.position = position;
+ this.toString = new StringBuilder().append("parameter
").append(position).append(" of
").append(declaringMember.toString()).toString();
+ }
+
+ /**
+ * Indicates if the parameter is final
+ *
+ * @return True if final, false otherwise
+ *
+ * @see org.jboss.weld.introspector.WeldAnnotated#isFinal()
+ */
+ public boolean isFinal()
+ {
+ return _final;
+ }
+
+ /**
+ * Indicates if the parameter is static
+ *
+ * @return True if static, false otherwise
+ *
+ * @see org.jboss.weld.introspector.WeldAnnotated#isStatic()
+ */
+ public boolean isStatic()
+ {
+ return _static;
+ }
+
+ public boolean isPublic()
+ {
+ return _public;
+ }
+
+ public boolean isPrivate()
+ {
+ return _private;
+ }
+
+ public boolean isPackagePrivate()
+ {
+ return _packagePrivate;
+ }
+
+ public Package getPackage()
+ {
+ return _package;
+ }
+
+ /**
+ * Gets the name of the parameter
+ *
+ * @throws IllegalArgumentException (not supported)
+ *
+ * @see org.jboss.weld.introspector.WeldAnnotated#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()
+ {
+ return toString;
+ }
+
+ public AnnotatedCallable<X> getDeclaringCallable()
+ {
+ return declaringMember;
+ }
+
+ public int getPosition()
+ {
+ return position;
+ }
+
+ @Override
+ public Object getDelegate()
+ {
+ return null;
+ }
+
+}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/AnnotationModel.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/AnnotationModel.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/AnnotationModel.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -22,7 +22,7 @@
import java.util.Set;
import org.jboss.weld.DefinitionException;
-import org.jboss.weld.introspector.WBAnnotation;
+import org.jboss.weld.introspector.WeldAnnotation;
import org.jboss.weld.log.Log;
import org.jboss.weld.log.Logging;
import org.jboss.weld.resources.ClassTransformer;
@@ -37,7 +37,7 @@
private static final Log log = Logging.getLog(AnnotationModel.class);
// The underlying annotation
- private WBAnnotation<T> annotatedAnnotation;
+ private WeldAnnotation<T> annotatedAnnotation;
// Is the data valid?
protected boolean valid;
@@ -125,7 +125,7 @@
*
* @return The annotation
*/
- protected WBAnnotation<T> getAnnotatedAnnotation()
+ protected WeldAnnotation<T> getAnnotatedAnnotation()
{
return annotatedAnnotation;
}
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/BindingTypeModel.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/BindingTypeModel.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/BindingTypeModel.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -24,7 +24,7 @@
import javax.inject.Qualifier;
import org.jboss.weld.DefinitionException;
-import org.jboss.weld.introspector.WBMethod;
+import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.log.Log;
import org.jboss.weld.log.Logging;
import org.jboss.weld.resources.ClassTransformer;
@@ -46,7 +46,7 @@
private static final Log log = Logging.getLog(BindingTypeModel.class);
// The non-binding types
- private Set<WBMethod<?, ?>> nonBindingTypes;
+ private Set<WeldMethod<?, ?>> nonBindingTypes;
/**
@@ -75,7 +75,7 @@
*/
private void checkArrayAndAnnotationValuedMembers()
{
- for (WBMethod<?, ?> annotatedMethod : getAnnotatedAnnotation().getMembers())
+ for (WeldMethod<?, ?> annotatedMethod :
getAnnotatedAnnotation().getMembers())
{
if ((Reflections.isArrayType(annotatedMethod.getJavaClass()) ||
Annotation.class.isAssignableFrom(annotatedMethod.getJavaClass())) &&
!nonBindingTypes.contains(annotatedMethod))
{
@@ -112,7 +112,7 @@
* @return A set of non-binding types, or an empty set if there are none
* present
*/
- public Set<WBMethod<?, ?>> getNonBindingTypes()
+ public Set<WeldMethod<?, ?>> getNonBindingTypes()
{
return nonBindingTypes;
}
@@ -136,7 +136,7 @@
{
if (instance.annotationType().equals(getRawType()) &&
other.annotationType().equals(getRawType()))
{
- for (WBMethod<?, ?> annotatedMethod :
getAnnotatedAnnotation().getMembers())
+ for (WeldMethod<?, ?> annotatedMethod :
getAnnotatedAnnotation().getMembers())
{
if (!nonBindingTypes.contains(annotatedMethod))
{
Modified:
ri/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/InterceptorBindingModel.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/InterceptorBindingModel.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/metadata/cache/InterceptorBindingModel.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -17,7 +17,7 @@
package org.jboss.weld.metadata.cache;
-import org.jboss.weld.introspector.WBMethod;
+import org.jboss.weld.introspector.WeldMethod;
import org.jboss.weld.log.Log;
import org.jboss.weld.log.Logging;
import org.jboss.weld.resources.ClassTransformer;
@@ -36,7 +36,7 @@
{
private static final Set<Class<? extends Annotation>> META_ANNOTATIONS =
Arrays2.<Class<? extends Annotation>>asSet(InterceptorBinding.class);
private static final Log log = Logging.getLog(BindingTypeModel.class);
- private Set<WBMethod<?,?>> nonBindingTypes;
+ private Set<WeldMethod<?,?>> nonBindingTypes;
private Set<Annotation> inheritedInterceptionBindingTypes;
private Set<Annotation> metaAnnotations;
@@ -77,7 +77,7 @@
{
if (instance.annotationType().equals(getRawType()) &&
other.annotationType().equals(getRawType()))
{
- for (WBMethod<?, ?> annotatedMethod :
getAnnotatedAnnotation().getMembers())
+ for (WeldMethod<?, ?> annotatedMethod :
getAnnotatedAnnotation().getMembers())
{
if (!nonBindingTypes.contains(annotatedMethod))
{
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableFactory.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableFactory.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableFactory.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -26,7 +26,7 @@
import java.util.Collections;
import org.jboss.weld.bean.AbstractClassBean;
-import org.jboss.weld.introspector.WBAnnotated;
+import org.jboss.weld.introspector.WeldAnnotated;
import org.jboss.weld.literal.DefaultLiteral;
import org.jboss.weld.util.Reflections;
@@ -35,7 +35,7 @@
public class ResolvableFactory
{
- public static Resolvable of(WBAnnotated<?, ?> element)
+ public static Resolvable of(WeldAnnotated<?, ?> element)
{
if (element instanceof Resolvable)
{
Deleted: ri/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableWBClass.java
===================================================================
---
ri/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableWBClass.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableWBClass.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,228 +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.weld.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.weld.BeanManagerImpl;
-import org.jboss.weld.bean.AbstractClassBean;
-import org.jboss.weld.injection.WBInjectionPoint;
-import org.jboss.weld.introspector.AnnotationStore;
-import org.jboss.weld.introspector.WBAnnotated;
-import org.jboss.weld.introspector.jlr.AbstractWBAnnotated;
-import org.jboss.weld.metadata.TypeStore;
-import org.jboss.weld.util.Names;
-import org.jboss.weld.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> 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);
- }
-
- 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.typeClosure = new HashSet<Type>();
- typeClosure.add(type);
- }
-
- private ResolvableWBClass(Type type, Annotation[] annotations, BeanManagerImpl
manager)
- {
- this(type, AnnotationStore.of(annotations, EMPTY_ANNOTATION_ARRAY,
manager.getServices().get(TypeStore.class)), manager);
- }
-
- private ResolvableWBClass(Type type, Set<Annotation>annotations, BeanManagerImpl
manager)
- {
- this(type, AnnotationStore.of(annotations, EMPTY_ANNOTATION_SET,
manager.getServices().get(TypeStore.class)), 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> getJavaClass()
- {
- return rawType;
- }
-
- public boolean isFinal()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isPublic()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isPrivate()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isPackagePrivate()
- {
- throw new UnsupportedOperationException();
- }
-
- public Package getPackage()
- {
- throw new UnsupportedOperationException();
- }
-
- public boolean isStatic()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public boolean isProxyable()
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Set<Type> getTypeClosure()
- {
- return typeClosure;
- }
-
- public AbstractClassBean<?> getDeclaringBean()
- {
- return null;
- }
-
- @Override
- public Type getBaseType()
- {
- return getJavaClass();
- }
-
- public boolean isAssignableTo(Class<?> clazz)
- {
- return Reflections.isAssignableFrom(clazz, getBaseType());
- }
-
-}
\ No newline at end of file
Copied: ri/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableWeldClass.java
(from rev 3879,
ri/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableWBClass.java)
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableWeldClass.java
(rev 0)
+++
ri/trunk/impl/src/main/java/org/jboss/weld/resolution/ResolvableWeldClass.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,228 @@
+/*
+ * 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.weld.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.weld.BeanManagerImpl;
+import org.jboss.weld.bean.AbstractClassBean;
+import org.jboss.weld.injection.WeldInjectionPoint;
+import org.jboss.weld.introspector.AnnotationStore;
+import org.jboss.weld.introspector.WeldAnnotated;
+import org.jboss.weld.introspector.jlr.AbstractWeldAnnotated;
+import org.jboss.weld.metadata.TypeStore;
+import org.jboss.weld.util.Names;
+import org.jboss.weld.util.Reflections;
+
+public class ResolvableWeldClass<T> extends AbstractWeldAnnotated<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> typeClosure;
+ private final Type[] actualTypeArguments;
+
+ private final String _string;
+
+ private final BeanManagerImpl manager;
+
+ public static <T> WeldAnnotated<T, Class<T>> of(TypeLiteral<T>
typeLiteral, Annotation[] annotations, BeanManagerImpl manager)
+ {
+ return new ResolvableWeldClass<T>(typeLiteral.getType(), annotations,
manager);
+ }
+
+ public static <T> WeldAnnotated<T, Class<T>> of(Type type,
Annotation[] annotations, BeanManagerImpl manager)
+ {
+ return new ResolvableWeldClass<T>(type, annotations, manager);
+ }
+
+ public static <T> WeldAnnotated<T, Class<T>> of(InjectionPoint
injectionPoint, BeanManagerImpl manager)
+ {
+ if (injectionPoint instanceof WeldInjectionPoint)
+ {
+ @SuppressWarnings("unchecked")
+ WeldAnnotated<T, Class<T>> ip = (WeldAnnotated<T,
Class<T>>) injectionPoint;
+ return ip;
+ }
+ else
+ {
+ return new ResolvableWeldClass<T>(injectionPoint.getType(),
injectionPoint.getAnnotated().getAnnotations(), manager);
+ }
+ }
+
+ public static <T> WeldAnnotated<T, Class<T>> of(Member member,
Annotation[] annotations, BeanManagerImpl manager)
+ {
+ if (member instanceof Field)
+ {
+ return new ResolvableWeldClass<T>(((Field) member).getGenericType(),
annotations, manager);
+ }
+ else if (member instanceof Method)
+ {
+ return new ResolvableWeldClass<T>(((Method)
member).getGenericReturnType(), annotations, manager);
+ }
+ else
+ {
+ throw new IllegalStateException();
+ }
+ }
+
+ private ResolvableWeldClass(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.typeClosure = new HashSet<Type>();
+ typeClosure.add(type);
+ }
+
+ private ResolvableWeldClass(Type type, Annotation[] annotations, BeanManagerImpl
manager)
+ {
+ this(type, AnnotationStore.of(annotations, EMPTY_ANNOTATION_ARRAY,
manager.getServices().get(TypeStore.class)), manager);
+ }
+
+ private ResolvableWeldClass(Type type, Set<Annotation>annotations,
BeanManagerImpl manager)
+ {
+ this(type, AnnotationStore.of(annotations, EMPTY_ANNOTATION_SET,
manager.getServices().get(TypeStore.class)), 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> getJavaClass()
+ {
+ return rawType;
+ }
+
+ public boolean isFinal()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isPublic()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isPrivate()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isPackagePrivate()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Package getPackage()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isStatic()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isProxyable()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public Set<Type> getTypeClosure()
+ {
+ return typeClosure;
+ }
+
+ public AbstractClassBean<?> getDeclaringBean()
+ {
+ return null;
+ }
+
+ @Override
+ public Type getBaseType()
+ {
+ return getJavaClass();
+ }
+
+ public boolean isAssignableTo(Class<?> clazz)
+ {
+ return Reflections.isAssignableFrom(clazz, getBaseType());
+ }
+
+}
\ No newline at end of file
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/resources/ClassTransformer.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/resources/ClassTransformer.java 2009-10-08
06:11:18 UTC (rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/resources/ClassTransformer.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -22,19 +22,19 @@
import javax.enterprise.inject.spi.AnnotatedType;
import org.jboss.weld.bootstrap.api.Service;
-import org.jboss.weld.introspector.WBAnnotation;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.jlr.WBAnnotationImpl;
-import org.jboss.weld.introspector.jlr.WBClassImpl;
+import org.jboss.weld.introspector.WeldAnnotation;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.jlr.WeldAnnotationImpl;
+import org.jboss.weld.introspector.jlr.WeldClassImpl;
import org.jboss.weld.metadata.TypeStore;
import org.jboss.weld.util.collections.ConcurrentCache;
public class ClassTransformer implements Service
{
- private final ConcurrentCache<Class<?>, WBClass<?>> classes;
- private final ConcurrentCache<AnnotatedType<?>, WBClass<?>>
annotatedTypes;
- private final ConcurrentCache<Class<?>, WBAnnotation<?>>
annotations;
+ private final ConcurrentCache<Class<?>, WeldClass<?>> classes;
+ private final ConcurrentCache<AnnotatedType<?>, WeldClass<?>>
annotatedTypes;
+ private final ConcurrentCache<Class<?>, WeldAnnotation<?>>
annotations;
private final ClassTransformer transformer = this;
private final TypeStore typeStore;
@@ -43,45 +43,45 @@
*/
public ClassTransformer(TypeStore typeStore)
{
- classes = new ConcurrentCache<Class<?>, WBClass<?>>();
- this.annotatedTypes = new ConcurrentCache<AnnotatedType<?>,
WBClass<?>>();
- annotations = new ConcurrentCache<Class<?>, WBAnnotation<?>>();
+ classes = new ConcurrentCache<Class<?>, WeldClass<?>>();
+ this.annotatedTypes = new ConcurrentCache<AnnotatedType<?>,
WeldClass<?>>();
+ annotations = new ConcurrentCache<Class<?>,
WeldAnnotation<?>>();
this.typeStore = typeStore;
}
- public <T> WBClass<T> loadClass(final Class<T> clazz)
+ public <T> WeldClass<T> loadClass(final Class<T> clazz)
{
- return classes.putIfAbsent(clazz, new Callable<WBClass<T>>()
+ return classes.putIfAbsent(clazz, new Callable<WeldClass<T>>()
{
- public WBClass<T> call() throws Exception
+ public WeldClass<T> call() throws Exception
{
- return WBClassImpl.of(clazz, transformer);
+ return WeldClassImpl.of(clazz, transformer);
}
});
}
- public <T> WBClass<T> loadClass(final AnnotatedType<T> clazz)
+ public <T> WeldClass<T> loadClass(final AnnotatedType<T> clazz)
{
- return annotatedTypes.putIfAbsent(clazz, new Callable<WBClass<T>>()
+ return annotatedTypes.putIfAbsent(clazz, new Callable<WeldClass<T>>()
{
- public WBClass<T> call() throws Exception
+ public WeldClass<T> call() throws Exception
{
- return WBClassImpl.of(clazz, transformer);
+ return WeldClassImpl.of(clazz, transformer);
}
});
}
- public <T extends Annotation> WBAnnotation<T> loadAnnotation(final
Class<T> clazz)
+ public <T extends Annotation> WeldAnnotation<T> loadAnnotation(final
Class<T> clazz)
{
- return annotations.putIfAbsent(clazz, new Callable<WBAnnotation<T>>()
+ return annotations.putIfAbsent(clazz, new
Callable<WeldAnnotation<T>>()
{
- public WBAnnotation<T> call() throws Exception
+ public WeldAnnotation<T> call() throws Exception
{
- return WBAnnotationImpl.of(clazz, transformer);
+ return WeldAnnotationImpl.of(clazz, transformer);
}
});
Modified: ri/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java
===================================================================
--- ri/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java 2009-10-08 06:11:18 UTC
(rev 3894)
+++ ri/trunk/impl/src/main/java/org/jboss/weld/util/Beans.java 2009-10-08 06:32:51 UTC
(rev 3895)
@@ -55,7 +55,7 @@
import org.jboss.weld.injection.FieldInjectionPoint;
import org.jboss.weld.injection.MethodInjectionPoint;
import org.jboss.weld.injection.ParameterInjectionPoint;
-import org.jboss.weld.injection.WBInjectionPoint;
+import org.jboss.weld.injection.WeldInjectionPoint;
import org.jboss.weld.injection.spi.EjbInjectionServices;
import org.jboss.weld.injection.spi.JpaInjectionServices;
import org.jboss.weld.injection.spi.ResourceInjectionServices;
@@ -144,29 +144,29 @@
}
}
- public static List<Set<FieldInjectionPoint<?, ?>>>
getFieldInjectionPoints(Bean<?> declaringBean, WBClass<?> type)
+ public static List<Set<FieldInjectionPoint<?, ?>>>
getFieldInjectionPoints(Bean<?> declaringBean, WeldClass<?> type)
{
List<Set<FieldInjectionPoint<?, ?>>> injectableFieldsList = new
ArrayList<Set<FieldInjectionPoint<?, ?>>>();
- WBClass<?> t = type;
+ WeldClass<?> t = type;
while (!t.getJavaClass().equals(Object.class))
{
Set<FieldInjectionPoint<?, ?>> fields = new
HashSet<FieldInjectionPoint<?,?>>();
injectableFieldsList.add(0, fields);
- for (WBField<?, ?> annotatedField :
t.getDeclaredAnnotatedWBFields(Inject.class))
+ for (WeldField<?, ?> annotatedField :
t.getDeclaredAnnotatedWeldFields(Inject.class))
{
if (!annotatedField.isStatic())
{
addFieldInjectionPoint(annotatedField, fields, declaringBean);
}
}
- for (WBField<?, ?> annotatedField :
t.getAnnotatedWBFields(Decorates.class))
+ for (WeldField<?, ?> annotatedField :
t.getAnnotatedWeldFields(Decorates.class))
{
if (!annotatedField.isStatic())
{
addFieldInjectionPoint(annotatedField, fields, declaringBean);
}
}
- t = t.getWBSuperclass();
+ t = t.getWeldSuperclass();
}
return injectableFieldsList;
}
@@ -181,9 +181,9 @@
return injectionPoints;
}
- public static WBMethod<?, ?> getPostConstruct(WBClass<?> type)
+ public static WeldMethod<?, ?> getPostConstruct(WeldClass<?> type)
{
- Set<WBMethod<?, ?>> postConstructMethods =
type.getAnnotatedWBMethods(PostConstruct.class);
+ Set<WeldMethod<?, ?>> postConstructMethods =
type.getAnnotatedWeldMethods(PostConstruct.class);
log.trace("Found " + postConstructMethods + " constructors annotated
with @Initializer for " + type);
if (postConstructMethods.size() > 1)
{
@@ -191,7 +191,7 @@
}
else if (postConstructMethods.size() == 1)
{
- WBMethod<?, ?> postConstruct = postConstructMethods.iterator().next();
+ WeldMethod<?, ?> postConstruct = postConstructMethods.iterator().next();
log.trace("Exactly one post construct method (" + postConstruct +
") for " + type);
return postConstruct;
}
@@ -201,9 +201,9 @@
}
}
- public static WBMethod<?, ?> getPreDestroy(WBClass<?> type)
+ public static WeldMethod<?, ?> getPreDestroy(WeldClass<?> type)
{
- Set<WBMethod<?, ?>> preDestroyMethods =
type.getAnnotatedWBMethods(PreDestroy.class);
+ Set<WeldMethod<?, ?>> preDestroyMethods =
type.getAnnotatedWeldMethods(PreDestroy.class);
log.trace("Found " + preDestroyMethods + " constructors annotated
with @Initializer for " + type);
if (preDestroyMethods.size() > 1)
{
@@ -213,7 +213,7 @@
}
else if (preDestroyMethods.size() == 1)
{
- WBMethod<?, ?> preDestroy = preDestroyMethods.iterator().next();
+ WeldMethod<?, ?> preDestroy = preDestroyMethods.iterator().next();
log.trace("Exactly one post construct method (" + preDestroy + ")
for " + type);
return preDestroy;
}
@@ -223,12 +223,12 @@
}
}
- public static List<WBMethod<?,?>>
getInterceptableBusinessMethods(WBClass<?> type)
+ public static List<WeldMethod<?,?>>
getInterceptableBusinessMethods(WeldClass<?> type)
{
- List<WBMethod<?, ?>> annotatedMethods = new ArrayList<WBMethod<?,
?>>();
- for (WBMethod<?, ?> annotatedMethod : type.getWBMethods())
+ List<WeldMethod<?, ?>> annotatedMethods = new
ArrayList<WeldMethod<?, ?>>();
+ for (WeldMethod<?, ?> annotatedMethod : type.getWeldMethods())
{
- int modifiers = ((WBMember) annotatedMethod).getJavaMember().getModifiers();
+ int modifiers = ((WeldMember) annotatedMethod).getJavaMember().getModifiers();
boolean businessMethod = !annotatedMethod.isStatic()
&& (Modifier.isPublic(modifiers)
|| Modifier.isProtected(modifiers))
@@ -253,13 +253,13 @@
}
- public static Set<WBInjectionPoint<?, ?>>
getEjbInjectionPoints(Bean<?> declaringBean, WBClass<?> type, BeanManagerImpl
manager)
+ public static Set<WeldInjectionPoint<?, ?>>
getEjbInjectionPoints(Bean<?> declaringBean, WeldClass<?> type,
BeanManagerImpl manager)
{
if (manager.getServices().contains(EjbInjectionServices.class))
{
Class<? extends Annotation> ejbAnnotationType =
manager.getServices().get(EJBApiAbstraction.class).EJB_ANNOTATION_CLASS;
- Set<WBInjectionPoint<?, ?>> ejbInjectionPoints = new
HashSet<WBInjectionPoint<?, ?>>();
- for (WBField<?, ?> field : type.getAnnotatedWBFields(ejbAnnotationType))
+ Set<WeldInjectionPoint<?, ?>> ejbInjectionPoints = new
HashSet<WeldInjectionPoint<?, ?>>();
+ for (WeldField<?, ?> field :
type.getAnnotatedWeldFields(ejbAnnotationType))
{
ejbInjectionPoints.add(FieldInjectionPoint.of(declaringBean, field));
}
@@ -271,13 +271,13 @@
}
}
- public static Set<WBInjectionPoint<?, ?>>
getPersistenceContextInjectionPoints(Bean<?> declaringBean, WBClass<?> type,
BeanManagerImpl manager)
+ public static Set<WeldInjectionPoint<?, ?>>
getPersistenceContextInjectionPoints(Bean<?> declaringBean, WeldClass<?> type,
BeanManagerImpl manager)
{
if (manager.getServices().contains(JpaInjectionServices.class))
{
- Set<WBInjectionPoint<?, ?>> jpaInjectionPoints = new
HashSet<WBInjectionPoint<?, ?>>();
+ Set<WeldInjectionPoint<?, ?>> jpaInjectionPoints = new
HashSet<WeldInjectionPoint<?, ?>>();
Class<? extends Annotation> persistenceContextAnnotationType =
manager.getServices().get(PersistenceApiAbstraction.class).PERSISTENCE_CONTEXT_ANNOTATION_CLASS;
- for (WBField<?, ?> field :
type.getAnnotatedWBFields(persistenceContextAnnotationType))
+ for (WeldField<?, ?> field :
type.getAnnotatedWeldFields(persistenceContextAnnotationType))
{
jpaInjectionPoints.add(FieldInjectionPoint.of(declaringBean, field));
}
@@ -289,13 +289,13 @@
}
}
- public static Set<WBInjectionPoint<?, ?>>
getPersistenceUnitInjectionPoints(Bean<?> declaringBean, WBClass<?> type,
BeanManagerImpl manager)
+ public static Set<WeldInjectionPoint<?, ?>>
getPersistenceUnitInjectionPoints(Bean<?> declaringBean, WeldClass<?> type,
BeanManagerImpl manager)
{
if (manager.getServices().contains(JpaInjectionServices.class))
{
- Set<WBInjectionPoint<?, ?>> jpaInjectionPoints = new
HashSet<WBInjectionPoint<?, ?>>();
+ Set<WeldInjectionPoint<?, ?>> jpaInjectionPoints = new
HashSet<WeldInjectionPoint<?, ?>>();
Class<? extends Annotation> persistenceUnitAnnotationType =
manager.getServices().get(PersistenceApiAbstraction.class).PERSISTENCE_UNIT_ANNOTATION_CLASS;
- for (WBField<?, ?> field :
type.getAnnotatedWBFields(persistenceUnitAnnotationType))
+ for (WeldField<?, ?> field :
type.getAnnotatedWeldFields(persistenceUnitAnnotationType))
{
jpaInjectionPoints.add(FieldInjectionPoint.of(declaringBean, field));
}
@@ -307,13 +307,13 @@
}
}
- public static Set<WBInjectionPoint<?, ?>>
getResourceInjectionPoints(Bean<?> declaringBean, WBClass<?> type,
BeanManagerImpl manager)
+ public static Set<WeldInjectionPoint<?, ?>>
getResourceInjectionPoints(Bean<?> declaringBean, WeldClass<?> type,
BeanManagerImpl manager)
{
if (manager.getServices().contains(ResourceInjectionServices.class))
{
Class<? extends Annotation> resourceAnnotationType =
manager.getServices().get(EJBApiAbstraction.class).RESOURCE_ANNOTATION_CLASS;
- Set<WBInjectionPoint<?, ?>> resourceInjectionPoints = new
HashSet<WBInjectionPoint<?, ?>>();
- for (WBField<?, ?> field :
type.getAnnotatedWBFields(resourceAnnotationType))
+ Set<WeldInjectionPoint<?, ?>> resourceInjectionPoints = new
HashSet<WeldInjectionPoint<?, ?>>();
+ for (WeldField<?, ?> field :
type.getAnnotatedWeldFields(resourceAnnotationType))
{
resourceInjectionPoints.add(FieldInjectionPoint.of(declaringBean, field));
}
@@ -325,7 +325,7 @@
}
}
- public static List<Set<MethodInjectionPoint<?, ?>>>
getInitializerMethods(Bean<?> declaringBean, WBClass<?> type)
+ public static List<Set<MethodInjectionPoint<?, ?>>>
getInitializerMethods(Bean<?> declaringBean, WeldClass<?> type)
{
List<Set<MethodInjectionPoint<?, ?>>> initializerMethodsList =
new ArrayList<Set<MethodInjectionPoint<?, ?>>>();
// Keep track of all seen methods so we can ignore overridden methods
@@ -338,12 +338,12 @@
}
});
- WBClass<?> t = type;
+ WeldClass<?> t = type;
while (!t.getJavaClass().equals(Object.class))
{
Set<MethodInjectionPoint<?, ?>> initializerMethods = new
HashSet<MethodInjectionPoint<?,?>>();
initializerMethodsList.add(0, initializerMethods);
- for (WBMethod<?, ?> method : t.getDeclaredWBMethods())
+ for (WeldMethod<?, ?> method : t.getDeclaredWeldMethods())
{
if (method.isAnnotationPresent(Inject.class) && !method.isStatic())
{
@@ -370,12 +370,12 @@
}
seenMethods.put(method.getSignature(), method.getPackage());
}
- t = t.getWBSuperclass();
+ t = t.getWeldSuperclass();
}
return initializerMethodsList;
}
- private static boolean isOverridden(WBMethod<?, ?> method,
Multimap<MethodSignature, Package> seenMethods)
+ private static boolean isOverridden(WeldMethod<?, ?> method,
Multimap<MethodSignature, Package> seenMethods)
{
if (method.isPrivate())
{
@@ -391,10 +391,10 @@
}
}
- public static Set<ParameterInjectionPoint<?, ?>>
getParameterInjectionPoints(Bean<?> declaringBean, WBConstructor<?>
constructor)
+ public static Set<ParameterInjectionPoint<?, ?>>
getParameterInjectionPoints(Bean<?> declaringBean, WeldConstructor<?>
constructor)
{
Set<ParameterInjectionPoint<?,?>> injectionPoints = new
HashSet<ParameterInjectionPoint<?,?>>();
- for (WBParameter<?, ?> parameter : constructor.getWBParameters())
+ for (WeldParameter<?, ?> parameter : constructor.getWBParameters())
{
injectionPoints.add(ParameterInjectionPoint.of(declaringBean, parameter));
}
@@ -408,7 +408,7 @@
{
for (MethodInjectionPoint<?, ?> method : i)
{
- for (WBParameter<?, ?> parameter : method.getWBParameters())
+ for (WeldParameter<?, ?> parameter : method.getWBParameters())
{
injectionPoints.add(ParameterInjectionPoint.of(declaringBean,
parameter));
}
@@ -417,7 +417,7 @@
return injectionPoints;
}
- private static void addFieldInjectionPoint(WBField<?, ?> annotatedField,
Set<FieldInjectionPoint<?, ?>> injectableFields, Bean<?> declaringBean)
+ private static void addFieldInjectionPoint(WeldField<?, ?> annotatedField,
Set<FieldInjectionPoint<?, ?>> injectableFields, Bean<?> declaringBean)
{
if (!annotatedField.isAnnotationPresent(Produces.class))
{
@@ -576,10 +576,10 @@
return false;
}
- public static <T> ConstructorInjectionPoint<T>
getBeanConstructor(Bean<?> declaringBean, WBClass<T> type)
+ public static <T> ConstructorInjectionPoint<T>
getBeanConstructor(Bean<?> declaringBean, WeldClass<T> type)
{
ConstructorInjectionPoint<T> constructor = null;
- Set<WBConstructor<T>> initializerAnnotatedConstructors =
type.getAnnotatedWBConstructors(Inject.class);
+ Set<WeldConstructor<T>> initializerAnnotatedConstructors =
type.getAnnotatedWeldConstructors(Inject.class);
log.trace("Found " + initializerAnnotatedConstructors + "
constructors annotated with @Initializer for " + type);
if (initializerAnnotatedConstructors.size() > 1)
{
@@ -593,10 +593,10 @@
constructor = ConstructorInjectionPoint.of(declaringBean,
initializerAnnotatedConstructors.iterator().next());
log.trace("Exactly one constructor (" + constructor + ")
annotated with @Initializer defined, using it as the bean constructor for " + type);
}
- else if (type.getNoArgsWBConstructor() != null)
+ else if (type.getNoArgsWeldConstructor() != null)
{
- constructor = ConstructorInjectionPoint.of(declaringBean,
type.getNoArgsWBConstructor());
+ constructor = ConstructorInjectionPoint.of(declaringBean,
type.getNoArgsWeldConstructor());
log.trace("Exactly one constructor (" + constructor + ") defined,
using it as the bean constructor for " + type);
}
@@ -613,7 +613,7 @@
/**
* Injects EJBs and common fields
*/
- public static <T> void injectEEFields(T beanInstance, BeanManagerImpl manager,
Iterable<WBInjectionPoint<?, ?>> ejbInjectionPoints,
Iterable<WBInjectionPoint<?, ?>> persistenceContextInjectionPoints,
Iterable<WBInjectionPoint<?, ?>> persistenceUnitInjectionPoints,
Iterable<WBInjectionPoint<?, ?>> resourceInjectionPoints)
+ public static <T> void injectEEFields(T beanInstance, BeanManagerImpl manager,
Iterable<WeldInjectionPoint<?, ?>> ejbInjectionPoints,
Iterable<WeldInjectionPoint<?, ?>> persistenceContextInjectionPoints,
Iterable<WeldInjectionPoint<?, ?>> persistenceUnitInjectionPoints,
Iterable<WeldInjectionPoint<?, ?>> resourceInjectionPoints)
{
EjbInjectionServices ejbServices =
manager.getServices().get(EjbInjectionServices.class);
JpaInjectionServices jpaServices =
manager.getServices().get(JpaInjectionServices.class);
@@ -621,7 +621,7 @@
if (ejbServices != null)
{
- for (WBInjectionPoint<?, ?> injectionPoint : ejbInjectionPoints)
+ for (WeldInjectionPoint<?, ?> injectionPoint : ejbInjectionPoints)
{
Object ejbInstance = ejbServices.resolveEjb(injectionPoint);
injectionPoint.inject(beanInstance, ejbInstance);
@@ -630,12 +630,12 @@
if (jpaServices != null)
{
- for (WBInjectionPoint<?, ?> injectionPoint :
persistenceContextInjectionPoints)
+ for (WeldInjectionPoint<?, ?> injectionPoint :
persistenceContextInjectionPoints)
{
Object pcInstance = jpaServices.resolvePersistenceContext(injectionPoint);
injectionPoint.inject(beanInstance, pcInstance);
}
- for (WBInjectionPoint<?, ?> injectionPoint :
persistenceUnitInjectionPoints)
+ for (WeldInjectionPoint<?, ?> injectionPoint :
persistenceUnitInjectionPoints)
{
Object puInstance = jpaServices.resolvePersistenceUnit(injectionPoint);
injectionPoint.inject(beanInstance, puInstance);
@@ -644,7 +644,7 @@
if (resourceServices != null)
{
- for (WBInjectionPoint<?, ?> injectionPoint : resourceInjectionPoints)
+ for (WeldInjectionPoint<?, ?> injectionPoint : resourceInjectionPoints)
{
Object resourceInstance = resourceServices.resolveResource(injectionPoint);
injectionPoint.inject(beanInstance, resourceInstance);
@@ -711,12 +711,12 @@
}
}
- public static <T> boolean isInterceptor(WBClass<T> annotatedItem)
+ public static <T> boolean isInterceptor(WeldClass<T> annotatedItem)
{
return annotatedItem.isAnnotationPresent(javax.interceptor.Interceptor.class);
}
- public static <T> boolean isDecorator(WBClass<T> annotatedItem)
+ public static <T> boolean isDecorator(WeldClass<T> annotatedItem)
{
return annotatedItem.isAnnotationPresent(Decorator.class);
}
Deleted:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/WBStartupTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/WBStartupTest.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/WBStartupTest.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,53 +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.weld.test.unit.bootstrap;
-
-import java.util.Arrays;
-
-import javax.enterprise.inject.spi.Bean;
-import javax.enterprise.inject.spi.BeanManager;
-
-import org.jboss.weld.mock.MockEELifecycle;
-import org.jboss.weld.mock.TestContainer;
-import org.testng.annotations.Test;
-
-/**
- * @author pmuir
- *
- */
-public class WBStartupTest
-{
-
- @Test
- public void test()
- {
- TestContainer container = new TestContainer(new MockEELifecycle(),
Arrays.asList(Foo.class, Bar.class), null);
- container.startContainer();
- container.ensureRequestActive();
-
- BeanManager manager = container.getBeanManager();
-
- Bean<? extends Object> bean = manager.resolve(manager.getBeans(Foo.class));
- Foo foo = (Foo) manager.getReference(bean, Foo.class,
manager.createCreationalContext(bean));
-
- assert foo != null;
- assert foo.getBar() != null;
-
- container.stopContainer();
- }
-
-}
Copied:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/WeldStartupTest.java (from
rev 3883,
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/WBStartupTest.java)
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/WeldStartupTest.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/bootstrap/WeldStartupTest.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,53 @@
+/*
+ * 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.weld.test.unit.bootstrap;
+
+import java.util.Arrays;
+
+import javax.enterprise.inject.spi.Bean;
+import javax.enterprise.inject.spi.BeanManager;
+
+import org.jboss.weld.mock.MockEELifecycle;
+import org.jboss.weld.mock.TestContainer;
+import org.testng.annotations.Test;
+
+/**
+ * @author pmuir
+ *
+ */
+public class WeldStartupTest
+{
+
+ @Test
+ public void test()
+ {
+ TestContainer container = new TestContainer(new MockEELifecycle(),
Arrays.asList(Foo.class, Bar.class), null);
+ container.startContainer();
+ container.ensureRequestActive();
+
+ BeanManager manager = container.getBeanManager();
+
+ Bean<? extends Object> bean = manager.resolve(manager.getBeans(Foo.class));
+ Foo foo = (Foo) manager.getReference(bean, Foo.class,
manager.createCreationalContext(bean));
+
+ assert foo != null;
+ assert foo.getBar() != null;
+
+ container.stopContainer();
+ }
+
+}
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/deployment/structure/AccessibleManagerResolutionTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/deployment/structure/AccessibleManagerResolutionTest.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/deployment/structure/AccessibleManagerResolutionTest.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -12,8 +12,8 @@
import org.jboss.weld.bootstrap.api.ServiceRegistry;
import org.jboss.weld.bootstrap.api.helpers.SimpleServiceRegistry;
import org.jboss.weld.ejb.EjbDescriptors;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.jlr.WBClassImpl;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.jlr.WeldClassImpl;
import org.jboss.weld.metadata.TypeStore;
import org.jboss.weld.metadata.cache.MetaAnnotationStore;
import org.jboss.weld.resources.ClassTransformer;
@@ -37,7 +37,7 @@
private void addBean(BeanManagerImpl manager, Class<?> c)
{
- WBClass<?> clazz = WBClassImpl.of(c, classTransformer);
+ WeldClass<?> clazz = WeldClassImpl.of(c, classTransformer);
RIBean<?> bean = ManagedBean.of(clazz, manager);
manager.addBean(bean);
BeanDeployerEnvironment environment = new BeanDeployerEnvironment(new
EjbDescriptors(), manager);
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/NewEnterpriseBeanTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/NewEnterpriseBeanTest.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/NewEnterpriseBeanTest.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -10,7 +10,7 @@
import org.jboss.testharness.impl.packaging.PackagingType;
import org.jboss.weld.bean.NewSessionBean;
import org.jboss.weld.bean.SessionBean;
-import org.jboss.weld.introspector.WBAnnotated;
+import org.jboss.weld.introspector.WeldAnnotated;
import org.jboss.weld.literal.NewLiteral;
import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@@ -64,8 +64,8 @@
public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
{
initNewBean();
- Set<? extends WBAnnotated<?, ?>> wrappedBeanInjectionPoints =
wrappedEnterpriseBean.getAnnotatedInjectionPoints();
- Set<? extends WBAnnotated<?, ?>> newBeanInjectionPoints =
newEnterpriseBean.getAnnotatedInjectionPoints();
+ Set<? extends WeldAnnotated<?, ?>> wrappedBeanInjectionPoints =
wrappedEnterpriseBean.getAnnotatedInjectionPoints();
+ Set<? extends WeldAnnotated<?, ?>> newBeanInjectionPoints =
newEnterpriseBean.getAnnotatedInjectionPoints();
assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
}
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/annotatedItem/ClassAnnotatedItemTest.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -8,8 +8,8 @@
import javax.inject.Qualifier;
import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.introspector.WBClass;
-import org.jboss.weld.introspector.jlr.WBClassImpl;
+import org.jboss.weld.introspector.WeldClass;
+import org.jboss.weld.introspector.jlr.WeldClassImpl;
import org.jboss.weld.metadata.TypeStore;
import org.jboss.weld.resources.ClassTransformer;
import org.jboss.weld.test.AbstractWeldTest;
@@ -24,7 +24,7 @@
@Test
public void testDeclaredAnnotations()
{
- WBClass<Order> annotatedElement = WBClassImpl.of(Order.class, transformer);
+ WeldClass<Order> annotatedElement = WeldClassImpl.of(Order.class,
transformer);
assert annotatedElement.getAnnotations().size() == 1;
assert annotatedElement.getAnnotation(Random.class) != null;
assert annotatedElement.getJavaClass().equals(Order.class);
@@ -33,7 +33,7 @@
@Test
public void testMetaAnnotations()
{
- WBClass<Order> annotatedElement = WBClassImpl.of(Order.class, transformer);
+ WeldClass<Order> annotatedElement = WeldClassImpl.of(Order.class,
transformer);
Set<Annotation> annotations =
annotatedElement.getMetaAnnotations(Qualifier.class);
assert annotations.size() == 1;
Iterator<Annotation> it = annotations.iterator();
@@ -44,10 +44,10 @@
@Test
public void testEmpty()
{
- WBClass<Order> annotatedElement = WBClassImpl.of(Order.class, transformer);
+ WeldClass<Order> annotatedElement = WeldClassImpl.of(Order.class,
transformer);
assert annotatedElement.getAnnotation(Stereotype.class) == null;
assert annotatedElement.getMetaAnnotations(Stereotype.class).size() == 0;
- WBClass<Antelope> classWithNoAnnotations = WBClassImpl.of(Antelope.class,
transformer);
+ WeldClass<Antelope> classWithNoAnnotations = WeldClassImpl.of(Antelope.class,
transformer);
assert classWithNoAnnotations.getAnnotations().size() == 0;
}
Modified:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/newsimple/NewSimpleBeanTest.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/newsimple/NewSimpleBeanTest.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/implementation/newsimple/NewSimpleBeanTest.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -7,7 +7,7 @@
import org.jboss.testharness.impl.packaging.Artifact;
import org.jboss.weld.bean.ManagedBean;
import org.jboss.weld.bean.NewManagedBean;
-import org.jboss.weld.introspector.WBAnnotated;
+import org.jboss.weld.introspector.WeldAnnotated;
import org.jboss.weld.literal.NewLiteral;
import org.jboss.weld.test.AbstractWeldTest;
import org.testng.annotations.Test;
@@ -63,8 +63,8 @@
public void testNewBeanHasSameInjectedFieldsAsWrappedBean()
{
initNewBean();
- Set<? extends WBAnnotated<?, ?>> wrappedBeanInjectionPoints =
wrappedSimpleBean.getAnnotatedInjectionPoints();
- Set<? extends WBAnnotated<?, ?>> newBeanInjectionPoints =
newSimpleBean.getAnnotatedInjectionPoints();
+ Set<? extends WeldAnnotated<?, ?>> wrappedBeanInjectionPoints =
wrappedSimpleBean.getAnnotatedInjectionPoints();
+ Set<? extends WeldAnnotated<?, ?>> newBeanInjectionPoints =
newSimpleBean.getAnnotatedInjectionPoints();
assert wrappedBeanInjectionPoints.equals(newBeanInjectionPoints);
}
Deleted: ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/Wbri256Test.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/Wbri256Test.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/Wbri256Test.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,19 +0,0 @@
-package org.jboss.weld.test.unit.lookup;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWeldTest;
-import org.testng.annotations.Test;
-
-@Artifact
-public class Wbri256Test extends AbstractWeldTest
-{
-
- @Test
- public void testParameterizedInjection()
- {
- LookupFoo lookupFoo = getCurrentManager().getInstanceByType(LookupFoo.class);
- assert lookupFoo.getFoo().getName().equals("foo");
- assert lookupFoo.getFoobaz().getName().equals("foobase");
- }
-
-}
Copied: ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/Weld256Test.java
(from rev 3893,
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/Wbri256Test.java)
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/Weld256Test.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/Weld256Test.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,19 @@
+package org.jboss.weld.test.unit.lookup;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+@Artifact
+public class Weld256Test extends AbstractWeldTest
+{
+
+ @Test
+ public void testParameterizedInjection()
+ {
+ LookupFoo lookupFoo = getCurrentManager().getInstanceByType(LookupFoo.class);
+ assert lookupFoo.getFoo().getName().equals("foo");
+ assert lookupFoo.getFoobaz().getName().equals("foobase");
+ }
+
+}
Deleted:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri279/Wbri279Test.java
===================================================================
---
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri279/Wbri279Test.java 2009-10-08
06:11:18 UTC (rev 3894)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri279/Wbri279Test.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -1,37 +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.weld.test.unit.lookup.wbri279;
-
-import org.jboss.testharness.impl.packaging.Artifact;
-import org.jboss.weld.test.AbstractWeldTest;
-import org.testng.annotations.Test;
-
-/**
- * @author pmuir
- *
- */
-@Artifact
-public class Wbri279Test extends AbstractWeldTest
-{
-
- @Test(description="WBRI-279")
- public void testLookupOfGenericTypeSubclass()
- {
- assert
createContextualInstance(SomeBean.class).getObjectAsString().equals(IntegerFactory.VALUE.toString());
- }
-
-}
Copied:
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri279/Weld279Test.java
(from rev 3893,
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri279/Wbri279Test.java)
===================================================================
--- ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri279/Weld279Test.java
(rev 0)
+++
ri/trunk/tests/src/test/java/org/jboss/weld/test/unit/lookup/wbri279/Weld279Test.java 2009-10-08
06:32:51 UTC (rev 3895)
@@ -0,0 +1,37 @@
+/*
+ * 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.weld.test.unit.lookup.wbri279;
+
+import org.jboss.testharness.impl.packaging.Artifact;
+import org.jboss.weld.test.AbstractWeldTest;
+import org.testng.annotations.Test;
+
+/**
+ * @author pmuir
+ *
+ */
+@Artifact
+public class Weld279Test extends AbstractWeldTest
+{
+
+ @Test(description="WELD-279")
+ public void testLookupOfGenericTypeSubclass()
+ {
+ assert
createContextualInstance(SomeBean.class).getObjectAsString().equals(IntegerFactory.VALUE.toString());
+ }
+
+}