Sets the package resolver used to retrieve URLs to packages - Java Reflection

Java examples for Reflection:package

Description

Sets the package resolver used to retrieve URLs to packages

Demo Code

/*//w w  w.  ja  v  a  2 s . com
 * Copyright (c) 2012 Data Harmonisation Panel
 * 
 * All rights reserved. This program and the accompanying materials are made
 * available under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the License,
 * or (at your option) any later version.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this distribution. If not, see <http://www.gnu.org/licenses/>.
 * 
 * Contributors:
 *     HUMBOLDT EU Integrated Project #030962
 *     Data Harmonisation Panel <http://www.dhpanel.eu>
 */
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.net.JarURLConnection;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Enumeration;
import java.util.Iterator;
import java.util.List;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;
import java.util.zip.ZipException;

public class Main{
    /**
     * The package resolver used to retrieve URLs to packages
     */
    private static PackageResolver _packageResolver = new DefaultPackageResolver();
    /**
     * Sets the package resolver used to retrieve URLs to packages
     * 
     * @see #getFilesFromPackage(String)
     * @param res the package resolver
     */
    public static synchronized void setPackageResolver(PackageResolver res) {
        _packageResolver = res;
    }
}

Related Tutorials