1 package rydeen.io;
2
3 import java.io.IOException;
4 import java.io.InputStream;
5
6 import rydeen.ProcessTarget;
7 import rydeen.TargetSource;
8 import rydeen.TargetType;
9
10 class DelegateProcessTarget implements ProcessTarget{
11 private ProcessTarget target;
12 private TargetSource source;
13
14 public DelegateProcessTarget(TargetSource source, ProcessTarget target){
15 this.source = source;
16 this.target = target;
17 }
18
19 @Override
20 public String getName(){
21 return target.getName();
22 }
23
24 @Override
25 public String getClassName(){
26 return target.getClassName();
27 }
28
29 @Override
30 public InputStream getSource() throws IOException{
31 return target.getSource();
32 }
33
34 @Override
35 public TargetType getType(){
36 return target.getType();
37 }
38
39 @Override
40 public TargetSource getTargetSource(){
41 return source;
42 }
43
44 public void setTargetSource(TargetSource source){
45 if(source == null){
46 throw new NullPointerException();
47 }
48 this.source = source;
49 }
50 }