[jboss-cvs] JBossAS SVN: r64347 - projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Jul 30 10:04:36 EDT 2007


Author: alesj
Date: 2007-07-30 10:04:36 -0400 (Mon, 30 Jul 2007)
New Revision: 64347

Added:
   projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ArrayConstructorValueAnnotationPlugin.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/CollectionConstructorValueAnnotationPlugin.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ConstructorValueAnnotationPlugin.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/InjectConstructorValueAnnotationPlugin.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ListConstructorValueAnnotationPlugin.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/MapConstructorValueAnnotationPlugin.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/SetConstructorValueAnnotationPlugin.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/StringValueConstructorValueAnnotationPlugin.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ValueFactoryConstructorValueAnnotationPlugin.java
Modified:
   projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.java
Log:
Constructor value @annotation plugins.

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ArrayConstructorValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ArrayConstructorValueAnnotationPlugin.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ArrayConstructorValueAnnotationPlugin.java	2007-07-30 14:04:36 UTC (rev 64347)
@@ -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.kernel.plugins.annotations;
+
+import org.jboss.beans.metadata.plugins.annotations.ArrayValue;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ArrayConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin<ArrayValue>
+{
+   protected ArrayConstructorValueAnnotationPlugin()
+   {
+      super(ArrayValue.class);
+   }
+
+   public ValueMetaData createValueMetaData(ArrayValue annotation)
+   {
+      return ArrayValueAnnotationPlugin.INSTANCE.createValueMetaData(annotation);
+   }
+}

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 13:22:04 UTC (rev 64346)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/BasicBeanAnnotationAdapter.java	2007-07-30 14:04:36 UTC (rev 64347)
@@ -82,6 +82,14 @@
       addAnnotationPlugin(new SupplysAnnotationPlugin());
       // constructor
       addAnnotationPlugin(new ConstructorParameterAnnotationPlugin(adapters));
