com.sdicons.json.serializer.marshall
Interface MarshallValue

All Known Implementing Classes:
MarshallValueImpl

public interface MarshallValue

This interface represents an object that is the result of converting a JSON structure into a java structure. A dedicated interface is supplied because you cannot know in advance whether the result will be a primitive type or a reference type. This interface lets you investigate which kind of value is returned before you use it.


Field Summary
static int BOOLEAN
           
static int BYTE
           
static int CHAR
           
static int DOUBLE
           
static int FLOAT
           
static int INT
           
static int LONG
           
static int REFERENCE
           
static int SHORT
           
 
Method Summary
 boolean getBoolean()
          Get the primitive boolean value.
 byte getByte()
          Get the primitive byte value.
 char getChar()
          Get the primitive char value.
 double getDouble()
          Get the primitive double value.
 float getFloat()
          Get the primitive float value.
 int getInt()
          Get the primitive int value.
 long getLong()
          Get the primitive long value.
 Object getReference()
          Get the reference to a Java object.
 short getShort()
          Get the primitive short value.
 int getType()
          Get the type of the value so that you can access its value safely.
 

Field Detail

BOOLEAN

static final int BOOLEAN
See Also:
Constant Field Values

BYTE

static final int BYTE
See Also:
Constant Field Values

SHORT

static final int SHORT
See Also:
Constant Field Values

CHAR

static final int CHAR
See Also:
Constant Field Values

INT

static final int INT
See Also:
Constant Field Values

LONG

static final int LONG
See Also:
Constant Field Values

FLOAT

static final int FLOAT
See Also:
Constant Field Values

DOUBLE

static final int DOUBLE
See Also:
Constant Field Values

REFERENCE

static final int REFERENCE
See Also:
Constant Field Values
Method Detail

getBoolean

boolean getBoolean()
                   throws MarshallException
Get the primitive boolean value.

Returns:
The unmarshalled boolean value.
Throws:
MarshallException - If it is not a boolean representation.

getByte

byte getByte()
             throws MarshallException
Get the primitive byte value.

Returns:
The unmarshalled byte value.
Throws:
MarshallException - If it is not a byte representation.

getShort

short getShort()
               throws MarshallException
Get the primitive short value.

Returns:
The unmarshalled short value.
Throws:
MarshallException - If it is not a short representation.

getChar

char getChar()
             throws MarshallException
Get the primitive char value.

Returns:
The unmarshalled char value.
Throws:
MarshallException - If it is not a char representation.

getInt

int getInt()
           throws MarshallException
Get the primitive int value.

Returns:
The unmarshalled int value.
Throws:
MarshallException - If it is not an int representation.

getLong

long getLong()
             throws MarshallException
Get the primitive long value.

Returns:
The unmarshalled long value.
Throws:
MarshallException - If it is not a long representation.

getFloat

float getFloat()
               throws MarshallException
Get the primitive float value.

Returns:
The unmarshalled float value.
Throws:
MarshallException - If it is not a float representation.

getDouble

double getDouble()
                 throws MarshallException
Get the primitive double value.

Returns:
The unmarshalled primitive value.
Throws:
MarshallException - If it is not a double representation.

getReference

Object getReference()
                    throws MarshallException
Get the reference to a Java object.

Returns:
The unmarshalled reference to the Java object.
Throws:
MarshallException - If it is not a reference representation.

getType

int getType()
Get the type of the value so that you can access its value safely.

Returns:
One of the getValues BOOLEAN, BYTE, SHORT CHAR, INT, LONG, FLOAT, DOUBLE, REFERENCE.


Copyright © 2011. All Rights Reserved.