com.iparelan.util
Interface MarshallingStrategy<T>

Type Parameters:
T - The type of the value to be marshalled.
All Known Implementing Classes:
FileMarshallingStrategy, IntegerMarshallingStrategy

@Copyright(value="Copyright © 2008, Iparelan Solutions, LLC. All rights reserved.")
public interface MarshallingStrategy<T>

A strategy for converting a value to a String (serializing).

Version:
July 2008
Author:
Greg Mattes
To Do:
  1. Consider throwing a checked exception here and in unmarshall, is it so strange for marshalling to fail?

Field Summary
static MarshallingStrategy<File> FILE
           
static MarshallingStrategy<Integer> INTEGER
           
 
Method Summary
 String marshall(T unmarshalled)
          Converts the specified value of type T to a String.
 

Field Detail

FILE

static final MarshallingStrategy<File> FILE

INTEGER

static final MarshallingStrategy<Integer> INTEGER
Method Detail

marshall

@Nullable
String marshall(@Nullable
                         T unmarshalled)
Converts the specified value of type T to a String.

Parameters:
unmarshalled - The value to be marshalled from a T to a String. May be null, in which case null is produced.
Returns:
The marshalled value of unmarshalled. null is considered to be the marshalled value of null.
Throws:
MarshallingException - Iff unmarshalled cannot be marshalled. The exception will have the subtype MarshallingException.SubType.MARSHALLING.


Copyright © 2008 Iparelan Solutions, LLC. All rights reserved.