All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.feilong.lib.xstream.core.util.ClassLoaderReference Maven / Gradle / Ivy

Go to download

feilong is a suite of core and expanded libraries that include utility classes, http, excel,cvs, io classes, and much much more.

There is a newer version: 4.0.8
Show newest version
/*
 * Copyright (C) 2005 Joe Walnes.
 * Copyright (C) 2006, 2007, 2013 XStream Committers.
 * All rights reserved.
 *
 * The software in this package is published under the terms of the BSD
 * style license a copy of which has been included with this distribution in
 * the LICENSE.txt file.
 * 
 * Created on 07. March 2005 by Joe Walnes
 */
package com.feilong.lib.xstream.core.util;

/**
 * ClassLoader that refers to another ClassLoader, allowing a single instance to be passed around the codebase that
 * can later have its destination changed.
 *
 * @author Joe Walnes
 * @author Jörg Schaible
 * @since 1.1.1
 * @deprecated As of 1.4.5 use {@link com.feilong.lib.xstream.core.ClassLoaderReference} instead
 */
@Deprecated
public class ClassLoaderReference extends ClassLoader{

    private transient ClassLoader reference;

    /**
     * @deprecated As of 1.4.5 use
     *             {@link com.feilong.lib.xstream.core.ClassLoaderReference#ClassLoaderReference(ClassLoader)}
     *             instead
     */
    @Deprecated
    public ClassLoaderReference(ClassLoader reference){
        this.reference = reference;
    }

    /**
     * @deprecated As of 1.4.5 use
     *             {@link com.feilong.lib.xstream.core.ClassLoaderReference#getReference()}
     *             .loadClass(String) instead
     */
    @Deprecated
    @Override
    public Class loadClass(String name) throws ClassNotFoundException{
        return reference.loadClass(name);
    }

    /**
     * @deprecated As of 1.4.5 use
     *             {@link com.feilong.lib.xstream.core.ClassLoaderReference#getReference()}
     *             instead
     */
    @Deprecated
    public ClassLoader getReference(){
        return reference;
    }

    /**
     * @deprecated As of 1.4.5 use
     *             {@link com.feilong.lib.xstream.core.ClassLoaderReference#setReference(ClassLoader)}
     *             instead
     */
    @Deprecated
    public void setReference(ClassLoader reference){
        this.reference = reference;
    }

    private Object writeReplace(){
        return new Replacement();
    }

    static class Replacement{

        private Object readResolve(){
            return new ClassLoaderReference(new CompositeClassLoader());
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy