org.nakedobjects.plugins.hibernate.objectstore.persistence.hibspi.accessor
Class ConverterFactory

java.lang.Object
  extended by org.nakedobjects.plugins.hibernate.objectstore.persistence.hibspi.accessor.ConverterFactory

public class ConverterFactory
extends java.lang.Object

Factory to return a PropertyConverter for conversion between a specific NakedObjects value holder type and standard Java data type.

Additional Converters can be added by calling add(Class, PropertyConverter).

Note that this is a singleton.

TODO: find some way to hook into @Value support.


Method Summary
 void add(java.lang.Class<?> valueType, PropertyConverter converter)
          Add a converter for the specified value type
 PropertyConverter getConverter(java.lang.Class<?> nakedClass)
          Return a PropertyConverter which converts from a value holder to a persistent class.
 PropertyConverter getConverter(NakedObjectAssociation field)
           
 PropertyConverter getConverter(java.lang.String nakedClass)
          Return a PropertyConverter which converts from a value holder to a persistent class.
static ConverterFactory getInstance()
          Return the singleton ConverterFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConverter

public PropertyConverter getConverter(java.lang.Class<?> nakedClass)
Return a PropertyConverter which converts from a value holder to a persistent class.

Parameters:
nakedClass - Class of the value holder to convert from eg WholeNumber.class

getConverter

public PropertyConverter getConverter(java.lang.String nakedClass)
Return a PropertyConverter which converts from a value holder to a persistent class.

Parameters:
nakedClass - name of the value holder to convert from
Returns:
the PropertyConverter, or null if none is registered

getConverter

public PropertyConverter getConverter(NakedObjectAssociation field)

add

public void add(java.lang.Class<?> valueType,
                PropertyConverter converter)
Add a converter for the specified value type


getInstance

public static ConverterFactory getInstance()
Return the singleton ConverterFactory



Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.