~ubuntu-branches/ubuntu/vivid/doxia/vivid-proposed

« back to all changes in this revision

Viewing changes to doxia-core/src/main/java/org/apache/maven/doxia/sink/PipelineSink.java

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-10-08 14:20:22 UTC
  • mfrom: (2.3.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091008142022-f6ccxganfr2tbaig
Tags: 1.1-3build1
Upload to karmic, avoiding new version from unstable. LP: #443292.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
import java.lang.reflect.InvocationHandler;
23
23
import java.lang.reflect.Method;
24
24
import java.lang.reflect.Proxy;
 
25
 
25
26
import java.util.List;
26
27
import java.util.Iterator;
27
 
import java.util.ArrayList;
28
28
 
29
29
/**
 
30
 * May be used to invoke the same method on a List of Sinks.
 
31
 *
30
32
 * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
31
 
 * @version $Id: PipelineSink.java 569044 2007-08-23 15:31:11Z jdcasey $
 
33
 * @version $Id: PipelineSink.java 746978 2009-02-23 12:20:33Z vsiveton $
32
34
 */
33
35
public class PipelineSink
34
36
    implements InvocationHandler
35
37
{
36
38
    private List pipeline;
37
39
 
 
40
    /**
 
41
     * Constructs a PipelineSink for a given List of Sinks.
 
42
     *
 
43
     * @param pipeline A List of Sinks.
 
44
     */
38
45
    public PipelineSink( List pipeline )
39
46
    {
40
47
        this.pipeline = pipeline;
41
48
    }
42
49
 
 
50
    /**
 
51
     * Add a Sink to the List of Sinks.
 
52
     *
 
53
     * @param sink the Sink to add.
 
54
     */
43
55
    public void addSink( Sink sink )
44
56
    {
45
57
        pipeline.add( sink );
46
58
    }
47
59
 
 
60
    /**
 
61
     * {@inheritDoc}
 
62
     *
 
63
     * Invoke a Method on this PipelineSink.
 
64
     */
48
65
    public Object invoke( Object proxy, Method method, Object[] args )
49
66
        throws Throwable
50
67
    {
58
75
        return null;
59
76
    }
60
77
 
 
78
    /**
 
79
     * Returns an instance of a PipelineSink as a Sink.
 
80
     *
 
81
     * @param pipeline A List of Sinks.
 
82
     * @return a {@link org.apache.maven.doxia.sink.Sink} object.
 
83
     */
61
84
    public static Sink newInstance( List pipeline )
62
85
    {
63
86
        return (Sink) Proxy.newProxyInstance( PipelineSink.class.getClassLoader(),