org.sape.carbon.core.config.type.handlers
Class LongTypeHandler

java.lang.Object
  |
  +--org.sape.carbon.core.config.type.handlers.LongTypeHandler
All Implemented Interfaces:
ConfigurationTypeHandler

public class LongTypeHandler
extends Object
implements ConfigurationTypeHandler

Parses and formats between Strings and Longs.

Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.10 $($Author: dvoet $ / $Date: 2003/05/05 21:21:20 $)
Author:
Greg Hinkle, January 2002

Constructor Summary
LongTypeHandler()
           
 
Method Summary
 Object toObject(Class type, String stringValue)
          Parses a string into a Long object.
 String toString(Object objectValue)
          Formats an Long into a String value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LongTypeHandler

public LongTypeHandler()
Method Detail

toObject

public Object toObject(Class type,
                       String stringValue)
                throws TypeConversionException

Parses a string into a Long object.

Specified by:
toObject in interface ConfigurationTypeHandler
Parameters:
type - String
stringValue - the String representation of the requested Long
Returns:
Long version of the String
Throws:
TypeConversionException - when the string does not represent a valid Long

toString

public String toString(Object objectValue)

Formats an Long into a String value.

Specified by:
toString in interface ConfigurationTypeHandler
Parameters:
objectValue - the Long to be formatted
Returns:
the String version of the Long
Throws:
ClassCastException - when past an object other than a Long


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.