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