83 |
brianR |
1 |
/*
|
|
|
2 |
* Copyright 2011 Brian Rosenberger (Brutex Network)
|
|
|
3 |
*
|
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
|
6 |
* You may obtain a copy of the License at
|
|
|
7 |
*
|
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
9 |
*
|
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
13 |
* See the License for the specific language governing permissions and
|
|
|
14 |
* limitations under the License.
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
package net.brutex.xservices.types;
|
|
|
18 |
|
|
|
19 |
import java.text.SimpleDateFormat;
|
|
|
20 |
import java.util.GregorianCalendar;
|
|
|
21 |
import java.util.TimeZone;
|
|
|
22 |
|
|
|
23 |
import javax.xml.bind.annotation.XmlElement;
|
|
|
24 |
import javax.xml.bind.annotation.XmlType;
|
|
|
25 |
|
|
|
26 |
import net.brutex.xservices.util.BrutexNamespaces;
|
|
|
27 |
|
|
|
28 |
/**
|
|
|
29 |
* @author Brian Rosenberger
|
|
|
30 |
*
|
|
|
31 |
*/
|
|
|
32 |
@XmlType(namespace=BrutexNamespaces.WS_XSERVICES)
|
|
|
33 |
public class DateInfoExtendedType extends DateInfoType {
|
|
|
34 |
|
|
|
35 |
private GregorianCalendar date = null;
|
|
|
36 |
private TimeZone zone = null;
|
|
|
37 |
|
|
|
38 |
@SuppressWarnings("unused")
|
|
|
39 |
public DateInfoExtendedType() {
|
|
|
40 |
super();
|
|
|
41 |
}
|
|
|
42 |
|
|
|
43 |
public DateInfoExtendedType(GregorianCalendar date, TimeZone zone) {
|
|
|
44 |
this.date = date;
|
|
|
45 |
this.zone = zone;
|
|
|
46 |
}
|
|
|
47 |
|
|
|
48 |
@XmlElement(name = "format1")
|
|
|
49 |
public String getFormat1() {
|
|
|
50 |
return DateFormatType.DDMMYYYY.format(date.getTime(), null, null);
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
/**
|
|
|
54 |
* @return
|
|
|
55 |
*/
|
|
|
56 |
@XmlElement(name = "format2")
|
|
|
57 |
public String getFormat2() {
|
|
|
58 |
return DateFormatType.YYYYMMDD.format(date.getTime(), null, null);
|
|
|
59 |
}
|
|
|
60 |
|
|
|
61 |
@XmlElement(name = "format3")
|
|
|
62 |
public String getFormat3() {
|
|
|
63 |
String format = "HH:mm:ss";
|
|
|
64 |
SimpleDateFormat f = new SimpleDateFormat(format);
|
|
|
65 |
return f.format(date.getTime());
|
|
|
66 |
}
|
|
|
67 |
|
|
|
68 |
// yyyy-MM-dd'T'HH:mm:ssZ
|
|
|
69 |
}
|