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 public static String miniSplash(final String message)
57 {
58
59 return StringMessageUtils.getBoilerPlate(message, '+', 60);
60 }
61
62 protected void doHeader(MuleContext context)
63 {
64
65 }
66
67 protected void doBody(String line)
68 {
69 body.add(line);
70 }
71
72 protected void doFooter(MuleContext context)
73 {
74
75 }
76
77 public String toString()
78 {
79 List<String> boilerPlate = new ArrayList<String>(header);
80 boilerPlate.addAll(body);
81 boilerPlate.addAll(footer);
82 return StringMessageUtils.getBoilerPlate(boilerPlate, '*', 70);
83 }
84
85 protected SplashScreen()
86 {
87
88 }
89 }