1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.jdiagnose.library.web.breadcrumb;
17
18 import java.util.Locale;
19
20 import javax.servlet.http.HttpServletRequest;
21
22 /***
23 * @author jamie
24 */
25 public class ConstantCrumbFactory implements CrumbFactory {
26
27 private String description = null;
28
29 public ConstantCrumbFactory() {}
30
31 public ConstantCrumbFactory(String description) {
32 this.description = description;
33 }
34
35
36
37
38 public Crumb getCrumb(HttpServletRequest request, final String url) {
39 return new Crumb() {
40 public String getUrl() {
41 return url;
42 }
43
44 public String getDescription(Locale locale) {
45 return description;
46 }
47 };
48 }
49
50 public void setDescription(String description) {
51 this.description = description;
52 }
53 }