[jboss-cvs] JBossAS SVN: r64343 - in projects/microcontainer/trunk/kernel/src: main/org/jboss/kernel/plugins/annotations and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Mon Jul 30 07:13:36 EDT 2007
Author: alesj
Date: 2007-07-30 07:13:36 -0400 (Mon, 30 Jul 2007)
New Revision: 64343
Added:
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ArrayValue.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/CollectionValue.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/EntryValue.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ListValue.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/MapValue.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Parameter.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/SetValue.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Value.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ArrayValueAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/CollectionValueAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/CollectionsAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ListValueAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/MapValueAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ParametersAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/SetValueAnnotationPlugin.java
Modified:
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Inject.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/NullValue.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ThisValue.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ValueFactory.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.java
projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ValueFactoryAnnotationPlugin.java
projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/annotations/support/SimpleInject.java
Log:
Collections @annotation support.
Initial checkin.
TODO tests + javadocs.
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ArrayValue.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ArrayValue.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ArrayValue.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.beans.metadata.plugins.annotations;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.METHOD, ElementType.PARAMETER})
+public @interface ArrayValue
+{
+ String clazz() default "";
+
+ String elementClass() default "";
+
+ Value[] value();
+}
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/CollectionValue.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/CollectionValue.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/CollectionValue.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.beans.metadata.plugins.annotations;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.METHOD, ElementType.PARAMETER})
+public @interface CollectionValue
+{
+ String clazz() default "";
+
+ String elementClass() default "";
+
+ Value[] value();
+}
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/EntryValue.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/EntryValue.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/EntryValue.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,39 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.beans.metadata.plugins.annotations;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.METHOD, ElementType.PARAMETER})
+public @interface EntryValue
+{
+ Value key();
+
+ Value value();
+}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Inject.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Inject.java 2007-07-30 10:00:34 UTC (rev 64342)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Inject.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -90,4 +90,12 @@
* @return from context type
*/
FromContext fromContext() default FromContext.NONE;
+
+ /**
+ * Is this @Inject valid.
+ * Used with @Value.
+ *
+ * @return is this instance valid
+ */
+ boolean valid() default true;
}
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ListValue.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ListValue.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ListValue.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.beans.metadata.plugins.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.METHOD, ElementType.PARAMETER})
+public @interface ListValue
+{
+ String clazz() default "";
+
+ String elementClass() default "";
+
+ Value[] value();
+}
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/MapValue.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/MapValue.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/MapValue.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.beans.metadata.plugins.annotations;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.METHOD, ElementType.PARAMETER})
+public @interface MapValue
+{
+ String clazz() default "";
+
+ String keyClass() default "";
+
+ String valueClass() default "";
+
+ EntryValue[] value();
+
+ String delimiter() default ",";
+}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/NullValue.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/NullValue.java 2007-07-30 10:00:34 UTC (rev 64342)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/NullValue.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -33,4 +33,5 @@
@Target({ElementType.METHOD, ElementType.PARAMETER})
public @interface NullValue
{
+ boolean valid() default true;
}
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Parameter.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Parameter.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Parameter.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,43 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.beans.metadata.plugins.annotations;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.ANNOTATION_TYPE})
+public @interface Parameter
+{
+ StringValue string() default @StringValue(value="");
+
+ Inject inject() default @Inject(valid=false);
+
+ ThisValue thisValue() default @ThisValue(valid = false);
+
+ NullValue nullValue() default @NullValue(valid = false);
+}
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/SetValue.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/SetValue.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/SetValue.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,41 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.beans.metadata.plugins.annotations;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.METHOD, ElementType.PARAMETER})
+public @interface SetValue
+{
+ String clazz() default "";
+
+ String elementClass() default "";
+
+ Value[] value();
+}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ThisValue.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ThisValue.java 2007-07-30 10:00:34 UTC (rev 64342)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ThisValue.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -33,4 +33,5 @@
@Target({ElementType.METHOD, ElementType.PARAMETER})
public @interface ThisValue
{
+ boolean valid() default true;
}
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Value.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Value.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/Value.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,45 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.beans.metadata.plugins.annotations;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.lang.annotation.ElementType;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+ at Retention(RetentionPolicy.RUNTIME)
+ at Target({ElementType.ANNOTATION_TYPE})
+public @interface Value
+{
+ StringValue string() default @StringValue(value="");
+
+ Inject inject() default @Inject(valid=false);
+
+ ValueFactory valueFactory() default @ValueFactory(bean = "", method = "");
+
+ ThisValue thisValue() default @ThisValue(valid = false);
+
+ NullValue nullValue() default @NullValue(valid = false);
+}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ValueFactory.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ValueFactory.java 2007-07-30 10:00:34 UTC (rev 64342)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/annotations/ValueFactory.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -37,8 +37,10 @@
String method();
- String parameter();
+ String parameter() default "";
+ Parameter[] parameters() default {};
+
String defaultValue() default "";
String dependantState() default "Installed";
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ArrayValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ArrayValueAnnotationPlugin.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ArrayValueAnnotationPlugin.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.kernel.plugins.annotations;
+
+import org.jboss.beans.metadata.plugins.AbstractArrayMetaData;
+import org.jboss.beans.metadata.plugins.annotations.ArrayValue;
+import org.jboss.beans.metadata.plugins.annotations.Value;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ArrayValueAnnotationPlugin extends CollectionsAnnotationPlugin<ArrayValue>
+{
+ static ArrayValueAnnotationPlugin INSTANCE = new ArrayValueAnnotationPlugin();
+
+ public ArrayValueAnnotationPlugin()
+ {
+ super(ArrayValue.class);
+ }
+
+ public ValueMetaData createValueMetaData(ArrayValue annotation)
+ {
+ AbstractArrayMetaData array = new AbstractArrayMetaData();
+ if (isAttributePresent(annotation.clazz()))
+ array.setType(annotation.clazz());
+ if (isAttributePresent(annotation.elementClass()))
+ array.setElementType(annotation.elementClass());
+ for(Value value : annotation.value())
+ array.add(createValueMetaData(value));
+ return array;
+ }
+}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.java 2007-07-30 10:00:34 UTC (rev 64342)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -68,6 +68,11 @@
ValueFactoryAnnotationPlugin.INSTANCE,
ThisValueAnnotationPlugin.INSTANCE,
NullValueAnnotationPlugin.INSTANCE,
+ CollectionValueAnnotationPlugin.INSTANCE,
+ ListValueAnnotationPlugin.INSTANCE,
+ SetValueAnnotationPlugin.INSTANCE,
+ ArrayValueAnnotationPlugin.INSTANCE,
+ MapValueAnnotationPlugin.INSTANCE,
};
// -- plugins
// class
@@ -83,6 +88,11 @@
addAnnotationPlugin(ValueFactoryAnnotationPlugin.INSTANCE);
addAnnotationPlugin(ThisValueAnnotationPlugin.INSTANCE);
addAnnotationPlugin(NullValueAnnotationPlugin.INSTANCE);
+ addAnnotationPlugin(CollectionValueAnnotationPlugin.INSTANCE);
+ addAnnotationPlugin(ListValueAnnotationPlugin.INSTANCE);
+ addAnnotationPlugin(SetValueAnnotationPlugin.INSTANCE);
+ addAnnotationPlugin(ArrayValueAnnotationPlugin.INSTANCE);
+ addAnnotationPlugin(MapValueAnnotationPlugin.INSTANCE);
addAnnotationPlugin(new PropertyInstallCallbackAnnotationPlugin());
addAnnotationPlugin(new PropertyUninstallCallbackAnnotationPlugin());
// method
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/CollectionValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/CollectionValueAnnotationPlugin.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/CollectionValueAnnotationPlugin.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.kernel.plugins.annotations;
+
+import org.jboss.beans.metadata.plugins.AbstractCollectionMetaData;
+import org.jboss.beans.metadata.plugins.annotations.CollectionValue;
+import org.jboss.beans.metadata.plugins.annotations.Value;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class CollectionValueAnnotationPlugin extends CollectionsAnnotationPlugin<CollectionValue>
+{
+ static CollectionValueAnnotationPlugin INSTANCE = new CollectionValueAnnotationPlugin();
+
+ public CollectionValueAnnotationPlugin()
+ {
+ super(CollectionValue.class);
+ }
+
+ public ValueMetaData createValueMetaData(CollectionValue annotation)
+ {
+ AbstractCollectionMetaData collection = new AbstractCollectionMetaData();
+ if (isAttributePresent(annotation.clazz()))
+ collection.setType(annotation.clazz());
+ if (isAttributePresent(annotation.elementClass()))
+ collection.setElementType(annotation.elementClass());
+ for(Value value : annotation.value())
+ collection.add(createValueMetaData(value));
+ return collection;
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/CollectionsAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/CollectionsAnnotationPlugin.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/CollectionsAnnotationPlugin.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,94 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.kernel.plugins.annotations;
+
+import java.lang.annotation.Annotation;
+
+import org.jboss.beans.metadata.spi.ValueMetaData;
+import org.jboss.beans.metadata.plugins.annotations.Value;
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+import org.jboss.beans.metadata.plugins.annotations.Inject;
+import org.jboss.beans.metadata.plugins.annotations.ValueFactory;
+import org.jboss.beans.metadata.plugins.annotations.NullValue;
+import org.jboss.beans.metadata.plugins.annotations.ThisValue;
+
+/**
+ * @param <C> annotation type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class CollectionsAnnotationPlugin<C extends Annotation> extends PropertyAnnotationPlugin<C>
+{
+ public CollectionsAnnotationPlugin(Class<C> annotation)
+ {
+ super(annotation);
+ }
+
+ protected ValueMetaData createValueMetaData(Value value)
+ {
+ ValueMetaData vmd = null;
+
+ StringValue string = value.string();
+ if (isAttributePresent(string.value()))
+ {
+ vmd = StringValueAnnotationPlugin.INSTANCE.createValueMetaData(string);
+ }
+
+ Inject inject = value.inject();
+ if (inject.valid())
+ {
+ checkValueMetaData(vmd);
+ vmd = InjectAnnotationPlugin.INSTANCE.createValueMetaData(inject);
+ }
+
+ ValueFactory vf = value.valueFactory();
+ if (isAttributePresent(vf.bean()))
+ {
+ checkValueMetaData(vmd);
+ vmd = ValueFactoryAnnotationPlugin.INSTANCE.createValueMetaData(vf);
+ }
+
+ ThisValue thisValue = value.thisValue();
+ if (thisValue.valid())
+ {
+ checkValueMetaData(vmd);
+ vmd = ThisValueAnnotationPlugin.INSTANCE.createValueMetaData(thisValue);
+ }
+
+ NullValue nullValue = value.nullValue();
+ if (nullValue.valid())
+ {
+ checkValueMetaData(vmd);
+ vmd = NullValueAnnotationPlugin.INSTANCE.createValueMetaData(nullValue);
+ }
+
+ if (vmd == null)
+ throw new IllegalArgumentException("No value set on @Value annotation!");
+
+ return vmd;
+ }
+
+ protected void checkValueMetaData(ValueMetaData value)
+ {
+ if (value != null)
+ throw new IllegalArgumentException("@Value annotation has too many values set!");
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ListValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ListValueAnnotationPlugin.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ListValueAnnotationPlugin.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.kernel.plugins.annotations;
+
+import org.jboss.beans.metadata.plugins.AbstractListMetaData;
+import org.jboss.beans.metadata.plugins.annotations.ListValue;
+import org.jboss.beans.metadata.plugins.annotations.Value;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ListValueAnnotationPlugin extends CollectionsAnnotationPlugin<ListValue>
+{
+ static ListValueAnnotationPlugin INSTANCE = new ListValueAnnotationPlugin();
+
+ public ListValueAnnotationPlugin()
+ {
+ super(ListValue.class);
+ }
+
+ public ValueMetaData createValueMetaData(ListValue annotation)
+ {
+ AbstractListMetaData list = new AbstractListMetaData();
+ if (isAttributePresent(annotation.clazz()))
+ list.setType(annotation.clazz());
+ if (isAttributePresent(annotation.elementClass()))
+ list.setElementType(annotation.elementClass());
+ for(Value value : annotation.value())
+ list.add(createValueMetaData(value));
+ return list;
+ }
+}
\ No newline at end of file
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/MapValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/MapValueAnnotationPlugin.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/MapValueAnnotationPlugin.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,56 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.kernel.plugins.annotations;
+
+import org.jboss.beans.metadata.plugins.AbstractMapMetaData;
+import org.jboss.beans.metadata.plugins.annotations.MapValue;
+import org.jboss.beans.metadata.plugins.annotations.EntryValue;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class MapValueAnnotationPlugin extends CollectionsAnnotationPlugin<MapValue>
+{
+ static MapValueAnnotationPlugin INSTANCE = new MapValueAnnotationPlugin();
+
+ public MapValueAnnotationPlugin()
+ {
+ super(MapValue.class);
+ }
+
+ public ValueMetaData createValueMetaData(MapValue annotation)
+ {
+ AbstractMapMetaData map = new AbstractMapMetaData();
+ if (isAttributePresent(annotation.clazz()))
+ map.setType(annotation.clazz());
+ if (isAttributePresent(annotation.keyClass()))
+ map.setKeyType(annotation.keyClass());
+ if (isAttributePresent(annotation.valueClass()))
+ map.setValueType(annotation.valueClass());
+ for(EntryValue entry : annotation.value())
+ {
+ map.put(createValueMetaData(entry.key()), createValueMetaData(entry.value()));
+ }
+ return map;
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ParametersAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ParametersAnnotationPlugin.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ParametersAnnotationPlugin.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,86 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.kernel.plugins.annotations;
+
+import java.lang.annotation.Annotation;
+
+import org.jboss.beans.metadata.plugins.annotations.Inject;
+import org.jboss.beans.metadata.plugins.annotations.NullValue;
+import org.jboss.beans.metadata.plugins.annotations.Parameter;
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+import org.jboss.beans.metadata.plugins.annotations.ThisValue;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * @param <C> annotation type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class ParametersAnnotationPlugin<C extends Annotation> extends PropertyAnnotationPlugin<C>
+{
+ public ParametersAnnotationPlugin(Class<C> annotation)
+ {
+ super(annotation);
+ }
+
+ protected ValueMetaData createValueMetaData(Parameter parameter)
+ {
+ ValueMetaData vmd = null;
+
+ StringValue string = parameter.string();
+ if (isAttributePresent(string.value()))
+ {
+ vmd = StringValueAnnotationPlugin.INSTANCE.createValueMetaData(string);
+ }
+
+ Inject inject = parameter.inject();
+ if (inject.valid())
+ {
+ checkValueMetaData(vmd);
+ vmd = InjectAnnotationPlugin.INSTANCE.createValueMetaData(inject);
+ }
+
+ ThisValue thisValue = parameter.thisValue();
+ if (thisValue.valid())
+ {
+ checkValueMetaData(vmd);
+ vmd = ThisValueAnnotationPlugin.INSTANCE.createValueMetaData(thisValue);
+ }
+
+ NullValue nullValue = parameter.nullValue();
+ if (nullValue.valid())
+ {
+ checkValueMetaData(vmd);
+ vmd = NullValueAnnotationPlugin.INSTANCE.createValueMetaData(nullValue);
+ }
+
+ if (vmd == null)
+ throw new IllegalArgumentException("No value set on @Value annotation!");
+
+ return vmd;
+ }
+
+ protected void checkValueMetaData(ValueMetaData value)
+ {
+ if (value != null)
+ throw new IllegalArgumentException("@Value annotation has too many values set!");
+ }
+}
Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/SetValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/SetValueAnnotationPlugin.java (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/SetValueAnnotationPlugin.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -0,0 +1,52 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.kernel.plugins.annotations;
+
+import org.jboss.beans.metadata.plugins.AbstractSetMetaData;
+import org.jboss.beans.metadata.plugins.annotations.SetValue;
+import org.jboss.beans.metadata.plugins.annotations.Value;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SetValueAnnotationPlugin extends CollectionsAnnotationPlugin<SetValue>
+{
+ static SetValueAnnotationPlugin INSTANCE = new SetValueAnnotationPlugin();
+
+ public SetValueAnnotationPlugin()
+ {
+ super(SetValue.class);
+ }
+
+ public ValueMetaData createValueMetaData(SetValue annotation)
+ {
+ AbstractSetMetaData set = new AbstractSetMetaData();
+ if (isAttributePresent(annotation.clazz()))
+ set.setType(annotation.clazz());
+ if (isAttributePresent(annotation.elementClass()))
+ set.setElementType(annotation.elementClass());
+ for(Value value : annotation.value())
+ set.add(createValueMetaData(value));
+ return set;
+ }
+}
Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ValueFactoryAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ValueFactoryAnnotationPlugin.java 2007-07-30 10:00:34 UTC (rev 64342)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ValueFactoryAnnotationPlugin.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -21,20 +21,21 @@
*/
package org.jboss.kernel.plugins.annotations;
+import java.util.ArrayList;
import java.util.List;
-import java.util.ArrayList;
+import org.jboss.beans.metadata.plugins.AbstractParameterMetaData;
+import org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData;
+import org.jboss.beans.metadata.plugins.annotations.Parameter;
import org.jboss.beans.metadata.plugins.annotations.ValueFactory;
-import org.jboss.beans.metadata.plugins.AbstractValueFactoryMetaData;
-import org.jboss.beans.metadata.plugins.AbstractParameterMetaData;
+import org.jboss.beans.metadata.spi.ParameterMetaData;
import org.jboss.beans.metadata.spi.ValueMetaData;
-import org.jboss.beans.metadata.spi.ParameterMetaData;
import org.jboss.dependency.spi.ControllerState;
/**
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
*/
-public class ValueFactoryAnnotationPlugin extends PropertyAnnotationPlugin<ValueFactory>
+public class ValueFactoryAnnotationPlugin extends ParametersAnnotationPlugin<ValueFactory>
{
static ValueFactoryAnnotationPlugin INSTANCE = new ValueFactoryAnnotationPlugin();
@@ -49,7 +50,15 @@
if (isAttributePresent(annotation.defaultValue()))
factory.setDefaultValue(annotation.defaultValue());
List<ParameterMetaData> parameters = new ArrayList<ParameterMetaData>();
- parameters.add(new AbstractParameterMetaData(String.class.getName(), annotation.parameter()));
+ if (isAttributePresent(annotation.parameter()))
+ parameters.add(new AbstractParameterMetaData(String.class.getName(), annotation.parameter()));
+ if (annotation.parameters().length > 0)
+ {
+ if (parameters.size() > 0)
+ throw new IllegalArgumentException("Cannot set both parameter and parameters!");
+ for(Parameter parameter : annotation.parameters())
+ parameters.add(new AbstractParameterMetaData(createValueMetaData(parameter)));
+ }
factory.setParameters(parameters);
factory.setDependentState(new ControllerState(annotation.dependantState()));
factory.setWhenRequiredState(new ControllerState(annotation.whenRequiredState()));
Modified: projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/annotations/support/SimpleInject.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/annotations/support/SimpleInject.java 2007-07-30 10:00:34 UTC (rev 64342)
+++ projects/microcontainer/trunk/kernel/src/tests/org/jboss/test/kernel/annotations/support/SimpleInject.java 2007-07-30 11:13:36 UTC (rev 64343)
@@ -23,6 +23,7 @@
import java.util.Set;
import java.util.HashSet;
+import java.util.List;
import org.jboss.beans.metadata.plugins.annotations.Aliases;
import org.jboss.beans.metadata.plugins.annotations.Demands;
@@ -39,6 +40,8 @@
import org.jboss.beans.metadata.plugins.annotations.ThisValue;
import org.jboss.beans.metadata.plugins.annotations.NullValue;
import org.jboss.beans.metadata.plugins.annotations.UninstallMethod;
+import org.jboss.beans.metadata.plugins.annotations.ListValue;
+import org.jboss.beans.metadata.plugins.annotations.Value;
/**
* @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
@@ -52,6 +55,7 @@
private int intVF;
private TestBean testBean;
private Set<MyDeployer> deployers;
+ private List<TestBean> testers;
public int getVf()
{
@@ -114,4 +118,15 @@
{
this.testBean = bean;
}
+
+ public List<TestBean> getTesters()
+ {
+ return testers;
+ }
+
+ @ListValue({@Value(inject = @Inject(bean = "valueBean")), @Value(inject = @Inject(bean = "valueBean"))})
+ public void setTesters(List<TestBean> testers)
+ {
+ this.testers = testers;
+ }
}
More information about the jboss-cvs-commits
mailing list