Spring LDAP Framework

org.springframework.ldap.odm.typeconversion.impl.converters
Class FromStringConverter

java.lang.Object
  extended by org.springframework.ldap.odm.typeconversion.impl.converters.FromStringConverter
All Implemented Interfaces:
Converter

public final class FromStringConverter
extends Object
implements Converter

A Converter from a String to any class which has a single argument public constructor taking a String.

This should only be used as a fall-back converter, as a last attempt.

Author:
Paul Harvey <paul.at.pauls-place.me.uk>

Constructor Summary
FromStringConverter()
           
 
Method Summary
<T> T
convert(Object source, Class<T> toClass)
          Attempt to convert a given object to a named class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FromStringConverter

public FromStringConverter()
Method Detail

convert

public <T> T convert(Object source,
                     Class<T> toClass)
          throws Exception
Description copied from interface: Converter
Attempt to convert a given object to a named class.

Specified by:
convert in interface Converter
Type Parameters:
T - The class to convert to.
Parameters:
source - The object to convert.
toClass - The class to convert to.
Returns:
The converted class or null if the conversion was not possible.
Throws:
Exception - Any exception may be throw by a Converter on error.

Spring LDAP Framework

Copyright © 2005-2010 The Spring LDAP Framework. All Rights Reserved.