net.jbeans.data.converter
Class DataConverterManager

java.lang.Object
  extended bynet.jbeans.data.converter.DataConverterManager

public class DataConverterManager
extends java.lang.Object

generally describe DataConverterManager in here

Version:
$Revision: 1.1.1.1 $
Author:
Masahiro Takatsuka (masa@jbeans.net)

Constructor Summary
DataConverterManager()
           
 
Method Summary
static java.lang.Object convert(java.lang.Object source, java.lang.Class targetType)
           
static DataConverter findConverter(java.lang.Class sourceType, java.lang.Class targetType)
          Locate a data converter for a given source and target types.
static java.lang.String[] getConverterSearchPath()
          Gets the package names that will be searched for data converters.
static boolean isThereConverFor(java.lang.Class sourceType, java.lang.Class targetType)
           
static void main(java.lang.String[] args)
           
static void registerConverter(java.lang.Class converterClass)
          Register a data converter class to be used to convert a given source class to a given target class.
static void setConverterSearchPath(java.lang.String[] path)
          Change the list of package names that will be used for finding data converters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataConverterManager

public DataConverterManager()
Method Detail

registerConverter

public static final void registerConverter(java.lang.Class converterClass)
Register a data converter class to be used to convert a given source class to a given target class.

First, if there is a security manager, its checkPropertiesAccess method is called. This could result in a SecurityException.

Parameters:
converterClass - the Class object of the data converter class. If this is null, then any existing definition will be removed.
Throws:
java.lang.SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow setting of system properties.
See Also:
SecurityManager.checkPropertiesAccess()

isThereConverFor

public static final boolean isThereConverFor(java.lang.Class sourceType,
                                             java.lang.Class targetType)

findConverter

public static final DataConverter findConverter(java.lang.Class sourceType,
                                                java.lang.Class targetType)
Locate a data converter for a given source and target types.

Parameters:
sourceType - The Class object for the type to be converted.
targetType - The Class object for the type to be converted into.
Returns:
A data converter object for the given source and target classes. The result is null if no suitable converter can be found.

getConverterSearchPath

public static final java.lang.String[] getConverterSearchPath()
Gets the package names that will be searched for data converters.

Returns:
The array of package names that will be searched in order to find data converters.

This is initially set to {"net.jbeans.data.converter"}.


setConverterSearchPath

public static final void setConverterSearchPath(java.lang.String[] path)
Change the list of package names that will be used for finding data converters

First, if there is a security manager, its checkPropertiesAccess method is called. This could result in a SecurityException.

Parameters:
path - Array of package names.
Throws:
java.lang.SecurityException - if a security manager exists and its checkPropertiesAccess method doesn't allow setting of system properties.
See Also:
SecurityManager.checkPropertiesAccess()

convert

public static java.lang.Object convert(java.lang.Object source,
                                       java.lang.Class targetType)

main

public static final void main(java.lang.String[] args)


Copyright © 2003 JBean project. All Rights Reserved.