ch.tatool.core.data
Class StringConverter

java.lang.Object
  extended by ch.tatool.core.data.StringConverter

public class StringConverter
extends Object

Contains handler methods that convert a String into other object types

Author:
Michael Ruflin

Nested Class Summary
static interface StringConverter.Converter<T>
           
 
Method Summary
static boolean containsConverter(Class<?> type)
           
static Object convert(String s, Class<?> type)
          Converts a String into another object type.
static void registerConverter(Class<?> c, StringConverter.Converter<?> converter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

registerConverter

public static void registerConverter(Class<?> c,
                                     StringConverter.Converter<?> converter)

containsConverter

public static boolean containsConverter(Class<?> type)

convert

public static Object convert(String s,
                             Class<?> type)
Converts a String into another object type.

Parameters:
s - the string to convert
Throws:
RuntimeException - if conversion is not possible.


Copyright © 2012. All Rights Reserved.