[jboss-cvs] JBossAS SVN: r77276 - in projects/jboss-mdr/tags: 2.0.0.Beta17 and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Aug 21 05:08:32 EDT 2008


Author: alesj
Date: 2008-08-21 05:08:31 -0400 (Thu, 21 Aug 2008)
New Revision: 77276

Added:
   projects/jboss-mdr/tags/2.0.0.Beta17/
   projects/jboss-mdr/tags/2.0.0.Beta17/pom.xml
   projects/jboss-mdr/tags/2.0.0.Beta17/release-pom.xml
   projects/jboss-mdr/tags/2.0.0.Beta17/src/main/org/jboss/metadata/plugins/loader/reflection/AnnotatedElementMetaDataLoader.java
Removed:
   projects/jboss-mdr/tags/2.0.0.Beta17/pom.xml
   projects/jboss-mdr/tags/2.0.0.Beta17/src/main/org/jboss/metadata/plugins/loader/reflection/AnnotatedElementMetaDataLoader.java
Log:
[maven-release-plugin]  copy for tag 2.0.0.Beta17

Copied: projects/jboss-mdr/tags/2.0.0.Beta17 (from rev 77273, projects/jboss-mdr/trunk)

Deleted: projects/jboss-mdr/tags/2.0.0.Beta17/pom.xml
===================================================================
--- projects/jboss-mdr/trunk/pom.xml	2008-08-21 08:19:28 UTC (rev 77273)
+++ projects/jboss-mdr/tags/2.0.0.Beta17/pom.xml	2008-08-21 09:08:31 UTC (rev 77276)
@@ -1,113 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>org.jboss</groupId>
-    <artifactId>jboss-parent</artifactId>
-    <version>4-beta-2</version>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <artifactId>jboss-mdr</artifactId>
-  <version>2.0.0-SNAPSHOT</version>
-  <packaging>jar</packaging>
-  <name>JBoss MetaData Repository</name>
-  <url>http://www.jboss.com/products/jbossmc</url>
-  <description>JBoss MetaData Repository</description>
-  <scm>
-    <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-mdr/trunk/</connection>
-    <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-mdr/trunk/</developerConnection>
-    <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-mdr/trunk/</url>
-  </scm>
-
-  <build>
-    <sourceDirectory>src/main</sourceDirectory>
-    <testSourceDirectory>src/tests</testSourceDirectory>
-    <finalName>${artifactId}</finalName>
-    <plugins>
-      <plugin>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.4.1</version>
-        <configuration>
-          <redirectTestOutputToFile>true</redirectTestOutputToFile>
-          <includes>
-            <include>org/jboss/test/**/*TestCase.java</include>
-          </includes>
-          <useSystemClassLoader>true</useSystemClassLoader>
-        </configuration>
-      </plugin>
-      <plugin>
-        <artifactId>maven-assembly-plugin</artifactId>
-        <configuration>
-          <descriptors>
-            <descriptor>src/assembly/metadata-spi.xml</descriptor>
-            <descriptor>src/assembly/metadata.xml</descriptor>
-          </descriptors>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-jar-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test-jar</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-  <dependencies>
-    <!-- Global dependencies -->
-    <dependency>
-      <groupId>org.jboss</groupId>
-      <artifactId>jboss-reflect</artifactId>
-      <version>2.0.0.Beta13</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.jboss</groupId>
-          <artifactId>jboss-common-core</artifactId>
-        </exclusion>
-        <exclusion>
-          <groupId>jboss</groupId>
-          <artifactId>jboss-common-logging-spi</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-    <dependency>
-      <groupId>javassist</groupId>
-      <artifactId>javassist</artifactId>
-      <version>3.8.1.GA</version>
-      <optional>true</optional>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.logging</groupId>
-      <artifactId>jboss-logging-spi</artifactId>
-      <version>2.0.5.GA</version>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss</groupId>
-      <artifactId>jboss-common-core</artifactId>
-      <version>2.2.7.GA</version>
-    </dependency>
-    <!-- Test dependencies -->
-    <dependency>
-      <groupId>org.jboss.test</groupId>
-      <artifactId>jboss-test</artifactId>
-      <version>1.1.0.GA</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.4</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-</project>
\ No newline at end of file

