1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.joda.time.contrib.jsptag;
18
19 import java.util.Locale;
20
21 import javax.servlet.jsp.JspTagException;
22
23 import org.joda.time.DateTimeZone;
24
25
26
27
28
29
30
31
32
33
34 public class ParseDateTimeTag extends ParseDateTimeSupport {
35
36
37
38
39
40
41 public void setValue(String value) throws JspTagException {
42 this.value = value;
43 this.valueSpecified = true;
44 }
45
46
47
48
49
50
51 public void setStyle(String style) throws JspTagException {
52 this.style = style;
53 }
54
55
56
57
58
59
60 public void setPattern(String pattern) throws JspTagException {
61 this.pattern = pattern;
62 }
63
64
65
66
67
68
69 public void setDateTimeZone(Object dtz) throws JspTagException {
70 if (dtz == null || dtz instanceof String
71 && ((String) dtz).length() == 0) {
72 this.dateTimeZone = null;
73 } else if (dtz instanceof DateTimeZone) {
74 this.dateTimeZone = (DateTimeZone) dtz;
75 } else {
76 try {
77 this.dateTimeZone = DateTimeZone.forID((String) dtz);
78 } catch (IllegalArgumentException iae) {
79 this.dateTimeZone = DateTimeZone.UTC;
80 }
81 }
82 }
83
84
85
86
87
88
89 public void setLocale(Object loc) throws JspTagException {
90 if (loc == null
91 || (loc instanceof String && ((String) loc).length() == 0)) {
92 this.locale = null;
93 } else if (loc instanceof Locale) {
94 this.locale = (Locale) loc;
95 } else {
96 locale = Util.parseLocale((String) loc);
97 }
98 }
99
100 }