1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 package ca.uhn.hl7v2.model;
28
29 import ca.uhn.hl7v2.HL7Exception;
30 import ca.uhn.hl7v2.Location;
31
32 import org.slf4j.Logger;
33 import org.slf4j.LoggerFactory;
34
35
36
37
38 public class DelegatingMessageVisitor<T extends MessageVisitor> implements MessageVisitor {
39
40 private final T delegate;
41 protected static final Logger LOG = LoggerFactory.getLogger(DelegatingMessageVisitor.class);
42
43
44
45
46 public DelegatingMessageVisitor(T delegate) {
47 this.delegate = delegate;
48 }
49
50
51
52
53 public T getDelegate() {
54 return delegate;
55 }
56
57 public boolean start(Message message) throws HL7Exception {
58 return delegate.start(message);
59 }
60
61 public boolean end(Message message) throws HL7Exception {
62 return delegate.end(message);
63 }
64
65 public boolean start(Group group, Location location) throws HL7Exception {
66 return delegate.start(group, location);
67 }
68
69 public boolean end(Group group, Location location) throws HL7Exception {
70 return delegate.end(group, location);
71 }
72
73 public boolean start(Segment segment, Location location) throws HL7Exception {
74 return delegate.start(segment, location);
75 }
76
77 public boolean end(Segment segment, Location location) throws HL7Exception {
78 return delegate.end(segment, location);
79 }
80
81 public boolean start(Field field, Location location) throws HL7Exception {
82 return delegate.start(field, location);
83 }
84
85 public boolean end(Field Field, Location location) throws HL7Exception {
86 return delegate.end(Field, location);
87 }
88
89 public boolean start(Composite type, Location location) throws HL7Exception {
90 return delegate.start(type, location);
91 }
92
93 public boolean end(Composite type, Location location) throws HL7Exception {
94 return delegate.end(type, location);
95 }
96
97 public boolean visit(Primitive type, Location location) throws HL7Exception {
98 return delegate.visit(type, location);
99 }
100
101 }