Copied: projects/jboss-mdr/tags/2.0.0.Beta17/pom.xml (from rev 77275, projects/jboss-mdr/trunk/pom.xml)
===================================================================
--- projects/jboss-mdr/tags/2.0.0.Beta17/pom.xml	                        (rev 0)
+++ projects/jboss-mdr/tags/2.0.0.Beta17/pom.xml	2008-08-21 09:08:31 UTC (rev 77276)
@@ -0,0 +1,113 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.jboss</groupId>
+    <artifactId>jboss-parent</artifactId>
+    <version>4-beta-2</version>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>jboss-mdr</artifactId>
+  <version>2.0.0.Beta17</version>
+  <packaging>jar</packaging>
+  <name>JBoss MetaData Repository</name>
+  <url>http://www.jboss.com/products/jbossmc</url>
+  <description>JBoss MetaData Repository</description>
+  <scm>
+    <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-mdr/tags/2.0.0.Beta17</connection>
+    <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-mdr/tags/2.0.0.Beta17</developerConnection>
+    <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-mdr/tags/2.0.0.Beta17</url>
+  </scm>
+
+  <build>
+    <sourceDirectory>src/main</sourceDirectory>
+    <testSourceDirectory>src/tests</testSourceDirectory>
+    <finalName>${artifactId}</finalName>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.4.1</version>
+        <configuration>
+          <redirectTestOutputToFile>true</redirectTestOutputToFile>
+          <includes>
+            <include>org/jboss/test/**/*TestCase.java</include>
+          </includes>
+          <useSystemClassLoader>true</useSystemClassLoader>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <configuration>
+          <descriptors>
+            <descriptor>src/assembly/metadata-spi.xml</descriptor>
+            <descriptor>src/assembly/metadata.xml</descriptor>
+          </descriptors>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+        </configuration>
+      </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-jar-plugin</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <dependencies>
+    <!-- Global dependencies -->
+    <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jboss-reflect</artifactId>
+      <version>2.0.0.Beta13</version>
+      <exclusions>
+        <exclusion>
+          <groupId>org.jboss</groupId>
+          <artifactId>jboss-common-core</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>jboss</groupId>
+          <artifactId>jboss-common-logging-spi</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>javassist</groupId>
+      <artifactId>javassist</artifactId>
+      <version>3.8.1.GA</version>
+      <optional>true</optional>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.logging</groupId>
+      <artifactId>jboss-logging-spi</artifactId>
+      <version>2.0.5.GA</version>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jboss-common-core</artifactId>
+      <version>2.2.7.GA</version>
+    </dependency>
+    <!-- Test dependencies -->
+    <dependency>
+      <groupId>org.jboss.test</groupId>
+      <artifactId>jboss-test</artifactId>
+      <version>1.1.0.GA</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.4</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

