[weld-commits] Weld SVN: r6797 - extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic.
weld-commits at lists.jboss.org
weld-commits at lists.jboss.org
Sat Jul 24 09:05:27 EDT 2010
Author: pete.muir at jboss.org
Date: 2010-07-24 09:05:27 -0400 (Sat, 24 Jul 2010)
New Revision: 6797
Removed:
extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericBeanInjectionTargetWrapper.java
extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/InjectConfiguration.java
Log:
cleanup
Deleted: extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericBeanInjectionTargetWrapper.java
===================================================================
--- extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericBeanInjectionTargetWrapper.java 2010-07-24 13:02:56 UTC (rev 6796)
+++ extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/GenericBeanInjectionTargetWrapper.java 2010-07-24 13:05:27 UTC (rev 6797)
@@ -1,86 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., 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.extensions.bean.generic;
-
-import static org.jboss.weld.extensions.util.Reflections.getAllFields;
-import static org.jboss.weld.extensions.util.Reflections.getField;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.Field;
-
-import javax.enterprise.context.spi.CreationalContext;
-import javax.enterprise.inject.spi.AnnotatedField;
-import javax.enterprise.inject.spi.AnnotatedType;
-import javax.enterprise.inject.spi.InjectionTarget;
-
-import org.jboss.weld.extensions.bean.ForwardingInjectionTarget;
-
-/**
- * injection target wrapper that injects the configuration for generic beans
- *
- * @author Stuart Douglas <stuart at baileyroberts.com.au>
- *
- * @param <T>
- */
-public class GenericBeanInjectionTargetWrapper<T> extends ForwardingInjectionTarget<T>
-{
-
- private final InjectionTarget<T> delegate;
- private final Annotation annotation;
- private final AnnotatedType<T> annotatedType;
-
- public GenericBeanInjectionTargetWrapper(AnnotatedType<T> annotatedType, InjectionTarget<T> delegate, Annotation annotation)
- {
- this.annotation = annotation;
- this.delegate = delegate;
- this.annotatedType = annotatedType;
- }
-
- @Override
- protected InjectionTarget<T> delegate()
- {
- return delegate;
- }
-
- @Override
- public void inject(T instance, CreationalContext<T> ctx)
- {
- for (Field f : getAllFields(instance.getClass()))
- {
-
- if (annotation.annotationType().isAssignableFrom(f.getType()))
- {
- AnnotatedField<? super T> annotatedField = getField(annotatedType, f);
- if (annotatedField.isAnnotationPresent(InjectConfiguration.class))
- {
- try
- {
- f.setAccessible(true);
- f.set(instance, annotation);
- }
- catch (IllegalAccessException e)
- {
- throw new RuntimeException(e);
- }
- }
- }
- }
-
- delegate().inject(instance, ctx);
- }
-
-}
Deleted: extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/InjectConfiguration.java
===================================================================
--- extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/InjectConfiguration.java 2010-07-24 13:02:56 UTC (rev 6796)
+++ extensions/trunk/impl/src/main/java/org/jboss/weld/extensions/bean/generic/InjectConfiguration.java 2010-07-24 13:05:27 UTC (rev 6797)
@@ -1,43 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2010, Red Hat, Inc., 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.extensions.bean.generic;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-import javax.enterprise.util.AnnotationLiteral;
-
-/**
- * Annotation used to indicate {@link GenericConfiguration} injection points
- *
- * @author Stuart Douglas <stuart at baileyroberts.com.au>
- *
- */
- at Retention(RetentionPolicy.RUNTIME)
-public @interface InjectConfiguration
-{
-
- public static class InjectConfigurationLiteral extends AnnotationLiteral<InjectConfiguration> implements InjectConfiguration
- {
-
- private static final long serialVersionUID = 5365615929893138969L;
-
- }
-
- public static final InjectConfiguration INSTANCE = new InjectConfigurationLiteral();
-
-}
More information about the weld-commits
mailing list