Subversion Repository Public Repository

WOX2

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package wox.serial;

import org.litesoft.core.typeutils.Objects;
import java.util.*;

/**
 * Version: 1.0
 * Author: Carlos R. Jaimez Gonzalez
 * Author: Simon M. Lucas
 * Site: http://woxserializer.sourceforge.net/
 *
 * Version: 1.5
 * Author: Steven M Lewis
 *
 * Version: 2.0
 * Author: George Smith
 * SVN: http://svn.xp-dev.com/svn/WOX2/
 * Note: XML form for vs 2 is more compact and therefor incompatible with vs 1
 */

public class WOXdateHandler extends AbstractWrappableStringableHandler
{
    public static final WOXdateHandler INSTANCE = new WOXdateHandler();

    protected WOXdateHandler()
    {
        super( Date.class, "date", Date.class );
    }

    @Override
    protected Object nonNullValueParse( String pValue )
    {
        DateTimeConverter zConverter = new DateTimeConverter().attemptParse( pValue );
        if ( zConverter == null )
        {
            throw new ApplicationException( "Bad DateTime format, should have been '" + DateTimeConverter.FORMAT + "', but was: " + pValue );
        }
        return zConverter.toDate();
    }

    @Override
    protected String nonNullValueToString( Object pObject )
    {
        return new DateTimeConverter( (Date) pObject ).toString();
    }
}

Commits for WOX2/trunk/Java/src/wox/serial/WOXdateHandler.java

Diff revisions: vs.
Revision Author Commited Message
17 Diff Diff GeorgeS picture GeorgeS Mon 02 Jun, 2014 23:44:02 +0000

Extracting commonfoundation

15 Diff Diff GeorgeS picture GeorgeS Fri 19 Feb, 2010 22:29:49 +0000
3 GeorgeS picture GeorgeS Thu 04 Feb, 2010 23:53:47 +0000