Copied: projects/jboss-mdr/tags/2.0.0.Beta17/release-pom.xml (from rev 77275, projects/jboss-mdr/trunk/release-pom.xml)
===================================================================
--- projects/jboss-mdr/tags/2.0.0.Beta17/release-pom.xml	                        (rev 0)
+++ projects/jboss-mdr/tags/2.0.0.Beta17/release-pom.xml	2008-08-21 09:08:31 UTC (rev 77276)
@@ -0,0 +1,268 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.jboss</groupId>
+  <artifactId>jboss-mdr</artifactId>
+  <name>JBoss MetaData Repository</name>
+  <version>2.0.0.Beta17</version>
+  <description>JBoss MetaData Repository</description>
+  <url>http://www.jboss.com/products/jbossmc</url>
+  <issueManagement>
+    <system>jira</system>
+    <url>http://jira.jboss.com/</url>
+  </issueManagement>
+  <licenses>
+    <license>
+      <name>lgpl</name>
+      <url>http://repository.jboss.com/licenses/lgpl.txt</url>
+    </license>
+  </licenses>
+  <scm>
+    <connection>scm:svn:http://anonsvn.jboss.org/repos/jbossas/projects/jboss-mdr/tags/2.0.0.Beta17</connection>
+    <developerConnection>scm:svn:https://svn.jboss.org/repos/jbossas/projects/jboss-mdr/tags/2.0.0.Beta17</developerConnection>
+    <url>http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/jboss-mdr/tags/2.0.0.Beta17</url>
+  </scm>
+  <organization>
+    <name>JBoss, a division of Red Hat, Inc.</name>
+    <url>http://www.jboss.org</url>
+  </organization>
+  <build>
+    <sourceDirectory>src/main</sourceDirectory>
+    <scriptSourceDirectory>src/main/scripts</scriptSourceDirectory>
+    <testSourceDirectory>src/tests</testSourceDirectory>
+    <outputDirectory>target/classes</outputDirectory>
+    <testOutputDirectory>target/test-classes</testOutputDirectory>
+    <resources>
+      <resource>
+        <directory>src/main/resources</directory>
+      </resource>
+    </resources>
+    <testResources>
+      <testResource>
+        <directory>src/test/resources</directory>
+      </testResource>
+    </testResources>
+    <directory>target</directory>
+    <finalName>jboss-mdr</finalName>
+    <plugins>
+      <plugin>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <version>2.4.1</version>
+        <configuration>
+          <redirectTestOutputToFile>true</redirectTestOutputToFile>
+          <includes>
+            <include>org/jboss/test/**/*TestCase.java</include>
+          </includes>
+          <useSystemClassLoader>true</useSystemClassLoader>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-assembly-plugin</artifactId>
+        <version>2.2-beta-2</version>
+        <configuration>
+          <descriptors>
+            <descriptor>src/assembly/metadata-spi.xml</descriptor>
+            <descriptor>src/assembly/metadata.xml</descriptor>
+          </descriptors>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-compiler-plugin</artifactId>
+        <version>2.0.2</version>
+        <configuration>
+          <source>1.5</source>
+          <target>1.5</target>
+          <showDeprecation>true</showDeprecation>
+          <showWarnings>true</showWarnings>
+          <optimize>true</optimize>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-jar-plugin</artifactId>
+        <version>2.2</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>test-jar</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+  <repositories>
+    <repository>
+      <snapshots />
+      <id>snapshots.jboss.org</id>
+      <url>http://snapshots.jboss.org/maven2</url>
+    </repository>
+    <repository>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+      <id>repository.jboss.org</id>
+      <url>http://repository.jboss.org/maven2</url>
+    </repository>
+    <repository>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+      <id>central</id>
+      <name>Maven Repository Switchboard</name>
+      <url>http://repo1.maven.org/maven2</url>
+    </repository>
+  </repositories>
+  <pluginRepositories>
+    <pluginRepository>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+      <id>repository.jboss.org</id>
+      <url>http://repository.jboss.org/maven2</url>
+    </pluginRepository>
+    <pluginRepository>
+      <snapshots />
+      <id>snapshots.jboss.org</id>
+      <url>http://snapshots.jboss.org/maven2</url>
+    </pluginRepository>
+    <pluginRepository>
+      <releases>
+        <updatePolicy>never</updatePolicy>
+      </releases>
+      <snapshots>
+        <enabled>false</enabled>
+      </snapshots>
+      <id>central</id>
+      <name>Maven Plugin Repository</name>
+      <url>http://repo1.maven.org/maven2</url>
+    </pluginRepository>
+  </pluginRepositories>
+  <dependencies>
+    <dependency>
+      <groupId>apache-log4j</groupId>
+      <artifactId>log4j</artifactId>
+      <version>1.2.14</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>javassist</groupId>
+      <artifactId>javassist</artifactId>
+      <version>3.8.1.GA</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>jboss.profiler.jvmti</groupId>
+      <artifactId>jboss-profiler-jvmti</artifactId>
+      <version>1.0.0.CR5</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.4</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.ant</groupId>
+      <artifactId>ant</artifactId>
+      <version>1.7.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.ant</groupId>
+      <artifactId>ant-junit</artifactId>
+      <version>1.7.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.ant</groupId>
+      <artifactId>ant-launcher</artifactId>
+      <version>1.7.0</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jboss-common-core</artifactId>
+      <version>2.2.7.GA</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss</groupId>
+      <artifactId>jboss-reflect</artifactId>
+      <version>2.0.0.Beta13</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.jbossas</groupId>
+      <artifactId>jboss-server-manager</artifactId>
+      <version>0.1.0.GA</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.logging</groupId>
+      <artifactId>jboss-logging-log4j</artifactId>
+      <version>2.0.5.GA</version>
+      <scope>test</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.logging</groupId>
+      <artifactId>jboss-logging-spi</artifactId>
+      <version>2.0.5.GA</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.jboss.test</groupId>
+      <artifactId>jboss-test</artifactId>
+      <version>1.1.0.GA</version>
+      <scope>test</scope>
+    </dependency>
+  </dependencies>
+  <reporting>
+    <outputDirectory>target/site</outputDirectory>
+    <plugins>
+      <plugin>
+        <artifactId>maven-javadoc-plugin</artifactId>
+        <version>2.2</version>
+        <configuration>
+          <links>
+            <link>http://java.sun.com/j2se/1.5.0/docs/api</link>
+          </links>
+        </configuration>
+      </plugin>
+      <plugin>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+        <version>2.0.1</version>
+      </plugin>
+      <plugin>
+        <artifactId>maven-surefire-report-plugin</artifactId>
+        <version>2.3</version>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>report-only</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+      <plugin>
+        <groupId>org.codehaus.mojo</groupId>
+        <artifactId>taglist-maven-plugin</artifactId>
+        <version>2.0</version>
+      </plugin>
+    </plugins>
+  </reporting>
+  <distributionManagement>
+    <repository>
+      <id>repository.jboss.org</id>
+      <url>file:///projects/repository/maven2</url>
+    </repository>
+    <snapshotRepository>
+      <id>snapshots.jboss.org</id>
+      <name>JBoss Snapshot Repository</name>
+      <url>dav:https://snapshots.jboss.org/maven2</url>
+    </snapshotRepository>
+  </distributionManagement>
+  <properties>
+    <maven.repository.root>/projects/repository/maven2</maven.repository.root>
+    <jboss.repository.root>/projects/repository/jboss</jboss.repository.root>
+  </properties>
+</project>
\ No newline at end of file

