commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r1344950 [1/3] - in /commons/sandbox/classscan/trunk: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/commons/ src/main/java/org/apache/commons/classscan/ src/main/java/org/apache/commo...
Date Fri, 01 Jun 2012 00:27:41 GMT
Author: chas
Date: Fri Jun  1 00:27:39 2012
New Revision: 1344950

URL: http://svn.apache.org/viewvc?rev=1344950&view=rev
Log:
initial commit of ClassScan

Added:
    commons/sandbox/classscan/trunk/LICENSE.txt   (with props)
    commons/sandbox/classscan/trunk/NOTICE.txt   (with props)
    commons/sandbox/classscan/trunk/pom.xml   (with props)
    commons/sandbox/classscan/trunk/src/
    commons/sandbox/classscan/trunk/src/main/
    commons/sandbox/classscan/trunk/src/main/java/
    commons/sandbox/classscan/trunk/src/main/java/org/
    commons/sandbox/classscan/trunk/src/main/java/org/apache/
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/HasName.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaAnnotation.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClass.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClassLoader.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClassLocation.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaField.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaMethod.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaParameter.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaRegistry.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaType.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/AnnotationMap.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/ArrayMetaType.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelAnnotation.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelClass.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelEnumProperty.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelField.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelMethod.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelParameter.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelProperty.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BootstrapClassLoader.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/Cache.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/ClassMetaType.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/DeferredMetaClass.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/FileClassLocation.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/JarClassLocation.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/MetaUrlClassLoader.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/PrimitiveClass.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/UriClassLocation.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/package-info.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/package-info.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/util/
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/util/ArrayTransformer.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/util/CallStack.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/util/HashWeakReference.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/util/ReadOnlySet.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/util/SortedReadOnlySet.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/util/WeakConcurrentHashMap.java   (with props)
    commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/util/package-info.java   (with props)
    commons/sandbox/classscan/trunk/src/main/resources/
    commons/sandbox/classscan/trunk/src/site/
    commons/sandbox/classscan/trunk/src/site/site.xml   (with props)
    commons/sandbox/classscan/trunk/src/site/xdoc/
    commons/sandbox/classscan/trunk/src/site/xdoc/building.xml   (with props)
    commons/sandbox/classscan/trunk/src/site/xdoc/index.xml   (with props)
    commons/sandbox/classscan/trunk/src/site/xdoc/userguide.xml   (with props)
    commons/sandbox/classscan/trunk/src/test/
    commons/sandbox/classscan/trunk/src/test/java/
    commons/sandbox/classscan/trunk/src/test/java/org/
    commons/sandbox/classscan/trunk/src/test/java/org/apache/
    commons/sandbox/classscan/trunk/src/test/java/org/apache/commons/
    commons/sandbox/classscan/trunk/src/test/java/org/apache/commons/classscan/
    commons/sandbox/classscan/trunk/src/test/java/org/apache/commons/classscan/bcel/
    commons/sandbox/classscan/trunk/src/test/java/org/apache/commons/classscan/bcel/BcelClassTest.java   (with props)
    commons/sandbox/classscan/trunk/src/test/java/org/apache/commons/classscan/bcel/MetaUrlClassLoaderTest.java   (with props)
    commons/sandbox/classscan/trunk/src/test/java/org/apache/commons/classscan/bcel/PrimitiveClassTest.java   (with props)
    commons/sandbox/classscan/trunk/src/test/java/org/apache/commons/classscan/bcel/UriClassLocationTest.java   (with props)
    commons/sandbox/classscan/trunk/src/test/java/org/apache/commons/classscan/test/
    commons/sandbox/classscan/trunk/src/test/java/org/apache/commons/classscan/test/classes/
    commons/sandbox/classscan/trunk/src/test/java/org/apache/commons/classscan/test/classes/BadPackage.java   (with props)
    commons/sandbox/classscan/trunk/src/test/java/org/apache/commons/classscan/test/classes/FullInterface.java   (with props)
    commons/sandbox/classscan/trunk/src/test/java/org/apache/commons/classscan/test/classes/FullyDecorated.java   (with props)
    commons/sandbox/classscan/trunk/src/test/java/org/apache/commons/classscan/test/classes/ValidateFullyDecorated.java   (with props)
    commons/sandbox/classscan/trunk/src/test/resources/
    commons/sandbox/classscan/trunk/src/test/resources/META-INF/
    commons/sandbox/classscan/trunk/src/test/resources/META-INF/org.apache.commons.classscan.test.classes.FullInterface
    commons/sandbox/classscan/trunk/src/test/resources/logback.xml   (with props)
    commons/sandbox/classscan/trunk/src/test/resources/org/
    commons/sandbox/classscan/trunk/src/test/resources/org/apache/
    commons/sandbox/classscan/trunk/src/test/resources/org/apache/commons/
    commons/sandbox/classscan/trunk/src/test/resources/org/apache/commons/classscan/
    commons/sandbox/classscan/trunk/src/test/resources/org/apache/commons/classscan/test/
    commons/sandbox/classscan/trunk/src/test/resources/org/apache/commons/classscan/test/classes/
    commons/sandbox/classscan/trunk/src/test/resources/org/apache/commons/classscan/test/classes/--InvalidClassName--.class
    commons/sandbox/classscan/trunk/src/test/resources/org/apache/commons/classscan/test/classes/NotAClass.class

Added: commons/sandbox/classscan/trunk/LICENSE.txt
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/LICENSE.txt?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/LICENSE.txt (added)
+++ commons/sandbox/classscan/trunk/LICENSE.txt Fri Jun  1 00:27:39 2012
@@ -0,0 +1,202 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

