|
What this is
Other links
The source code
/*****************************************************************************
* Copyright (C) PicoContainer Organization. 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. *
*****************************************************************************/
package org.picocontainer.visitors;
import org.picocontainer.PicoContainer;
import org.picocontainer.PicoCompositionException;
import java.io.Serializable;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* A PicoVisitor implementation, that calls methods on the components of a specific type.
*
* @author Aslak Hellesøy
* @author Jörg Schaible
*/
public class MethodCallingVisitor extends TraversalCheckingVisitor implements Serializable {
// TODO: we must serialize method with read/writeObject ... and are our parent serializable ???
private transient Method method;
private final Object[] arguments;
private final Class type;
private final boolean visitInInstantiationOrder;
private final List componentInstances;
/**
* Construct a MethodCallingVisitor for a method with arguments.
*
* @param method the {@link Method} to invoke
* @param ofType the type of the components, that will be invoked
* @param visitInInstantiationOrder <code>true if components are visited in instantiation order
* @param arguments the arguments for the method invocation (may be <code>null)
* @throws NullPointerException if <tt>method, or ofType is
|
Copyright 1998-2008 Alvin Alexander
All Rights Reserved.
devdaily.com is based in louisville, kentucky, and this web site is hosted by godaddy.com