Deleted: projects/jboss-mdr/tags/2.0.0.Beta17/src/main/org/jboss/metadata/plugins/loader/reflection/AnnotatedElementMetaDataLoader.java
===================================================================
--- projects/jboss-mdr/trunk/src/main/org/jboss/metadata/plugins/loader/reflection/AnnotatedElementMetaDataLoader.java	2008-08-21 08:19:28 UTC (rev 77273)
+++ projects/jboss-mdr/tags/2.0.0.Beta17/src/main/org/jboss/metadata/plugins/loader/reflection/AnnotatedElementMetaDataLoader.java	2008-08-21 09:08:31 UTC (rev 77276)
@@ -1,281 +0,0 @@
-/*
-* 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.metadata.plugins.loader.reflection;
-
-import java.lang.annotation.Annotation;
-import java.lang.reflect.AnnotatedElement;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
-import java.lang.reflect.Member;
-import java.lang.reflect.Method;
-
-import org.jboss.logging.Logger;
-import org.jboss.metadata.plugins.loader.BasicMetaDataLoader;
-import org.jboss.metadata.plugins.loader.SimpleMetaDataLoader;
-import org.jboss.metadata.spi.retrieval.AnnotationItem;
-import org.jboss.metadata.spi.retrieval.AnnotationsItem;
-import org.jboss.metadata.spi.retrieval.MetaDataRetrieval;
-import org.jboss.metadata.spi.retrieval.simple.SimpleAnnotationItem;
-import org.jboss.metadata.spi.retrieval.simple.SimpleAnnotationsItem;
-import org.jboss.metadata.spi.scope.CommonLevels;
-import org.jboss.metadata.spi.scope.Scope;
-import org.jboss.metadata.spi.scope.ScopeKey;
-import org.jboss.metadata.spi.signature.ConstructorParametersSignature;
-import org.jboss.metadata.spi.signature.ConstructorSignature;
-import org.jboss.metadata.spi.signature.DeclaredMethodSignature;
-import org.jboss.metadata.spi.signature.FieldSignature;
-import org.jboss.metadata.spi.signature.MethodParametersSignature;
-import org.jboss.metadata.spi.signature.MethodSignature;
-import org.jboss.metadata.spi.signature.Signature;
-import org.jboss.reflect.plugins.introspection.ReflectionUtils;
-import org.jboss.util.JBossStringBuilder;
-import org.jboss.util.Strings;
-
-/**
- * AnnotatedElementMetaDataLoader.
- * 
- * @author <a href="adrian at jboss.com">Adrian Brock</a>
- * @version $Revision$
- */
-public class AnnotatedElementMetaDataLoader extends BasicMetaDataLoader 
-{
-   /** The log */
-   private static final Logger log = Logger.getLogger(AnnotatedElementMetaDataLoader.class);
-   
-   /** The annotated element */
-   private AnnotatedElement annotated;
-   
-   private static final ScopeKey getScopeKey(AnnotatedElement annotated)
-   {
-      Scope scope;
-      if (annotated instanceof Class)
-      {
-         Class<?> clazz = Class.class.cast(annotated);
-         scope = new Scope(CommonLevels.CLASS, clazz);
-      }
-      else if (annotated instanceof Member)
-      {
-         Member member = (Member) annotated;
-         scope = new Scope(CommonLevels.JOINPOINT, member);
-      }
-      else
-      {
-         return ScopeKey.DEFAULT_SCOPE;
-      }
-      return new ScopeKey(scope);
-   }
-   
-   /**
-    * Create a new AnnotatedElementMetaDataContext.
-    * 
-    * @param annotated the annotated element
-    */
-   public AnnotatedElementMetaDataLoader(AnnotatedElement annotated)
-   {
-      super(getScopeKey(annotated));
-      if (annotated == null)
-         throw new IllegalArgumentException("Null annotated element");
-      this.annotated = annotated;
-   }
-
-   @SuppressWarnings("unchecked")
-   public AnnotationsItem retrieveAnnotations()
-   {
-      Annotation[] annotations = annotated.getAnnotations();
-      if (annotations.length == 0)
-         return SimpleAnnotationsItem.NO_ANNOTATIONS;
-      
-      AnnotationItem[] items = new AnnotationItem[annotations.length];
-      for (int i = 0; i < items.length; ++i)
-         items[i] = new SimpleAnnotationItem(annotations[i]);
-      return new SimpleAnnotationsItem(items);
-   }
-   
-   public <T extends Annotation> AnnotationItem<T> retrieveAnnotation(Class<T> annotationType)
-   {
-      T annotation = annotated.getAnnotation(annotationType);
-      if (annotation == null)
-         return null;
-      return new SimpleAnnotationItem<T>(annotation);
-   }
-
-   public MetaDataRetrieval getComponentMetaDataRetrieval(Signature signature)
-   {
-      if (signature == null)
-         return null;
-
-      if (annotated instanceof Class)
-      {
-         Class<?> clazz = Class.class.cast(annotated);
-         if (signature instanceof ConstructorSignature)
-         {
-            ConstructorSignature constructorSignature = (ConstructorSignature) signature;
-            Constructor<?> constructor = constructorSignature.getConstructor();
-            if (constructor == null)
-               constructor = ReflectionUtils.findConstructor(clazz, signature.getParametersTypes(clazz));
-            if (constructor == null)
-            {
-               if (log.isTraceEnabled())
-                  log.trace("Constructor with signature " + signature + " does not exist on class " + clazz.getName());
-               return null;
-            }
-            return new AnnotatedElementMetaDataLoader(constructor);
-         }
-         else if (signature instanceof MethodSignature)
-         {
-            MethodSignature methodSignature = (MethodSignature) signature;
-            Method method = methodSignature.getMethod();
-            if (method == null)
-               method = ReflectionUtils.findMethod(clazz, signature.getName(), signature.getParametersTypes(clazz));
-            if (method == null)
-            {
-               if (log.isTraceEnabled())
-                  log.trace("Method with signature " + signature + " does not exist on class " + clazz.getName());
-               return null;
-            }
-            return new AnnotatedElementMetaDataLoader(method);
-         }
-         else if (signature instanceof DeclaredMethodSignature)
-         {
-            DeclaredMethodSignature methodSignature = (DeclaredMethodSignature) signature;
-            Method method = methodSignature.getMethod();
-            if (method == null)
-            {
-               clazz = getDeclaringClass(clazz, methodSignature.getDeclaringClass());
-               if (clazz == null)
-                  return null;
-               method = ReflectionUtils.findMethod(clazz, signature.getName(), signature.getParametersTypes(clazz));
-            }
-            if (method == null)
-            {
-               if (log.isTraceEnabled())
-                  log.trace("Method with signature " + signature + " does not exist on class " + clazz.getName());
-               return null;
-            }
-            return new AnnotatedElementMetaDataLoader(method);
-         }
-         else if (signature instanceof MethodParametersSignature)
-         {
-            MethodParametersSignature methodParametersSignature = (MethodParametersSignature) signature;
-            Method method = methodParametersSignature.getMethod();
-            if (method == null)
-               method = ReflectionUtils.findMethod(clazz, signature.getName(), signature.getParametersTypes(clazz));
-            if (method == null)
-            {
-               if (log.isTraceEnabled())
-                  log.trace("Method with signature " + signature + " does not exist on class " + clazz.getName());
-               return null;
-            }
-            Annotation[][] paramAnnotations = method.getParameterAnnotations();
-            return new SimpleMetaDataLoader(paramAnnotations[methodParametersSignature.getParam()]);
-         }
-         else if (signature instanceof ConstructorParametersSignature)
-         {
-            ConstructorParametersSignature constructorParametersSignature = (ConstructorParametersSignature) signature;
-            Constructor<?> constructor = constructorParametersSignature.getConstructor();
-            if (constructor == null)
-               constructor = ReflectionUtils.findConstructor(clazz, signature.getParametersTypes(clazz));
-            if (constructor == null)
-            {
-               if (log.isTraceEnabled())
-                  log.trace("Constructor with signature " + signature + " does not exist on class " + clazz.getName());
-               return null;
-            }
-            Annotation[][] paramAnnotations = constructor.getParameterAnnotations();
-            return new SimpleMetaDataLoader(paramAnnotations[constructorParametersSignature.getParam()]);
-         }
-         else if (signature instanceof FieldSignature)
-         {
-            FieldSignature fieldSignature = (FieldSignature) signature;
-            Field field = fieldSignature.getField();
-            if (field == null)
-               field = ReflectionUtils.findField(clazz, signature.getName());
-            if (field == null)
-            {
-               if (log.isTraceEnabled())
-                  log.trace("Field " + signature.getName() + " does not exist on class " + clazz.getName());
-               return null;
-            }
-            return new AnnotatedElementMetaDataLoader(field);
-         }
-      }
-
-      if (annotated instanceof Method)
-      {
-         if (signature instanceof MethodParametersSignature)
-         {
-            Method method = (Method)annotated;
-            Annotation[][] paramAnnotations = method.getParameterAnnotations();
-            MethodParametersSignature sig = (MethodParametersSignature) signature;
-            return new SimpleMetaDataLoader(paramAnnotations[sig.getParam()]);
-         }
-      }
-
-      if (annotated instanceof Constructor)
-      {
-         if (signature instanceof ConstructorParametersSignature)
-         {
-            Constructor<?> constructor = Constructor.class.cast(annotated);
-            Annotation[][] paramAnnotations = constructor.getParameterAnnotations();
-            ConstructorParametersSignature sig = (ConstructorParametersSignature) signature;
-            return new SimpleMetaDataLoader(paramAnnotations[sig.getParam()]);
-         }
-      }
-
-      return null;
-   }
-
-   public boolean isEmpty()
-   {
-      Annotation[] annotations = annotated.getAnnotations();
-      return annotations == null || annotations.length == 0;
-   }
-
-   public String toString()
-   {
-      JBossStringBuilder buffer = new JBossStringBuilder();
-      Strings.defaultToString(buffer, this);
-      buffer.append("[");
-      buffer.append(annotated);
-      buffer.append("]");
-      return buffer.toString();
-   }
-
-   /**
-    * Get the declaring class from the reference class
-    * 
-    * @param reference the reference class
-    * @param declaringClass the declaring class
-    * @return the class or null if the declaring class is not a super class of the reference
-    */
-   private Class<?> getDeclaringClass(Class<?> reference, String declaringClass)
-   {
-      while (reference != null)
-      {
-         if (declaringClass.equals(reference.getName()))
-            return reference;
-         
-         reference = reference.getSuperclass();
-      }
-      return null;
-   }
-}

