|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.directwebremoting.guice.InternalConverterManager
public class InternalConverterManager
Extends an existing converter manager with an injected list of converters
specified at Guice bind-time. Only to be used in conjunction with
DwrGuiceServlet.
| Constructor Summary | |
|---|---|
InternalConverterManager()
Retrieves an underlying converter manager from thread-local state to which this class delegates ConverterManager calls. |
|
| Method Summary | ||
|---|---|---|
void |
addConverter(java.lang.Class<?> clazz,
Converter converter)
Add a new converter based on a loaded class. |
|
void |
addConverter(java.lang.String match,
Converter converter)
Add a new converter based on a match string |
|
void |
addConverter(java.lang.String match,
java.lang.String type,
java.util.Map<java.lang.String,java.lang.String> params)
Add a new converter based on a match string |
|
void |
addConverterType(java.lang.String id,
java.lang.String className)
Add a new converter type |
|
Property |
checkOverride(Property property)
All Propertys can create children to represent sub-types, but the
ConverterManager might want to override the options that they provide
using types configured by a signatures element. |
|
|
convertInbound(java.lang.Class<T> paramType,
InboundVariable iv,
Property incc)
Convert an object from being a string into an object of some type. |
|
|
convertInbound(java.lang.Class<T> paramType,
RawData data)
RawData is something of a special case for conversion - it's designed to be converted outside of the normal automatic conversion process when the type can't be known until later. |
|
OutboundVariable |
convertOutbound(java.lang.Object object,
OutboundContext outctx)
Convert an object into a Javascript representation of the same. |
|
java.lang.Class<?> |
getClientDeclaredType(InboundVariable iv)
Sometimes data from clients contains type information which should take higher priority than the type guessing that we do as part of the method matching. |
|
Converter |
getConverterByMatchString(java.lang.String match)
In order to be able to create stub remote objects we need to know what they are so you can lookup match strings and retrieve the converter. |
|
java.util.Collection<java.lang.String> |
getConverterMatchStrings()
In order to be able to create stub remote objects we need to know what they are so you can get a collection of all match strings. |
|
NamedConverter |
getNamedConverter(java.lang.String javascriptClassName)
Find a converter based on class-mapped JavaScript class name. |
|
java.util.Collection<java.lang.String> |
getNamedConverterJavaScriptNames()
Returns a collection with all the named converters' JavaScript class names. |
|
boolean |
isConvertable(java.lang.Class<?> paramType)
Check if we can coerce the given type |
|
void |
setConverters(java.util.Map<java.lang.String,Converter> converters)
Sets the converters for this converter manager. |
|
void |
setOverrideProperty(Property original,
Property replacement)
We don't know enough from a method signature like setUsers(Set s) to be able to cast the inbound data to a set of Users. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InternalConverterManager()
ConverterManager calls.
| Method Detail |
|---|
public void addConverterType(java.lang.String id,
java.lang.String className)
ConverterManager
addConverterType in interface ConverterManagerid - The name of the converter typeclassName - The class to do the conversion
public void addConverter(java.lang.String match,
java.lang.String type,
java.util.Map<java.lang.String,java.lang.String> params)
throws java.lang.IllegalArgumentException,
java.lang.InstantiationException,
java.lang.IllegalAccessException
ConverterManager
addConverter in interface ConverterManagermatch - The class name(s) to matchtype - The name of the converter typeparams - The extra parameters to allow the creator to configure itself
java.lang.IllegalArgumentException - If we have a duplicate name
java.lang.InstantiationException - If reflection based creation fails
java.lang.IllegalAccessException - If reflection based creation fails
public void addConverter(java.lang.String match,
Converter converter)
throws java.lang.IllegalArgumentException
ConverterManager
addConverter in interface ConverterManagermatch - The class name(s) to matchconverter - The converter to add
java.lang.IllegalArgumentException - If we have a duplicate name
public void addConverter(java.lang.Class<?> clazz,
Converter converter)
ConverterManager
addConverter in interface ConverterManagerclazz - The class to matchconverter - The converter to addpublic java.util.Collection<java.lang.String> getConverterMatchStrings()
ConverterManager
getConverterMatchStrings in interface ConverterManagerConverterManager.getConverterByMatchString(String)public Converter getConverterByMatchString(java.lang.String match)
ConverterManager
getConverterByMatchString in interface ConverterManagermatch - The match string to lookup
ConverterManager.getConverterMatchStrings()public java.util.Collection<java.lang.String> getNamedConverterJavaScriptNames()
ConverterManager
getNamedConverterJavaScriptNames in interface ConverterManagerpublic NamedConverter getNamedConverter(java.lang.String javascriptClassName)
ConverterManager
getNamedConverter in interface ConverterManagerjavascriptClassName - The type name as passed in from the client
public boolean isConvertable(java.lang.Class<?> paramType)
ConverterManager
isConvertable in interface ConverterManagerparamType - The type to check
paramType is convertiblepublic java.lang.Class<?> getClientDeclaredType(InboundVariable iv)
ConverterManager
getClientDeclaredType in interface ConverterManageriv - The string version of the object from the client
public <T> T convertInbound(java.lang.Class<T> paramType,
InboundVariable iv,
Property incc)
throws ConversionException
ConverterManager
convertInbound in interface ConverterManagerparamType - The type that you want the object to beiv - The string version of the object
ConversionException - If the conversion failed for some reason
public <T> T convertInbound(java.lang.Class<T> paramType,
RawData data)
throws ConversionException
ConverterManagerRawData holds.
convertInbound in interface ConverterManagerparamType - The type we wish to convert todata - The RawData object holding data to be converted
ConversionException - If the conversion failed for some reason
public OutboundVariable convertOutbound(java.lang.Object object,
OutboundContext outctx)
throws ConversionException
ConverterManager
convertOutbound in interface ConverterManagerobject - The object to convertoutctx - The list of converted objects so far
ConversionException - If the conversion failed for some reasonpublic Property checkOverride(Property property)
ConverterManagerPropertys can create children to represent sub-types, but the
ConverterManager might want to override the options that they provide
using types configured by a signatures element.
checkOverride in interface ConverterManagerproperty - The property to check for overriding
public void setOverrideProperty(Property original,
Property replacement)
ConverterManager
setOverrideProperty in interface ConverterManageroriginal - The original property that might need replacingreplacement - A replacement property that returns the correct typepublic void setConverters(java.util.Map<java.lang.String,Converter> converters)
ConverterManager
setConverters in interface ConverterManagerconverters - the map of match pattern and their converter instances
|
Copyright ยจ 2008 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||