Subversion Repositories XServices

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
66 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
package net.brutex.xservices.types;
17
 
18
import javax.xml.bind.annotation.XmlEnum;
19
import javax.xml.bind.annotation.XmlEnumValue;
20
 
21
/**
22
 * Different pre-defined date formats.
23
 *
24
 * @author Brian Rosenberger, bru@brutex.de
25
 */
26
@XmlEnum(value = String.class)
27
public enum DateFormatType {
28
 
29
    /**
30
     * ISO 8601 format (2011-05-24T14:39Z)
31
     */
32
    @XmlEnumValue("ISO 8601")
33
    ISO8601("ISO 8601", "yyyy-MM-dd'T'HH:mm:ssZ"),
34
    /**
35
     * yyyy/mm/dd
36
     */
37
    @XmlEnumValue("yyyy/mm/dd")
38
    YYYYMMDD("yyyy/mm/dd", "yyyy/MM/dd"),
39
 
40
    /**
41
     * dd.mm.yyyy
42
     */
43
    @XmlEnumValue("dd.mm.yyyy")
44
    DDMMYY("dd.mm.yyyy", "dd.MM.yyyy");
45
 
46
    private String value;
47
    private String format;
48
 
49
    DateFormatType(String value, String format) {
50
        this.value = value;
51
        this.format = format;
52
    }
53
 
54
    /**
55
     * Return the value of the enum.
56
     * @return  String representation of the mime type
57
     */
58
    public String value() {
59
        return value;
60
    }
61
 
62
    public String format() {
63
    	return format;
64
    }
65
}