+      addAnnotationPlugin(new InjectConstructorValueAnnotationPlugin());
+      addAnnotationPlugin(new StringValueConstructorValueAnnotationPlugin());
+      addAnnotationPlugin(new ValueFactoryConstructorValueAnnotationPlugin());
+      addAnnotationPlugin(new CollectionConstructorValueAnnotationPlugin());
+      addAnnotationPlugin(new ListConstructorValueAnnotationPlugin());
+      addAnnotationPlugin(new SetConstructorValueAnnotationPlugin());
+      addAnnotationPlugin(new ArrayConstructorValueAnnotationPlugin());
+      addAnnotationPlugin(new MapConstructorValueAnnotationPlugin());
       // property
       addAnnotationPlugin(InjectAnnotationPlugin.INSTANCE);
       addAnnotationPlugin(StringValueAnnotationPlugin.INSTANCE);

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/CollectionConstructorValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/CollectionConstructorValueAnnotationPlugin.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/CollectionConstructorValueAnnotationPlugin.java	2007-07-30 14:04:36 UTC (rev 64347)
@@ -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.kernel.plugins.annotations;
+
+import org.jboss.beans.metadata.plugins.annotations.CollectionValue;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class CollectionConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin<CollectionValue>
+{
+   protected CollectionConstructorValueAnnotationPlugin()
+   {
+      super(CollectionValue.class);
+   }
+
+   public ValueMetaData createValueMetaData(CollectionValue annotation)
+   {
+      return CollectionValueAnnotationPlugin.INSTANCE.createValueMetaData(annotation);
+   }
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ConstructorValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ConstructorValueAnnotationPlugin.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ConstructorValueAnnotationPlugin.java	2007-07-30 14:04:36 UTC (rev 64347)
@@ -0,0 +1,53 @@
+/*
+* 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.reflect.spi.ConstructorInfo;
+import org.jboss.beans.metadata.spi.BeanMetaData;
+import org.jboss.beans.metadata.plugins.AbstractConstructorMetaData;
+import org.jboss.beans.metadata.plugins.AbstractBeanMetaData;
+
+/**
+ * @param <C> annotation type
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public abstract class ConstructorValueAnnotationPlugin<C extends Annotation> extends ConstructorAnnotationPlugin<C> implements Annotation2ValueMetaDataAdapter<C>
+{
+   protected ConstructorValueAnnotationPlugin(Class<C> annotation)
+   {
+      super(annotation);
+   }
+
+   protected boolean isMetaDataAlreadyPresent(ConstructorInfo info, C annotation, BeanMetaData beanMetaData)
+   {
+      return beanMetaData.getConstructor() != null;
+   }
+
+   protected void internalApplyAnnotation(ConstructorInfo info, C annotation, BeanMetaData beanMetaData) throws Throwable
+   {
+      AbstractConstructorMetaData constructor = new AbstractConstructorMetaData();
+      constructor.setValue(createValueMetaData(annotation));
+      ((AbstractBeanMetaData)beanMetaData).setConstructor(constructor);
+   }
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/InjectConstructorValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/InjectConstructorValueAnnotationPlugin.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/InjectConstructorValueAnnotationPlugin.java	2007-07-30 14:04:36 UTC (rev 64347)
@@ -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.kernel.plugins.annotations;
+
+import org.jboss.beans.metadata.plugins.annotations.Inject;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class InjectConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin<Inject>
+{
+   protected InjectConstructorValueAnnotationPlugin()
+   {
+      super(Inject.class);
+   }
+
+   public ValueMetaData createValueMetaData(Inject annotation)
+   {
+      return InjectAnnotationPlugin.INSTANCE.createValueMetaData(annotation);
+   }
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ListConstructorValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ListConstructorValueAnnotationPlugin.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ListConstructorValueAnnotationPlugin.java	2007-07-30 14:04:36 UTC (rev 64347)
@@ -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.kernel.plugins.annotations;
+
+import org.jboss.beans.metadata.plugins.annotations.ListValue;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ListConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin<ListValue>
+{
+   protected ListConstructorValueAnnotationPlugin()
+   {
+      super(ListValue.class);
+   }
+
+   public ValueMetaData createValueMetaData(ListValue annotation)
+   {
+      return ListValueAnnotationPlugin.INSTANCE.createValueMetaData(annotation);
+   }
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/MapConstructorValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/MapConstructorValueAnnotationPlugin.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/MapConstructorValueAnnotationPlugin.java	2007-07-30 14:04:36 UTC (rev 64347)
@@ -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.kernel.plugins.annotations;
+
+import org.jboss.beans.metadata.plugins.annotations.MapValue;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class MapConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin<MapValue>
+{
+   protected MapConstructorValueAnnotationPlugin()
+   {
+      super(MapValue.class);
+   }
+
+   public ValueMetaData createValueMetaData(MapValue annotation)
+   {
+      return MapValueAnnotationPlugin.INSTANCE.createValueMetaData(annotation);
+   }
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/SetConstructorValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/SetConstructorValueAnnotationPlugin.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/SetConstructorValueAnnotationPlugin.java	2007-07-30 14:04:36 UTC (rev 64347)
@@ -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.kernel.plugins.annotations;
+
+import org.jboss.beans.metadata.plugins.annotations.SetValue;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class SetConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin<SetValue>
+{
+   protected SetConstructorValueAnnotationPlugin()
+   {
+      super(SetValue.class);
+   }
+
+   public ValueMetaData createValueMetaData(SetValue annotation)
+   {
+      return SetValueAnnotationPlugin.INSTANCE.createValueMetaData(annotation);
+   }
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/StringValueConstructorValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/StringValueConstructorValueAnnotationPlugin.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/StringValueConstructorValueAnnotationPlugin.java	2007-07-30 14:04:36 UTC (rev 64347)
@@ -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.kernel.plugins.annotations;
+
+import org.jboss.beans.metadata.plugins.annotations.StringValue;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class StringValueConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin<StringValue>
+{
+   protected StringValueConstructorValueAnnotationPlugin()
+   {
+      super(StringValue.class);
+   }
+
+   public ValueMetaData createValueMetaData(StringValue annotation)
+   {
+      return StringValueAnnotationPlugin.INSTANCE.createValueMetaData(annotation);
+   }
+}

Added: projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ValueFactoryConstructorValueAnnotationPlugin.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ValueFactoryConstructorValueAnnotationPlugin.java	                        (rev 0)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/kernel/plugins/annotations/ValueFactoryConstructorValueAnnotationPlugin.java	2007-07-30 14:04:36 UTC (rev 64347)
@@ -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.kernel.plugins.annotations;
+
+import org.jboss.beans.metadata.plugins.annotations.ValueFactory;
+import org.jboss.beans.metadata.spi.ValueMetaData;
+
+/**
+ * @author <a href="mailto:ales.justin at jboss.com">Ales Justin</a>
+ */
+public class ValueFactoryConstructorValueAnnotationPlugin extends ConstructorValueAnnotationPlugin<ValueFactory>
+{
+   protected ValueFactoryConstructorValueAnnotationPlugin()
+   {
+      super(ValueFactory.class);
+   }
+
+   public ValueMetaData createValueMetaData(ValueFactory annotation)
+   {
+      return ValueFactoryAnnotationPlugin.INSTANCE.createValueMetaData(annotation);
+   }
+}




More information about the jboss-cvs-commits mailing list