dsto.dfc.text
Interface IStringTranslator

All Known Implementing Classes:
BooleanTranslator, DurationConverter, FormatTranslator, NumberTranslator, StringTranslator, URLTranslator

public interface IStringTranslator

Interface for translators that convert to/from string format.

Author:
Matthew Phillips
See Also:
ITranslator, FormatTranslator

Nested Class Summary
static class IStringTranslator.FromString
          Adapts a IStringTranslator to the one-way ITranslator interface.
static class IStringTranslator.ToString
          Adapts a IStringTranslator to the one-way ITranslator interface.
 
Method Summary
 Object fromString(String string)
          Convert/parse a string into the object type supported by this converter.
 String toString(Object value)
          Convert a value to a string.
 

Method Detail

toString

String toString(Object value)
                throws IllegalArgumentException
Convert a value to a string.

Parameters:
value - The value to convert. Null is not guaranteed to be valid.
Returns:
The string equivalent.
Throws:
IllegalArgumentException - if value is an object type understood by the converter.

fromString

Object fromString(String string)
                  throws InvalidFormatException
Convert/parse a string into the object type supported by this converter.

Parameters:
string - The string to convert.
Returns:
The converted object.
Throws:
InvalidFormatException - if the string is not in a format parsable by the converter.


Copyright © 2008 Commonwealth of Australia