Propchange: commons/sandbox/classscan/trunk/LICENSE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/NOTICE.txt
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/NOTICE.txt?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/NOTICE.txt (added)
+++ commons/sandbox/classscan/trunk/NOTICE.txt Fri Jun  1 00:27:39 2012
@@ -0,0 +1,5 @@
+Apache Commons ClassScan
+Copyright 2012 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).

Propchange: commons/sandbox/classscan/trunk/NOTICE.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/pom.xml
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/pom.xml?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/pom.xml (added)
+++ commons/sandbox/classscan/trunk/pom.xml Fri Jun  1 00:27:39 2012
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+
+   Licensed to the Apache Software Foundation (ASF) under one or more
+   contributor license agreements.  See the NOTICE file distributed with
+   this work for additional information regarding copyright ownership.
+   The ASF licenses this file to You under the Apache License, Version 2.0
+   (the "License"); you may not use this file except in compliance with
+   the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+-->
+
+<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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  
+  <parent>
+    <groupId>org.apache.commons</groupId>
+    <artifactId>commons-parent</artifactId>
+    <version>24</version>
+  </parent>
+  
+  <groupId>org.apache.commons</groupId>
+  <artifactId>classscan</artifactId>
+  <name>Class Scan</name>
+  <version>0.1-SNAPSHOT</version>
+  <description>A library to obtain information about class(es) before the jvm loads the class</description>
+  
+  <properties>
+    <maven.compile.source>1.5</maven.compile.source>
+    <maven.compile.target>1.5</maven.compile.target>
+    <commons.subproject.location>sandbox/classscan/trunk</commons.subproject.location>
+  </properties> 
+  
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/commons/${commons.subproject.location}</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/commons/${commons.subproject.location}</developerConnection>
+    <url>http://svn.apache.org/viewvc/commons/${commons.subproject.location}</url>
+  </scm>
+  
+  <build>
+  
+    <plugins>
+
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-surefire-plugin</artifactId>
+        <configuration>
+          <argLine>-Xmx512m</argLine>
+        </configuration>
+      </plugin>
+
+    </plugins>  
+  
+  </build>
+  
+  <dependencies>
+    
+    <dependency>
+      <groupId>org.apache.bcel</groupId>
+      <artifactId>bcel</artifactId>
+      <version>6.0-SNAPSHOT</version>
+    </dependency>
+    
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.3</version>
+      <scope>test</scope>
+    </dependency>
+    
+    <dependency>
+      <groupId>org.slf4j</groupId>
+      <artifactId>slf4j-api</artifactId>
+      <version>1.5.10</version>
+    </dependency>
+    
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-core</artifactId>
+      <version>0.9.18</version>
+      <scope>test</scope>
+    </dependency>
+
+    <dependency>
+      <groupId>ch.qos.logback</groupId>
+      <artifactId>logback-classic</artifactId>
+      <version>0.9.18</version>
+      <scope>test</scope>
+    </dependency>    
+    
+  </dependencies>
+
+  <repositories>
+    <repository>
+      <id>apache-snapshot</id>
+      <url>https://repository.apache.org/content/repositories/snapshots</url>
+      <snapshots>
+        <enabled>true</enabled>
+      </snapshots>
+    </repository>
+  </repositories>
+  
+  <distributionManagement>
+    <site>
+      <id>apache.website</id>
+      <name>Apache Commons Site</name>
+      <url>${commons.deployment.protocol}://people.apache.org/www/commons.apache.org/${commons.componentid}</url>
+    </site>
+  </distributionManagement>
+  
+  
+</project>

