org.directwebremoting.extend
Interface NamedConverter

All Superinterfaces:
Converter
All Known Implementing Classes:
BasicObjectConverter, BeanConverter, ExceptionConverter, H2BeanConverter, H3BeanConverter, MinimalistExceptionConverter, ObjectConverter, XmlBeanConverter

public interface NamedConverter
extends Converter

Additions to Converter that allow objects to have names that are exposed to the browser

Author:
Joe Walker [joe at getahead dot ltd dot uk]

Method Summary
 java.lang.Class<?> getInstanceType()
           
 java.lang.String getJavascript()
          Accessor for the javascript class name for mapped converted objects.
 java.lang.String getJavascriptSuperClass()
          Accessor for the javascript class name that will appear as superclass for mapped converted objects.
 java.util.Map<java.lang.String,Property> getPropertyMapFromClass(java.lang.Class<?> type, boolean readRequired, boolean writeRequired)
          Get a map of property names to implementations of Property.
 java.util.Map<java.lang.String,Property> getPropertyMapFromObject(java.lang.Object example, boolean readRequired, boolean writeRequired)
          Get a map of property names to implementations of Property.
 void setInstanceType(java.lang.Class<?> instanceType)
           
 void setJavascript(java.lang.String javascript)
          Accessor for the javascript class name for mapped converted objects.
 void setJavascriptSuperClass(java.lang.String javascriptSuperClass)
          Setter for the javascript class name that will appear as superclass for mapped converted objects.
 
Methods inherited from interface org.directwebremoting.extend.Converter
convertInbound, convertOutbound, setConverterManager
 

Method Detail

getPropertyMapFromObject

java.util.Map<java.lang.String,Property> getPropertyMapFromObject(java.lang.Object example,
                                                                  boolean readRequired,
                                                                  boolean writeRequired)
                                                                  throws ConversionException
Get a map of property names to implementations of Property.

HibernateBeanConverter (and maybe others) may want to provide alternate versions of bean.getClass(), and we may wish to fake or hide properties in some cases.

This implementation is preferred above the alternate: getPropertyMapFromClass(Class, boolean, boolean) because it potentially retains important extra type information.

Parameters:
example - The object to find bean info from
readRequired - The properties returned must be readable
writeRequired - The properties returned must be writable
Returns:
An array of PropertyDescriptors describing the beans properties
Throws:
ConversionException - If the introspection fails
See Also:
getPropertyMapFromClass(Class, boolean, boolean)

getPropertyMapFromClass

java.util.Map<java.lang.String,Property> getPropertyMapFromClass(java.lang.Class<?> type,
                                                                 boolean readRequired,
                                                                 boolean writeRequired)
                                                                 throws ConversionException
Get a map of property names to implementations of Property.

HibernateBeanConverter (and maybe others) may want to provide alternate versions of bean.getClass(), and we may wish to fake or hide properties in some cases.

If you have a real object to investigate then it is probably better to call getPropertyMapFromObject(Object, boolean, boolean) because that version can take into account extra runtime type info.

Parameters:
type - The class to find bean info from
readRequired - The properties returned must be readable
writeRequired - The properties returned must be writable
Returns:
An array of PropertyDescriptors describing the beans properties
Throws:
ConversionException - If the introspection fails
See Also:
getPropertyMapFromObject(Object, boolean, boolean)

getInstanceType

java.lang.Class<?> getInstanceType()
Returns:
Returns the instanceType.

setInstanceType

void setInstanceType(java.lang.Class<?> instanceType)
Parameters:
instanceType - The instanceType to set.

getJavascript

java.lang.String getJavascript()
Accessor for the javascript class name for mapped converted objects.

Returns:
The Javascript classname

setJavascript

void setJavascript(java.lang.String javascript)
Accessor for the javascript class name for mapped converted objects.

Parameters:
javascript - The Javascript classname

getJavascriptSuperClass

java.lang.String getJavascriptSuperClass()
Accessor for the javascript class name that will appear as superclass for mapped converted objects.

Returns:
The Javascript classname

setJavascriptSuperClass

void setJavascriptSuperClass(java.lang.String javascriptSuperClass)
Setter for the javascript class name that will appear as superclass for mapped converted objects.

Parameters:
javascriptSuperClass - The Javascript classname

Copyright 2008