1
2
3
4
5
6
7
8
9
10
11 package org.mule.util;
12
13 import org.mule.api.MuleContext;
14
15 import java.util.ArrayList;
16 import java.util.List;
17
18
19
20
21
22
23
24
25
26
27
28 public abstract class SplashScreen
29 {
30 protected List<String> header = new ArrayList<String>();
31 protected List<String> body = new ArrayList<String>();
32 protected List<String> footer = new ArrayList<String>();
33
34
35
36
37
38
39 final public void setHeader(MuleContext context)
40 {
41 header.clear();
42 doHeader(context);
43 }
44
45 final public void addBody(String line)
46 {
47 doBody(line);
48 }
49
50 final public void setFooter(MuleContext context)
51 {
52 footer.clear();
53 doFooter(context);
54 }
55
56 protected void doHeader(MuleContext context)
57 {
58
59 }
60
61 protected void doBody(String line)
62 {
63 body.add(line);
64 }
65
66 protected void doFooter(MuleContext context)
67 {
68
69 }
70
71 public String toString()
72 {
73 List<String> boilerPlate = new ArrayList<String>(header);
74 boilerPlate.addAll(body);
75 boilerPlate.addAll(footer);
76 return StringMessageUtils.getBoilerPlate(boilerPlate, '*', 70);
77 }
78
79 protected SplashScreen()
80 {
81
82 }
83 }