mirror of
https://github.com/apache/struts.git
synced 2026-08-06 23:27:07 +00:00
Adds some JavaDocs
This commit is contained in:
-12
@@ -158,18 +158,6 @@ public class Java8ClassFinder implements ClassFinder {
|
||||
return infos != null && !infos.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of classes that could not be loaded in last invoked findAnnotated* method.
|
||||
* <p/>
|
||||
* The list will only contain entries of classes whose byte code matched the requirements
|
||||
* of last invoked find* method, but were unable to be loaded and included in the results.
|
||||
* <p/>
|
||||
* The list returned is unmodifiable. Once obtained, the returned list will be a live view of the
|
||||
* results from the last findAnnotated* method call.
|
||||
* <p/>
|
||||
* This method is not thread safe.
|
||||
* @return an unmodifiable live view of classes that could not be loaded in previous findAnnotated* call.
|
||||
*/
|
||||
public List<String> getClassesNotLoaded() {
|
||||
return Collections.unmodifiableList(classesNotLoaded);
|
||||
}
|
||||
|
||||
@@ -8,10 +8,34 @@ import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* ClassFinder searches the classpath of the specified ClassLoaderInterface for
|
||||
* packages, classes, constructors, methods, or fields with specific annotations.
|
||||
*
|
||||
* For security reasons ASM is used to find the annotations. Classes are not
|
||||
* loaded unless they match the requirements of a called findAnnotated* method.
|
||||
* Once loaded, these classes are cached.
|
||||
*
|
||||
* The getClassesNotLoaded() method can be used immediately after any find*
|
||||
* method to get a list of classes which matched the find requirements (i.e.
|
||||
* contained the annotation), but were unable to be loaded.
|
||||
*/
|
||||
public interface ClassFinder {
|
||||
|
||||
boolean isAnnotationPresent(Class<? extends Annotation> annotation);
|
||||
|
||||
/**
|
||||
* Returns a list of classes that could not be loaded in last invoked findAnnotated* method.
|
||||
* <p/>
|
||||
* The list will only contain entries of classes whose byte code matched the requirements
|
||||
* of last invoked find* method, but were unable to be loaded and included in the results.
|
||||
* <p/>
|
||||
* The list returned is unmodifiable. Once obtained, the returned list will be a live view of the
|
||||
* results from the last findAnnotated* method call.
|
||||
* <p/>
|
||||
* This method is not thread safe.
|
||||
* @return an unmodifiable live view of classes that could not be loaded in previous findAnnotated* call.
|
||||
*/
|
||||
List<String> getClassesNotLoaded();
|
||||
|
||||
List<Package> findAnnotatedPackages(Class<? extends Annotation> annotation);
|
||||
|
||||
@@ -1,9 +1,27 @@
|
||||
/*
|
||||
* Copyright 2002-2003,2009 The Apache Software Foundation.
|
||||
*
|
||||
* 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 com.opensymphony.xwork2.util.finder;
|
||||
|
||||
import java.net.URL;
|
||||
import java.util.Collection;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* Allows create different ClassFinders which should help support different Java versions
|
||||
*/
|
||||
public interface ClassFinderFactory {
|
||||
|
||||
ClassFinder buildClassFinder(ClassLoaderInterface classLoaderInterface, Collection<URL> urls, boolean extractBaseInterfaces, Set<String> protocols, Test<String> classNameFilter);
|
||||
|
||||
@@ -51,21 +51,6 @@ import java.util.Set;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarInputStream;
|
||||
|
||||
/**
|
||||
* ClassFinder searches the classpath of the specified ClassLoaderInterface for
|
||||
* packages, classes, constructors, methods, or fields with specific annotations.
|
||||
*
|
||||
* For security reasons ASM is used to find the annotations. Classes are not
|
||||
* loaded unless they match the requirements of a called findAnnotated* method.
|
||||
* Once loaded, these classes are cached.
|
||||
*
|
||||
* The getClassesNotLoaded() method can be used immediately after any find*
|
||||
* method to get a list of classes which matched the find requirements (i.e.
|
||||
* contained the annotation), but were unable to be loaded.
|
||||
*
|
||||
* @author David Blevins
|
||||
* @version $Rev$ $Date$
|
||||
*/
|
||||
public class DefaultClassFinder implements ClassFinder {
|
||||
private static final Logger LOG = LoggerFactory.getLogger(DefaultClassFinder.class);
|
||||
|
||||
@@ -165,18 +150,6 @@ public class DefaultClassFinder implements ClassFinder {
|
||||
return infos != null && !infos.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of classes that could not be loaded in last invoked findAnnotated* method.
|
||||
* <p/>
|
||||
* The list will only contain entries of classes whose byte code matched the requirements
|
||||
* of last invoked find* method, but were unable to be loaded and included in the results.
|
||||
* <p/>
|
||||
* The list returned is unmodifiable. Once obtained, the returned list will be a live view of the
|
||||
* results from the last findAnnotated* method call.
|
||||
* <p/>
|
||||
* This method is not thread safe.
|
||||
* @return an unmodifiable live view of classes that could not be loaded in previous findAnnotated* call.
|
||||
*/
|
||||
public List<String> getClassesNotLoaded() {
|
||||
return Collections.unmodifiableList(classesNotLoaded);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user