[jboss-cvs] JBossAS SVN: r71937 - in projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata: spi/builder and 1 other directory.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 10 11:03:33 EDT 2008


Author: alesj
Date: 2008-04-10 11:03:33 -0400 (Thu, 10 Apr 2008)
New Revision: 71937

Modified:
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java
   projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java
Log:
Add annotation with replace method.

Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java	2008-04-10 14:55:45 UTC (rev 71936)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/plugins/builder/BeanMetaDataBuilderImpl.java	2008-04-10 15:03:33 UTC (rev 71937)
@@ -201,7 +201,12 @@
       return this;
    }
 
-   public BeanMetaDataBuilder addAnnotation(String annotation)
+   /**
+    * Get the annotations.
+    *
+    * @return the annotations
+    */
+   protected Set<AnnotationMetaData> getAnnotations()
    {
       Set<AnnotationMetaData> annotations = beanMetaData.getAnnotations();
       if (annotations == null)
@@ -209,12 +214,28 @@
          annotations = new HashSet<AnnotationMetaData>();
          beanMetaData.setAnnotations(annotations);
       }
+      return annotations;
+   }
+
+   public BeanMetaDataBuilder addAnnotation(String annotation)
+   {
+      Set<AnnotationMetaData> annotations = getAnnotations();
       AbstractAnnotationMetaData amd = new AbstractAnnotationMetaData();
       amd.setAnnotation(annotation);
       annotations.add(amd);
       return this;
    }
 
+   public BeanMetaDataBuilder addAnnotation(String annotation, boolean replace)
+   {
+      Set<AnnotationMetaData> annotations = getAnnotations();
+      AbstractAnnotationMetaData amd = new AbstractAnnotationMetaData();
+      amd.setAnnotation(annotation);
+      amd.setReplace(replace);
+      annotations.add(amd);
+      return this;
+   }
+
    public BeanMetaDataBuilder setMode(ControllerMode mode)
    {
       beanMetaData.setMode(mode);

Modified: projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java
===================================================================
--- projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java	2008-04-10 14:55:45 UTC (rev 71936)
+++ projects/microcontainer/trunk/kernel/src/main/org/jboss/beans/metadata/spi/builder/BeanMetaDataBuilder.java	2008-04-10 15:03:33 UTC (rev 71937)
@@ -131,7 +131,7 @@
    public abstract BeanMetaDataBuilder setAnnotations(Set<String> annotations);
 
    /**
-    * Add alias.
+    * Add annotation.
     *
     * @param annotation the annotation
     * @return the builder
@@ -139,6 +139,15 @@
    public abstract BeanMetaDataBuilder addAnnotation(String annotation);
 
    /**
+    * Add annotation.
+    *
+    * @param annotation the annotation
+    * @param replace the replace flag
+    * @return the builder
+    */
+   public abstract BeanMetaDataBuilder addAnnotation(String annotation, boolean replace);
+
+   /**
     * Set the mode
     * 
     * @param modeString the mode




More information about the jboss-cvs-commits mailing list