001    /*******************************************************************************
002     * Copyright (C) PicoContainer Organization. All rights reserved.
003     * ---------------------------------------------------------------------------
004     * The software in this package is published under the terms of the BSD style
005     * license a copy of which has been included with this distribution in the
006     * LICENSE.txt file.
007     ******************************************************************************/
008    package org.picocontainer.script.xml;
009    
010    import com.thoughtworks.xstream.XStream;
011    import com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider;
012    
013    /**
014     * Implementation of XMLComponentInstanceFactory that uses XStream to unmarshal
015     * DOM elements in PureJava mode. In PureJava mode objects are instantiated
016     * using standard Java reflection, which is garanteed to be valid for all JVM
017     * vendors, but the types of objects that can be constructed are limited. See
018     * XStream's <a href="http://xstream.codehaus.org/faq.html">FAQ</a> for details
019     * on the differences between PureJava and Advanced mode.
020     * 
021     * @author Mauro Talevi
022     */
023    public class PureJavaXStreamComponentInstanceFactory extends XStreamComponentInstanceFactory {
024        /**
025         * Creates a PureJavaXStreamComponentInstanceFactory using an instance of
026         * XStream in PureJava mode.
027         */
028        public PureJavaXStreamComponentInstanceFactory() {
029            super(new XStream(new PureJavaReflectionProvider()));
030        }
031    
032    }