com.cc.framework.convert
Class ConverterHelp

java.lang.Object
  extended bycom.cc.framework.convert.ConverterHelp

public class ConverterHelp
extends java.lang.Object

Helper class for Datatype conversions

Version:
$Revision$
Author:
Harald Schulz

Constructor Summary
ConverterHelp()
           
 
Method Summary
static java.lang.Object getAsObject(RequestContext ctx, java.lang.Class dataType, java.lang.String newValue)
          Uses a Bean Converter to convert the given String into an Object.
static java.lang.Object getAsObject(RequestContext ctx, java.lang.Class dataType, java.lang.String[] newValues)
          Uses a Bean Converter to convert the given String Array into an Object Array.
static java.lang.String getAsString(RequestContext ctx, Converter converter, java.lang.Object value)
          Uses a Bean Converter to convert the given object to a String representation.
static Converter getInstance(java.lang.String converterId)
          Retrieves a Converter instance for the given Converter class name
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConverterHelp

public ConverterHelp()
Method Detail

getInstance

public static Converter getInstance(java.lang.String converterId)
                             throws ConverterException
Retrieves a Converter instance for the given Converter class name

Parameters:
converterId - Converter class name (full qualified Java class name)
Returns:
Converter instance
Throws:
ConverterException - Is thrown when the instance could not be created

getAsString

public static java.lang.String getAsString(RequestContext ctx,
                                           Converter converter,
                                           java.lang.Object value)
                                    throws ConverterException
Uses a Bean Converter to convert the given object to a String representation.

Parameters:
ctx - Request context
converter - The Converter to use
value - The Bean to convert
Returns:
String or null
Throws:
ConverterException - Is thrown when the instance could not be created

getAsObject

public static java.lang.Object getAsObject(RequestContext ctx,
                                           java.lang.Class dataType,
                                           java.lang.String newValue)
                                    throws ConverterException
Uses a Bean Converter to convert the given String into an Object.

Parameters:
ctx - Request context
dataType - the target Datatype
newValue - The String to convert
Returns:
Object of type dataType or null
Throws:
ConverterException - Is thrown when the instance could not be created

getAsObject

public static java.lang.Object getAsObject(RequestContext ctx,
                                           java.lang.Class dataType,
                                           java.lang.String[] newValues)
                                    throws ConverterException
Uses a Bean Converter to convert the given String Array into an Object Array.

Parameters:
ctx - Request context
dataType - the target Datatype
newValues - The Strings to convert
Returns:
Object Array of type dataType or null
Throws:
ConverterException - Is thrown when the instance could not be created


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.