Propchange: commons/sandbox/classscan/trunk/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/HasName.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/HasName.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/HasName.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/HasName.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,24 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan;
+
+/**
+ * This marker interface indicates that instances have a name.
+ */
+public interface HasName {
+    /**
+     * Get the name of the instance
+     */
+    String getName();
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/HasName.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaAnnotation.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaAnnotation.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaAnnotation.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaAnnotation.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,80 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan;
+
+import java.util.Set;
+
+/**
+ * Metadata about an Annotation
+ */
+public interface MetaAnnotation extends HasName {
+    /**
+     * Get the name of the Annotation
+     */
+    String getName();
+
+    /**
+     * Get metadata about the properties of the corresponding Annotation
+     * 
+     * @return The read-only set of properties specified in the annotation
+     */
+    Set<? extends Property> getProperties();
+
+    /**
+     * Get a single property of the corresponding Annotation
+     * 
+     * @param propertyName
+     *            The name of the Property desired.
+     * @return The Property; or null, if the no Property exists with the given
+     *         name.
+     */
+    Property getProperty(String propertyName);
+
+    /**
+     * Metadata about an Annotation property
+     */
+    public interface Property {
+        /**
+         * Get the name of the property
+         */
+        String getName();
+
+        /**
+         * Get the property value. This will be
+         * <ul>
+         * <li>a String for String value,</li>
+         * <li>an Object of the wrapper type for primitive values,</li>
+         * <li>an {@link EnumValue} for Enum values,</li>
+         * <li>a MetaAnnotation for Annotations,</li>
+         * <li>an Object[] for any array value</li>
+         * </ul>
+         */
+        Object getValue();
+    }
+
+    /**
+     * Metadata about an Annotation Enum value
+     */
+    public interface EnumValue {
+        /**
+         * Get information about the Enumeration
+         */
+        MetaClass getEnumType();
+
+        /**
+         * Get the name of the enumeration instance
+         */
+        String getEnumValue();
+    }
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaAnnotation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClass.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClass.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClass.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClass.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,94 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan;
+
+import java.util.Set;
+
+/**
+ * Metadata about a class or primitive type
+ */
+public interface MetaClass extends HasName {
+    /**
+     * Get the ClassLocation from which the corresponding class came. For
+     * primitive types, this will return null.
+     */
+    MetaClassLocation getClassLocation();
+
+    /**
+     * Get the canonical name of the corresponding Class. For primitive types,
+     * this will be the primitive type name. e.g. char
+     */
+    String getName();
+
+    /**
+     * Get metadata about the corresponding Class's parent
+     * 
+     * @return The MetaClass, or null if the corresponding Class is a primitive
+     *         type or Object.class
+     */
+    MetaClass getParent();
+
+    /**
+     * Get metadata about the interfaces which the corresponding Class
+     * implements. No inherited interfaces will be in the set.
+     * 
+     * @return A read-only set of the interface information
+     */
+    Set<? extends MetaClass> getInterfaces();
+
+    /**
+     * Get metadata about the annotations on the corresponding Class.
+     * 
+     * @return A read-only set of the annotation information
+     */
+    Set<? extends MetaAnnotation> getAnnotations();
+
+    /**
+     * Get metadata about a particular annotation on the corresponding Class.
+     * 
+     * @param annotationName
+     *            The name of the annotation desired
+     * 
+     * @return The annotation information, or null if not specified on the
+     *         corresponding Class
+     */
+    MetaAnnotation getAnnotation(String annotationName);
+
+    /**
+     * Get metadata about the corresponding Class's methods and constructors. No
+     * inherited methods will be in the set.
+     * 
+     * @return A read-only set of the method information
+     */
+    Set<? extends MetaMethod> getMethods();
+
+    /**
+     * Get metadata about the corresponding Class's methods and constructors. No
+     * inherited fields will be in the set.
+     * 
+     * @return A read-only set of the field information
+     */
+    Set<? extends MetaField> getFields();
+
+    /**
+     * Is the associated Class assignable from the class associated with the
+     * given MetaClass.
+     * 
+     * @param assignor
+     *            The non-null MetaClass (associated with class or interface)
+     * @return true, if and only if instances represented by implementor can be
+     *         assigned to instances represented by this MetaClass
+     */
+    boolean isAssignableFrom(MetaClass assignor);
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClass.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClassLoader.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClassLoader.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClassLoader.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClassLoader.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,101 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan;
+
+import java.util.Collection;
+import java.util.Set;
+
+/**
+ * Metadata about a ClassLoader. This includes the jars that a ClassLoader loads
+ * from and the Classes that are potentially available.
+ */
+public interface MetaClassLoader {
+    /**
+     * Get the metadata about the parent of the associated ClassLoader.
+     * 
+     * @return The parent metadata. This will be null if the associated
+     *         ClassLoader is the primordial ClassLoader.
+     */
+    MetaClassLoader getParent();
+
+    /**
+     * Get metadata about the locations from which the associated ClassLoader
+     * loads Classes.
+     * 
+     * @return A read-only set of code locations
+     */
+    Set<? extends MetaClassLocation> getClassLocations();
+
+    /**
+     * Get metadata about the locations from which the associated ClassLoader
+     * loads Classes. This method does not return locations loaded by parent
+     * ClassLoader
+     * 
+     * @param metaInfFilename
+     *            The name of a file which resides in a META-INF folder.
+     * @return A set of code locations which contain a corresponding file in the
+     *         META-INF folder.
+     */
+    Collection<? extends MetaClassLocation> getClassLocationsWithMetaFile(String metaInfFilename);
+
+    /**
+     * Get metadata about a class locations
+     * 
+     * @param codeLocation
+     *            The location of a folder, jar, or compressed code
+     */
+    MetaClassLocation getClassLocation(String codeLocation);
+
+    /**
+     * Get metadata about the Classes from which the associated ClassLoader can
+     * load.
+     * 
+     * @return A read-only set of class information
+     */
+    Set<? extends MetaClass> getMetaClasses();
+
+    /**
+     * Get metadata about a particular Class. This method will return only
+     * classes defined by the associated ClassLoader. Classes defined by a
+     * parent ClassLoader can be found using {@link #findMetaClass}.
+     * 
+     * @param className
+     *            The name of the Class
+     * @return The metadata about the Class; or null, if the class was not
+     *         available to the associated ClassLoader
+     */
+    MetaClass getMetaClass(String className);
+
+    /**
+     * Get metadata about a particular Class. This method will first search up
+     * the associated parent ClassLoader chain.
+     * 
+     * @param className
+     *            The name of the Class
+     * @return The metadata about the Class; or null, if the class was not
+     *         available to the associated ClassLoader not its parent chain
+     */
+    MetaClass findMetaClass(String className);
+
+    /**
+     * Find all the implementors of an interface class. This method will search
+     * in the associated ClassLoader and all parents.
+     * 
+     * @param interfaceToFind
+     *            The non-null MetaClass associated with the
+     * 
+     * @return All discovered implementors of the desired interface
+     */
+    Collection<? extends MetaClass> findAllImplementors(String interfaceToFind);
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClassLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClassLocation.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClassLocation.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClassLocation.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClassLocation.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,46 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan;
+
+import java.util.Set;
+
+/**
+ * Information about a code location. A code location may be a file folder, or a
+ * jar, or other packaged location
+ */
+public interface MetaClassLocation extends HasName {
+
+    /**
+     * Get metadata about the Classes which are available in the code location.
+     * 
+     * @return A read-only collection of class information
+     */
+    Set<? extends MetaClass> getMetaClasses();
+
+    /**
+     * Get metadata about a Class which is available in the code location.
+     * 
+     * @param className
+     *            The canonical className of the desired Class
+     * @return The class information; or null, if class of given name not
+     *         available at this location
+     */
+    MetaClass getMetaClass(String className);
+
+    /**
+     * Get the name of the location of the jar or folder.  This name can be used as the parameter
+     * to the {@link java.net.URI URI} or {@link java.net.URL URL} constructor.
+     */
+    String getName();
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaClassLocation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaField.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaField.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaField.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaField.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,54 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan;
+
+import java.util.Set;
+
+/**
+ * Metadata about a Class field
+ */
+public interface MetaField extends HasName {
+    /**
+     * Get the name of the method or constructor
+     */
+    String getName();
+
+    /**
+     * Get metadata about the annotations on the field.
+     * 
+     * @return A read-only set of annotations
+     */
+    Set<? extends MetaAnnotation> getAnnotations();
+
+    /**
+     * Get metadata about a particular annotation on the corresponding field.
+     * 
+     * @param annotationName
+     *            The name of the annotation desired
+     * 
+     * @return The annotation information, or null if not specified on the
+     *         corresponding field
+     */
+    MetaAnnotation getAnnotation(String annotationName);
+
+    /**
+     * Get whether the corresponding field is a static field
+     */
+    boolean isStatic();
+
+    /**
+     * Get metadata about the field's type
+     */
+    MetaType getType();
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaField.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaMethod.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaMethod.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaMethod.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaMethod.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,65 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan;
+
+import java.util.Set;
+
+/**
+ * Metadata about a class method or constructor
+ */
+public interface MetaMethod extends HasName {
+    /**
+     * Get the name of the method or constructor
+     */
+    String getName();
+
+    /**
+     * Get metadata about the annotations on the method or constructor.
+     * 
+     * @return A read-only set of annotations
+     */
+    Set<? extends MetaAnnotation> getAnnotations();
+
+    /**
+     * Get metadata about a particular annotation on the corresponding method.
+     * 
+     * @param annotationName
+     *            The name of the annotation desired
+     * 
+     * @return The annotation information, or null if not specified on the
+     *         corresponding method
+     */
+    MetaAnnotation getAnnotation(String annotationName);
+
+    /**
+     * Get whether the corresponding method or constructor is a static method or
+     * static class initializer
+     */
+    boolean isStatic();
+
+    /**
+     * Get metadata about the return type of the method or constructor
+     * 
+     * @return null, if the type is void return; otherwise, metadata about the
+     *         type
+     */
+    MetaType getType();
+
+    /**
+     * Get metadata about the parameters of the method or constructor
+     * 
+     * @return A read-only set of parameter information
+     */
+    Set<? extends MetaParameter> getParameters();
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaMethod.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaParameter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaParameter.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaParameter.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaParameter.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,44 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan;
+
+import java.util.Set;
+
+/**
+ * Metadata about a method or constructor parameter
+ */
+public interface MetaParameter {
+    /**
+     * Get metadata about the annotations on the parameter.
+     * 
+     * @return A read-only set of annotations
+     */
+    Set<? extends MetaAnnotation> getAnnotations();
+
+    /**
+     * Get metadata about a particular annotation on the parameter.
+     * 
+     * @param annotationName
+     *            The name of the annotation desired
+     * 
+     * @return The annotation information, or null if not specified on the
+     *         corresponding parameter
+     */
+    MetaAnnotation getAnnotation(String annotationName);
+
+    /**
+     * Get metadata about the type of the parameter
+     */
+    MetaType getType();
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaParameter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaRegistry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaRegistry.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaRegistry.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaRegistry.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,40 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan;
+
+import org.apache.commons.classscan.bcel.Cache;
+
+/**
+ * The factory for MetaClassLoaders. Wherever possible, an existing
+ * MetaClassLoader is returned for a ClassLoader. The implementation should not
+ * prevent the garbage collection of a ClassLoader.
+ */
+public interface MetaRegistry {
+
+    /**
+     * The single instance of a MetaRegistry implementation.
+     */
+    public final static MetaRegistry SINGLETON = new Cache();
+
+    /**
+     * Get the MetaClassLoader for a ClassLoader. If possible, an existing
+     * MetaClassLoader is returned. Otherwise, the MetaClassLoader is created.
+     * 
+     * @param classLoader
+     *            The ClassLoader for which metadata is desired (may be be null,
+     *            for the bootstrap ClassLoader)
+     * @return The metadata about a ClassLoader
+     */
+    public MetaClassLoader getClassLoader(ClassLoader classLoader);
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaRegistry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaType.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaType.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaType.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaType.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,35 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan;
+
+/**
+ * Metadata about a method parameter or return value
+ */
+public interface MetaType {
+    /**
+     * Get metadata about the type
+     * 
+     * @return null, if the corresponding type is an array type; otherwise,
+     *         metadata about the type
+     */
+    MetaClass getMetaClass();
+
+    /**
+     * Get metadata about the type
+     * 
+     * @return null, if the corresponding type is not an array type; otherwise,
+     *         metadata about the array type's component type
+     */
+    MetaType getArrayMetaType();
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/MetaType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/AnnotationMap.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/AnnotationMap.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/AnnotationMap.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/AnnotationMap.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,38 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan.bcel;
+
+import org.apache.bcel.classfile.AnnotationEntry;
+import org.apache.commons.classscan.util.ArrayTransformer;
+import org.apache.commons.classscan.util.SortedReadOnlySet;
+
+public class AnnotationMap extends SortedReadOnlySet<BcelAnnotation> {
+
+    AnnotationMap(MetaUrlClassLoader classLoader, AnnotationEntry[] entries) {
+        super(transformEntries(classLoader, entries));
+    }
+
+    static private BcelAnnotation[] transformEntries(final MetaUrlClassLoader classLoader, AnnotationEntry[] entries) {
+        if(entries==null || entries.length==0) {
+            return null;
+        }
+        return new ArrayTransformer<AnnotationEntry, BcelAnnotation>(entries) {
+            @Override
+            protected BcelAnnotation transformElement(AnnotationEntry src) {
+                return new BcelAnnotation(classLoader, src);
+            }
+
+        }.transform(BcelAnnotation.class);
+    }
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/AnnotationMap.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/ArrayMetaType.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/ArrayMetaType.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/ArrayMetaType.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/ArrayMetaType.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,36 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan.bcel;
+
+import org.apache.commons.classscan.MetaClass;
+import org.apache.commons.classscan.MetaType;
+
+public class ArrayMetaType implements MetaType {
+
+    private final MetaType metaType;
+
+    ArrayMetaType(MetaType metaType) {
+        this.metaType = metaType;
+    }
+
+    @Override
+    public MetaClass getMetaClass() {
+        return null;
+    }
+
+    @Override
+    public MetaType getArrayMetaType() {
+        return metaType;
+    }
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/ArrayMetaType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelAnnotation.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelAnnotation.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelAnnotation.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelAnnotation.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,72 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan.bcel;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+import org.apache.bcel.classfile.AnnotationEntry;
+import org.apache.bcel.classfile.ElementValuePair;
+import org.apache.commons.classscan.MetaAnnotation;
+import org.apache.commons.classscan.util.ReadOnlySet;
+
+public class BcelAnnotation implements MetaAnnotation {
+
+    private final String name;
+    private final Map<String, Property> properties;
+    private final Set<Property> readOnlyProperties;
+
+    public BcelAnnotation(MetaUrlClassLoader classLoader, AnnotationEntry annotation) {
+        name = MetaUrlClassLoader.internalToCanonicalName(annotation.getAnnotationType());
+
+        ElementValuePair[] elementValuePairs = annotation.getElementValuePairs();
+        if (elementValuePairs.length == 0) {
+            properties = Collections.emptyMap();
+            readOnlyProperties = Collections.emptySet();
+        }
+        else {
+            // really should use a radix map to minimize memory footprint and
+            // fetch time
+            properties = new TreeMap<String, Property>();
+            readOnlyProperties = new ReadOnlySet<Property>(fillMapAndArray(classLoader, elementValuePairs));
+        }
+    }
+
+    private Property[] fillMapAndArray(MetaUrlClassLoader classLoader, ElementValuePair[] evPairs) {
+        Property[] values = new Property[evPairs.length];
+        for (int i = 0; i < evPairs.length; ++i) {
+            Property property = new BcelProperty(classLoader, evPairs[i]);
+            properties.put(property.getName(), property);
+            values[i] = property;
+        }
+        return values;
+    }
+
+    @Override
+    public String getName() {
+        return name;
+    }
+
+    @Override
+    public Set<? extends Property> getProperties() {
+        return readOnlyProperties;
+    }
+
+    @Override
+    public Property getProperty(String propertyName) {
+        return properties.get(propertyName);
+    }
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelAnnotation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelClass.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelClass.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelClass.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelClass.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,192 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan.bcel;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Set;
+
+import org.apache.bcel.classfile.ClassFormatException;
+import org.apache.bcel.classfile.ClassParser;
+import org.apache.bcel.classfile.Field;
+import org.apache.bcel.classfile.JavaClass;
+import org.apache.bcel.classfile.Method;
+import org.apache.commons.classscan.MetaAnnotation;
+import org.apache.commons.classscan.MetaClass;
+import org.apache.commons.classscan.MetaClassLocation;
+import org.apache.commons.classscan.MetaField;
+import org.apache.commons.classscan.MetaMethod;
+import org.apache.commons.classscan.bcel.MetaUrlClassLoader.DelegateOption;
+import org.apache.commons.classscan.util.ArrayTransformer;
+import org.apache.commons.classscan.util.ReadOnlySet;
+
+public class BcelClass implements MetaClass {
+
+    private final MetaClassLocation location;
+    private final String canonicalName;
+    private final MetaClass parent;
+    private final Set<MetaClass> interfaces;
+    private final AnnotationMap annotations;
+    private final Set<MetaMethod> methods;
+    private final Set<MetaField> fields;
+
+    BcelClass(MetaClassLocation location, MetaUrlClassLoader classLoader, ClassParser parser) throws ClassFormatException, IOException {
+        this.location = location;
+        JavaClass bcelClass = parser.parse();
+        canonicalName = bcelClass.getClassName();
+        parent = createParent(classLoader, bcelClass);
+        interfaces = createInterfaces(classLoader, bcelClass.getInterfaceNames());
+        annotations = new AnnotationMap(classLoader, bcelClass.getAnnotationEntries());
+        methods = createMethods(classLoader, bcelClass);
+        fields = createFields(classLoader, bcelClass);
+    }
+
+    @Override
+    public MetaClassLocation getClassLocation() {
+        return location;
+    }
+
+    @Override
+    public String getName() {
+        return canonicalName;
+    }
+
+    @Override
+    public MetaClass getParent() {
+        return parent;
+    }
+
+    private MetaClass createParent(MetaUrlClassLoader classLoader, JavaClass bcelClass) {
+        String superclassName = bcelClass.getSuperclassName();
+        if (superclassName.equals(canonicalName)) { // bcel behaves
+                                                    // unexpectedly, Object's
+                                                    // super class is Object
+            return null;
+        }
+        return classLoader.getMetaClass(superclassName, DelegateOption.CreateDelegate);
+    }
+
+    @Override
+    public Set<MetaClass> getInterfaces() {
+        return interfaces;
+    }
+
+    private Set<MetaClass> createInterfaces(final MetaUrlClassLoader classLoader, String[] interfaceNames) {
+        if (interfaceNames.length == 0) {
+            return Collections.emptySet();
+        }
+        MetaClass[] metaClasses = new ArrayTransformer<String, MetaClass>(interfaceNames) {
+            @Override
+            protected MetaClass transformElement(String interfaceName) {
+                MetaClass mc = classLoader.getMetaClass(interfaceName, DelegateOption.CreateDelegate);
+                if (mc == null) {
+                    throw new IllegalStateException();
+                }
+                return mc;
+            }
+        }.transform(MetaClass.class);
+        return new ReadOnlySet<MetaClass>(metaClasses);
+    }
+
+    @Override
+    public Set<? extends MetaAnnotation> getAnnotations() {
+        return annotations;
+    }
+
+    @Override
+    public MetaAnnotation getAnnotation(String annotationName) {
+        return annotations.getValue(annotationName);
+    }
+
+    @Override
+    public Set<MetaMethod> getMethods() {
+        return methods;
+    }
+
+    private Set<MetaMethod> createMethods(final MetaUrlClassLoader classLoader, JavaClass bcelClass) {
+        Method[] methods = bcelClass.getMethods();
+        if (methods.length == 0) {
+            return Collections.emptySet();
+        }
+        MetaMethod[] metaMethods = new ArrayTransformer<Method, MetaMethod>(methods) {
+            @Override
+            protected MetaMethod transformElement(Method method) {
+                return new BcelMethod(classLoader, method);
+            }
+        }.transform(MetaMethod.class);
+        return new ReadOnlySet<MetaMethod>(metaMethods);
+    }
+
+    @Override
+    public Set<MetaField> getFields() {
+        return fields;
+    }
+
+    private Set<MetaField> createFields(final MetaUrlClassLoader classLoader, JavaClass bcelClass) {
+        Field[] fields = bcelClass.getFields();
+        if (fields.length == 0) {
+            return Collections.emptySet();
+        }
+        MetaField[] metaFields = new ArrayTransformer<Field, MetaField>(fields) {
+            @Override
+            protected MetaField transformElement(Field field) {
+                return new BcelField(classLoader, field);
+            }
+        }.transform(MetaField.class);
+        return new ReadOnlySet<MetaField>(metaFields);
+    }
+
+    @Override
+    public boolean isAssignableFrom(MetaClass assignor) {
+        do {
+            if (isAssignableFromAnyInterface(assignor)) {
+                return true;
+            }
+            assignor = assignor.getParent();
+        }
+        while (assignor != null);
+        return false;
+    }
+
+    private boolean isAssignableFromAnyInterface(MetaClass assignor) {
+        if (equals(assignor)) {
+            return true;
+        }
+        for (MetaClass derived : assignor.getInterfaces()) {
+            if (isAssignableFromAnyInterface(derived)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (!(obj instanceof MetaClass)) {
+            return false;
+        }
+        MetaClass other = (MetaClass) obj;
+        return canonicalName.equals(other.getName()) && location.equals(other.getClassLocation());
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 33;
+        int result = 1;
+        result = prime * result + canonicalName.hashCode();
+        result = prime * result + location.hashCode();
+        return result;
+    }
+
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelClass.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelEnumProperty.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelEnumProperty.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelEnumProperty.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelEnumProperty.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,37 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan.bcel;
+
+import org.apache.commons.classscan.MetaAnnotation;
+import org.apache.commons.classscan.MetaClass;
+
+public class BcelEnumProperty implements MetaAnnotation.EnumValue {
+    final private MetaClass enumType;
+    final private String enumValue;
+
+    public BcelEnumProperty(MetaClass enumType, String enumValue) {
+        this.enumType = enumType;
+        this.enumValue = enumValue;
+    }
+
+    @Override
+    public MetaClass getEnumType() {
+        return enumType;
+    }
+
+    @Override
+    public String getEnumValue() {
+        return enumValue;
+    }
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelEnumProperty.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelField.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelField.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelField.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelField.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,61 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan.bcel;
+
+import java.util.Set;
+
+import org.apache.bcel.classfile.Field;
+import org.apache.commons.classscan.MetaAnnotation;
+import org.apache.commons.classscan.MetaField;
+import org.apache.commons.classscan.MetaType;
+
+public class BcelField implements MetaField {
+
+    private final MetaType metaType;
+    private final String fieldName;
+    private final boolean isStatic;
+    private final AnnotationMap annotations;
+
+    public BcelField(MetaUrlClassLoader classLoader, Field field) {
+        fieldName = field.getName();
+        isStatic = field.isStatic();
+        metaType = classLoader.getTypeForDescriptor(field.getSignature());
+        annotations = new AnnotationMap(classLoader, field.getAnnotationEntries());
+    }
+
+    @Override
+    public String getName() {
+        return fieldName;
+    }
+
+    @Override
+    public Set<? extends MetaAnnotation> getAnnotations() {
+        return annotations;
+    }
+
+    @Override
+    public MetaAnnotation getAnnotation(String annotationName) {
+        return annotations.getValue(annotationName);
+    }
+
+    @Override
+    public boolean isStatic() {
+        return isStatic;
+    }
+
+    @Override
+    public MetaType getType() {
+        return metaType;
+    }
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelField.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelMethod.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelMethod.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelMethod.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelMethod.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,97 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan.bcel;
+
+import java.util.Collections;
+import java.util.Set;
+
+import org.apache.bcel.classfile.Method;
+import org.apache.bcel.classfile.ParameterAnnotationEntry;
+import org.apache.bcel.generic.Type;
+import org.apache.commons.classscan.MetaAnnotation;
+import org.apache.commons.classscan.MetaMethod;
+import org.apache.commons.classscan.MetaParameter;
+import org.apache.commons.classscan.MetaType;
+import org.apache.commons.classscan.util.ReadOnlySet;
+
+public class BcelMethod implements MetaMethod {
+
+    private final MetaType returnType;
+    private final Set<MetaParameter> paramTypes;
+
+    private final String methodName;
+    private final String typeDescriptor;
+    private final boolean isStatic;
+    private final AnnotationMap annotations;
+
+    public BcelMethod(MetaUrlClassLoader classLoader, Method method) {
+        methodName = method.getName();
+        typeDescriptor = method.getReturnType().getSignature();
+        isStatic = method.isStatic();
+        annotations = new AnnotationMap(classLoader, method.getAnnotationEntries());
+        paramTypes = createParameters(classLoader, method);
+        returnType = classLoader.getTypeForDescriptor(typeDescriptor);
+    }
+
+    @Override
+    public String getName() {
+        return methodName;
+    }
+
+    @Override
+    public Set<? extends MetaAnnotation> getAnnotations() {
+        return annotations;
+    }
+
+    @Override
+    public MetaAnnotation getAnnotation(String annotationName) {
+        return annotations.getValue(annotationName);
+    }
+
+    @Override
+    public boolean isStatic() {
+        return isStatic;
+    }
+
+    @Override
+    public MetaType getType() {
+        return returnType;
+    }
+
+    @Override
+    public Set<MetaParameter> getParameters() {
+        return paramTypes;
+    }
+
+    private Set<MetaParameter> createParameters(final MetaUrlClassLoader classLoader, Method method) {
+        final Type[] types = method.getArgumentTypes();
+        if (types.length == 0) {
+            return Collections.emptySet();
+        }
+
+        final ParameterAnnotationEntry[] parameterAnnotations = method.getParameterAnnotationEntries();
+        ReadOnlySet<MetaParameter> parameters = new ReadOnlySet<MetaParameter>() {
+            MetaParameter[] metaParameterArray = new MetaParameter[types.length];
+            {
+                for (int i = 0; i < metaParameterArray.length; ++i) {
+                    // there may be less annotations than parameters
+                    ParameterAnnotationEntry arg = i < parameterAnnotations.length ? parameterAnnotations[i] : null;
+                    metaParameterArray[i] = new BcelParameter(classLoader, types[i], arg);
+                }
+                setValues(metaParameterArray);
+            }
+        };
+        return parameters;
+    }
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelMethod.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelParameter.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelParameter.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelParameter.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelParameter.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,48 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan.bcel;
+
+import java.util.Set;
+
+import org.apache.bcel.classfile.ParameterAnnotationEntry;
+import org.apache.bcel.generic.Type;
+import org.apache.commons.classscan.MetaAnnotation;
+import org.apache.commons.classscan.MetaParameter;
+import org.apache.commons.classscan.MetaType;
+
+public class BcelParameter implements MetaParameter {
+
+    private final MetaType type;
+    private final AnnotationMap annotations;
+
+    public BcelParameter(MetaUrlClassLoader classLoader, Type argType, ParameterAnnotationEntry annotationEntry) {
+        annotations = new AnnotationMap(classLoader, annotationEntry != null ? annotationEntry.getAnnotationEntries() : null);
+        type = classLoader.getTypeForDescriptor(argType.getSignature());
+    }
+
+    @Override
+    public Set<? extends MetaAnnotation> getAnnotations() {
+        return annotations;
+    }
+
+    @Override
+    public MetaAnnotation getAnnotation(String annotationName) {
+        return annotations.getValue(annotationName);
+    }
+
+    @Override
+    public MetaType getType() {
+        return type;
+    }
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelParameter.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelProperty.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelProperty.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelProperty.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelProperty.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,121 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan.bcel;
+
+import org.apache.bcel.classfile.AnnotationElementValue;
+import org.apache.bcel.classfile.AnnotationEntry;
+import org.apache.bcel.classfile.ArrayElementValue;
+import org.apache.bcel.classfile.ClassElementValue;
+import org.apache.bcel.classfile.ElementValue;
+import org.apache.bcel.classfile.ElementValuePair;
+import org.apache.bcel.classfile.EnumElementValue;
+import org.apache.bcel.classfile.SimpleElementValue;
+import org.apache.commons.classscan.MetaClass;
+import org.apache.commons.classscan.MetaAnnotation.Property;
+
+public class BcelProperty implements Property {
+
+    private final String propertyName;
+    private final Object value;
+
+    public BcelProperty(MetaUrlClassLoader classLoader, ElementValuePair evPair) {
+        propertyName = evPair.getNameString();
+        value = createObject(classLoader, evPair.getValue());
+    }
+
+    @Override
+    public String getName() {
+        return propertyName;
+    }
+
+    @Override
+    public Object getValue() {
+        return value;
+    }
+
+    private Object createObject(MetaUrlClassLoader classLoader, ElementValue ev) {
+        if (ev instanceof SimpleElementValue) {
+            return createWrapper(classLoader, (SimpleElementValue) ev);
+        }
+        if (ev instanceof EnumElementValue) {
+            return createEnum(classLoader, (EnumElementValue) ev);
+        }
+        if (ev instanceof ClassElementValue) {
+            return createMetaClass(classLoader, (ClassElementValue) ev);
+        }
+        if (ev instanceof ArrayElementValue) {
+            return createArray(classLoader, (ArrayElementValue) ev);
+        }
+        if (ev instanceof AnnotationElementValue) {
+            return createAnnotation(classLoader, (AnnotationElementValue) ev);
+        }
+        throw new IllegalArgumentException(((char) ev.getElementValueType()) + " is not a valid fieldDescriptor");
+    }
+
+    private Object createWrapper(MetaUrlClassLoader classLoader, SimpleElementValue sev) {
+        char primitiveTypeCode = (char) sev.getElementValueType();
+
+        switch (primitiveTypeCode) {
+        case 'B':
+            return sev.getValueByte();
+        case 'C':
+            return sev.getValueChar();
+        case 'D':
+            return sev.getValueDouble();
+        case 'F':
+            return sev.getValueFloat();
+        case 'I':
+            return sev.getValueInt();
+        case 'J':
+            return sev.getValueLong();
+        case 'S':
+            return sev.getValueShort();
+        case 'Z':
+            return sev.getValueBoolean();
+        case 's':
+            return sev.getValueString();
+        default:
+            throw new IllegalArgumentException(((char) primitiveTypeCode) + " is not a valid fieldDescriptor");
+        }
+    }
+
+    private MetaClass createMetaClass(MetaUrlClassLoader classLoader, ClassElementValue ev) {
+        String internalClassName = ev.getClassString();
+        String canonicalName = MetaUrlClassLoader.internalToCanonicalName(internalClassName);
+        return new DeferredMetaClass(classLoader, canonicalName);
+    }
+
+    private Object createAnnotation(MetaUrlClassLoader classLoader, AnnotationElementValue aev) {
+        AnnotationEntry ae = ((AnnotationElementValue) aev).getAnnotationEntry();
+        return new BcelAnnotation(classLoader, ae);
+    }
+
+    private Object createEnum(MetaUrlClassLoader classLoader, EnumElementValue eev) {
+        String enumTypeString = MetaUrlClassLoader.internalToCanonicalName(eev.getEnumTypeString());
+        MetaClass dmc = new DeferredMetaClass(classLoader, enumTypeString);
+        String enumInstanceName = eev.getEnumValueString();
+        return new BcelEnumProperty(dmc, enumInstanceName);
+    }
+
+    private Object[] createArray(MetaUrlClassLoader classLoader, ArrayElementValue ev) {
+        ArrayElementValue aev = (ArrayElementValue) ev;
+        ElementValue[] elementValues = aev.getElementValuesArray();
+        Object[] returnValues = new Object[elementValues.length];
+        int i = 0;
+        for (ElementValue elementValue : elementValues) {
+            returnValues[i++] = createObject(classLoader, elementValue);
+        }
+        return returnValues;
+    }
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BcelProperty.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BootstrapClassLoader.java
URL: http://svn.apache.org/viewvc/commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BootstrapClassLoader.java?rev=1344950&view=auto
==============================================================================
--- commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BootstrapClassLoader.java (added)
+++ commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BootstrapClassLoader.java Fri Jun  1 00:27:39 2012
@@ -0,0 +1,111 @@
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.commons.classscan.bcel;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.regex.Pattern;
+
+import org.apache.commons.classscan.MetaClass;
+import org.apache.commons.classscan.MetaType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class BootstrapClassLoader extends MetaUrlClassLoader {
+
+    private static final Logger logger = LoggerFactory.getLogger(BootstrapClassLoader.class);
+
+    private static Pattern PATH_SPLITTER = Pattern.compile(File.pathSeparator);
+
+    BootstrapClassLoader() {
+        super(null);
+        addLocationsFromBootClassPath();
+        sealClassLoader();
+    }
+
+    private void addLocationsFromBootClassPath() {
+        String bootClassPath = System.getProperty("sun.boot.class.path");
+
+        for (String bcp : PATH_SPLITTER.split(bootClassPath)) {
+            File location = new File(bcp);
+            if (!location.exists()) {
+                continue;
+            }
+            try {
+                URI uri = location.toURI();
+                if (!location.isDirectory()) {
+                    uri = new URI("jar:" + uri + "!/");
+                }
+                addLocation(uri);
+            }
+            catch (URISyntaxException ex) {
+                logger.warn("failure translating " + location + " to url", ex);
+            }
+        }
+    }
+
+    @Override
+    public MetaClass findMetaClass(String className) {
+        return getMetaClass(className);
+    }
+
+    /*
+     * BaseType: B C D F I J S Z (V)
+     */
+    @Override
+    MetaType getPrimitiveTypeForDescriptor(char typeCode) {
+        Class<?> primitiveType = getClassForPrimitiveTypeCode(typeCode);
+        String primitiveName = primitiveType.getCanonicalName();
+        return new ClassMetaType(getPrimitiveClass(primitiveName));
+    }
+
+    private Class<?> getClassForPrimitiveTypeCode(char typeCode) {
+        switch (typeCode) {
+        case 'B':
+            return Byte.TYPE;
+        case 'C':
+            return Character.TYPE;
+        case 'D':
+            return Double.TYPE;
+        case 'F':
+            return Float.TYPE;
+        case 'I':
+            return Integer.TYPE;
+        case 'J':
+            return Long.TYPE;
+        case 'S':
+            return Short.TYPE;
+        case 'Z':
+            return Boolean.TYPE;
+        case 'V':
+            return Void.TYPE;
+        default:
+            throw new IllegalArgumentException(typeCode + " is not a valid primitive type code");
+        }
+    }
+
+    private MetaClass getPrimitiveClass(String primitiveName) {
+        if (sealedClasses != null) {
+            return sealedClasses.getValue(primitiveName);
+        }
+
+        MetaClass metaClass = workClasses.get(primitiveName);
+        if (metaClass == null) {
+            metaClass = new PrimitiveClass(primitiveName);
+            workClasses.put(primitiveName, metaClass);
+        }
+        return metaClass;
+    }
+}

Propchange: commons/sandbox/classscan/trunk/src/main/java/org/apache/commons/classscan/bcel/BootstrapClassLoader.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message