package org.geotools.xml;

import org.picocontainer.ComponentAdapter;
import org.picocontainer.PicoContainer;
import org.picocontainer.defaults.BasicComponentParameter;

/**
 * A pico container "parameter" which allows one to make setter injection 
 * optional.
 * <p>
 * This class is a hack of pico container... it should be used with care.
 * </p>
 * 
 * @author Justin Deoliveira, The Open Planning Project
 *
 */
public class OptionalComponentParameter extends BasicComponentParameter {

    
    public OptionalComponentParameter() {
        super();
        
    }

    public OptionalComponentParameter(Object componentKey) {
        super(componentKey);
        
    }

    /**
     * Always return true, because since the setter is optional even its not 
     * in teh container we can always resolve to <code>null</code>.
     */
    public boolean isResolvable(PicoContainer container,
            ComponentAdapter adapter, Class expectedType) {
        return true;
    }
}
