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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
package wox.serial;

import java.lang.reflect.*;

/**
 * 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 interface WoxHandler
{
    Class getNativeTypeFor( WoxHandlers pWoxHandlers, String pWoxType );

    String getWoxTypeFor( WoxHandlers pWoxHandlers, Class pType, Field pField, boolean pJustType );

    /**
     * Return list of WoxTypes to Handle for ReadObject.  Null means it should be asked, empty means it handles none?
     */
    String[] getForReadObjectWoxTypeNames();

    boolean willReadObjectForWoxType( String pWoxType );

    Object readObject( WoxHandlers pWoxHandlers, WoxReader pWoxReader, XMLreader pReader );

    void writeObject( WoxHandlers pWoxHandlers, WoxWriter pWoxWriter, Object pObject, Field pField, XMLwriter pWriter, boolean pJustType );

    /**
     * Return list of WoxTypes to Handle for ReadObject.  Null means it should be asked, empty means it handles none?
     */
    String[] getForParseFieldValueWoxTypeNames();

    boolean willParseFieldValueForWoxType( String pWoxType );

    Object parseFieldValue( String pFieldValue );

    /**
     * @return null indicates FieldValue not supported by this Handler
     */
    String createFieldValue( Object pFieldValue );

    /**
     * Always returns "false" unless
     * WillParseFieldValueForWoxType would have returned true &&
     * CreateFieldValue would have returned !null &&
     * CreateFieldValue would NEVER return a value with a space in it!
     */
    boolean willFieldValueNeverHaveAnySpaces();

    Object createArrayFor( Class pFieldElementType, String[] pValues );

    Object getNonNullDefaultValue();

    boolean supportsJustTypeWriting();
}

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

Diff revisions: vs.
Revision Author Commited Message
15 Diff Diff GeorgeS picture GeorgeS Fri 19 Feb, 2010 22:29:49 +0000
5 Diff Diff GeorgeS picture GeorgeS Fri 05 Feb, 2010 18:59:04 +0000
4 Diff Diff GeorgeS picture GeorgeS Fri 05 Feb, 2010 18:15:55 +0000
3 GeorgeS picture GeorgeS Thu 04 Feb, 2010 23:53:47 +0000