Copied: projects/jboss-mdr/tags/2.0.0.Beta17/src/main/org/jboss/metadata/plugins/loader/reflection/AnnotatedElementMetaDataLoader.java (from rev 77274, projects/jboss-mdr/trunk/src/main/org/jboss/metadata/plugins/loader/reflection/AnnotatedElementMetaDataLoader.java)
===================================================================
--- projects/jboss-mdr/tags/2.0.0.Beta17/src/main/org/jboss/metadata/plugins/loader/reflection/AnnotatedElementMetaDataLoader.java	                        (rev 0)
+++ projects/jboss-mdr/tags/2.0.0.Beta17/src/main/org/jboss/metadata/plugins/loader/reflection/AnnotatedElementMetaDataLoader.java	2008-08-21 09:08:31 UTC (rev 77276)
@@ -0,0 +1,281 @@
+/*
+* 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.metadata.plugins.loader.reflection;
+
+import java.lang.annotation.Annotation;
+import java.lang.reflect.AnnotatedElement;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Field;
+import java.lang.reflect.Member;
+import java.lang.reflect.Method;
+
+import org.jboss.logging.Logger;
+import org.jboss.metadata.plugins.loader.BasicMetaDataLoader;
+import org.jboss.metadata.plugins.loader.SimpleMetaDataLoader;
+import org.jboss.metadata.spi.retrieval.AnnotationItem;
+import org.jboss.metadata.spi.retrieval.AnnotationsItem;
+import org.jboss.metadata.spi.retrieval.MetaDataRetrieval;
+import org.jboss.metadata.spi.retrieval.simple.SimpleAnnotationItem;
+import org.jboss.metadata.spi.retrieval.simple.SimpleAnnotationsItem;
+import org.jboss.metadata.spi.scope.CommonLevels;
+import org.jboss.metadata.spi.scope.Scope;
+import org.jboss.metadata.spi.scope.ScopeKey;
+import org.jboss.metadata.spi.signature.ConstructorParametersSignature;
+import org.jboss.metadata.spi.signature.ConstructorSignature;
+import org.jboss.metadata.spi.signature.DeclaredMethodSignature;
+import org.jboss.metadata.spi.signature.FieldSignature;
+import org.jboss.metadata.spi.signature.MethodParametersSignature;
+import org.jboss.metadata.spi.signature.MethodSignature;
+import org.jboss.metadata.spi.signature.Signature;
+import org.jboss.reflect.plugins.introspection.ReflectionUtils;
+import org.jboss.util.JBossStringBuilder;
+import org.jboss.util.Strings;
+
+/**
+ * AnnotatedElementMetaDataLoader.
+ * 
+ * @author <a href="adrian at jboss.com">Adrian Brock</a>
+ * @version $Revision$
+ */
+public class AnnotatedElementMetaDataLoader extends BasicMetaDataLoader 
+{
+   /** The log */
+   private static final Logger log = Logger.getLogger(AnnotatedElementMetaDataLoader.class);
+   
+   /** The annotated element */
+   private AnnotatedElement annotated;
+   
+   private static final ScopeKey getScopeKey(AnnotatedElement annotated)
+   {
+      Scope scope;
+      if (annotated instanceof Class)
+      {
+         Class<?> clazz = Class.class.cast(annotated);
+         scope = new Scope(CommonLevels.CLASS, clazz);
+      }
+      else if (annotated instanceof Member)
+      {
+         Member member = (Member) annotated;
+         scope = new Scope(CommonLevels.JOINPOINT, member);
+      }
+      else
+      {
+         return ScopeKey.DEFAULT_SCOPE;
+      }
+      return new ScopeKey(scope);
+   }
+   
+   /**
+    * Create a new AnnotatedElementMetaDataContext.
+    * 
+    * @param annotated the annotated element
+    */
+   public AnnotatedElementMetaDataLoader(AnnotatedElement annotated)
+   {
+      super(getScopeKey(annotated));
+      if (annotated == null)
+         throw new IllegalArgumentException("Null annotated element");
+      this.annotated = annotated;
+   }
+
+   @SuppressWarnings("unchecked")
+   public AnnotationsItem retrieveAnnotations()
+   {
+      Annotation[] annotations = annotated.getAnnotations();
+      if (annotations.length == 0)
+         return SimpleAnnotationsItem.NO_ANNOTATIONS;
+      
+      AnnotationItem[] items = new AnnotationItem[annotations.length];
+      for (int i = 0; i < items.length; ++i)
+         items[i] = new SimpleAnnotationItem(annotations[i]);
+      return new SimpleAnnotationsItem(items);
+   }
+   
+   public <T extends Annotation> AnnotationItem<T> retrieveAnnotation(Class<T> annotationType)
+   {
+      T annotation = annotated.getAnnotation(annotationType);
+      if (annotation == null)
+         return null;
+      return new SimpleAnnotationItem<T>(annotation);
+   }
+
+   public MetaDataRetrieval getComponentMetaDataRetrieval(Signature signature)
+   {
+      if (signature == null)
+         return null;
+
+      if (annotated instanceof Class)
+      {
+         Class<?> clazz = Class.class.cast(annotated);
+         if (signature instanceof ConstructorSignature)
+         {
+            ConstructorSignature constructorSignature = (ConstructorSignature) signature;
+            Constructor<?> constructor = constructorSignature.getConstructor();
+            if (constructor == null)
+               constructor = ReflectionUtils.findConstructor(clazz, signature.getParametersTypes(clazz));
+            if (constructor == null)
+            {
+               if (log.isTraceEnabled())
+                  log.trace("Constructor with signature " + signature + " does not exist on class " + clazz.getName());
+               return null;
+            }
+            return new AnnotatedElementMetaDataLoader(constructor);
+         }
+         else if (signature instanceof MethodSignature)
+         {
+            MethodSignature methodSignature = (MethodSignature) signature;
+            Method method = methodSignature.getMethod();
+            if (method == null)
+               method = ReflectionUtils.findMethod(clazz, signature.getName(), signature.getParametersTypes(clazz));
+            if (method == null)
+            {
+               if (log.isTraceEnabled())
+                  log.trace("Method with signature " + signature + " does not exist on class " + clazz.getName());
+               return null;
+            }
+            return new AnnotatedElementMetaDataLoader(method);
+         }
+         else if (signature instanceof DeclaredMethodSignature)
+         {
+            DeclaredMethodSignature methodSignature = (DeclaredMethodSignature) signature;
+            Method method = methodSignature.getMethod();
+            if (method == null)
+            {
+               clazz = getDeclaringClass(clazz, methodSignature.getDeclaringClass());
+               if (clazz == null)
+                  return null;
+               method = ReflectionUtils.findMethod(clazz, signature.getName(), signature.getParametersTypes(clazz));
+            }
+            if (method == null)
+            {
+               if (log.isTraceEnabled())
+                  log.trace("Method with signature " + signature + " does not exist on class " + clazz.getName());
+               return null;
+            }
+            return new AnnotatedElementMetaDataLoader(method);
+         }
+         else if (signature instanceof MethodParametersSignature)
+         {
+            MethodParametersSignature methodParametersSignature = (MethodParametersSignature) signature;
+            Method method = methodParametersSignature.getMethod();
+            if (method == null)
+               method = ReflectionUtils.findMethod(clazz, signature.getName(), signature.getParametersTypes(clazz));
+            if (method == null)
+            {
+               if (log.isTraceEnabled())
+                  log.trace("Method with signature " + signature + " does not exist on class " + clazz.getName());
+               return null;
+            }
+            Annotation[][] paramAnnotations = method.getParameterAnnotations();
+            return new SimpleMetaDataLoader(paramAnnotations[methodParametersSignature.getParam()]);
+         }
+         else if (signature instanceof ConstructorParametersSignature)
+         {
+            ConstructorParametersSignature constructorParametersSignature = (ConstructorParametersSignature) signature;
+            Constructor<?> constructor = constructorParametersSignature.getConstructor();
+            if (constructor == null)
+               constructor = ReflectionUtils.findConstructor(clazz, signature.getParametersTypes(clazz));
+            if (constructor == null)
+            {
+               if (log.isTraceEnabled())
+                  log.trace("Constructor with signature " + signature + " does not exist on class " + clazz.getName());
+               return null;
+            }
+            Annotation[][] paramAnnotations = constructor.getParameterAnnotations();
+            return new SimpleMetaDataLoader(paramAnnotations[constructorParametersSignature.getParam()]);
+         }
+         else if (signature instanceof FieldSignature)
+         {
+            FieldSignature fieldSignature = (FieldSignature) signature;
+            Field field = fieldSignature.getField();
+            if (field == null)
+               field = ReflectionUtils.findField(clazz, signature.getName());
+            if (field == null)
+            {
+               if (log.isTraceEnabled())
+                  log.trace("Field " + signature.getName() + " does not exist on class " + clazz.getName());
+               return null;
+            }
+            return new AnnotatedElementMetaDataLoader(field);
+         }
+      }
+
+      if (annotated instanceof Method)
+      {
+         if (signature instanceof MethodParametersSignature)
+         {
+            Method method = (Method)annotated;
+            Annotation[][] paramAnnotations = method.getParameterAnnotations();
+            MethodParametersSignature sig = (MethodParametersSignature) signature;
+            return new SimpleMetaDataLoader(paramAnnotations[sig.getParam()]);
+         }
+      }
+
+      if (annotated instanceof Constructor)
+      {
+         if (signature instanceof ConstructorParametersSignature)
+         {
+            Constructor<?> constructor = Constructor.class.cast(annotated);
+            Annotation[][] paramAnnotations = constructor.getParameterAnnotations();
+            ConstructorParametersSignature sig = (ConstructorParametersSignature) signature;
+            return new SimpleMetaDataLoader(paramAnnotations[sig.getParam()]);
+         }
+      }
+
+      return null;
+   }
+
+   public boolean isEmpty()
+   {
+      Annotation[] annotations = annotated.getAnnotations();
+      return annotations == null || annotations.length == 0;
+   }
+
+   public String toString()
+   {
+      JBossStringBuilder buffer = new JBossStringBuilder();
+      Strings.defaultToString(buffer, this);
+      buffer.append("[");
+      buffer.append(annotated);
+      buffer.append("]");
+      return buffer.toString();
+   }
+
+   /**
+    * Get the declaring class from the reference class
+    * 
+    * @param reference the reference class
+    * @param declaringClass the declaring class
+    * @return the class or null if the declaring class is not a super class of the reference
+    */
+   private static Class<?> getDeclaringClass(Class<?> reference, String declaringClass)
+   {
+      while (reference != null)
+      {
+         if (declaringClass.equals(reference.getName()))
+            return reference;
+         
+         reference = reference.getSuperclass();
+      }
+      return null;
+   }
+}




More information about the jboss-cvs-commits mailing list