|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ConverterManager
A class to manage the converter types and the instantiated class name matches.
| 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 data,
Property thc)
Convert an object from being a string into an object of some type. |
|
|
convertInbound(java.lang.Class<T> paramType,
RawData rawData)
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 data,
OutboundContext converted)
Convert an object into a Javascript representation of the same. |
|
java.lang.Class<?> |
getClientDeclaredType(InboundVariable data)
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. |
|
| Method Detail |
|---|
void addConverterType(java.lang.String id,
java.lang.String className)
id - The name of the converter typeclassName - The class to do the conversion
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
match - The class name(s) to matchtype - The name of the converter typeparams - The extra parameters to allow the creator to configure itself
java.lang.InstantiationException - If reflection based creation fails
java.lang.IllegalAccessException - If reflection based creation fails
java.lang.IllegalArgumentException - If we have a duplicate name
void addConverter(java.lang.String match,
Converter converter)
throws java.lang.IllegalArgumentException
match - The class name(s) to matchconverter - The converter to add
java.lang.IllegalArgumentException - If we have a duplicate name
void addConverter(java.lang.Class<?> clazz,
Converter converter)
clazz - The class to matchconverter - The converter to addjava.util.Collection<java.lang.String> getConverterMatchStrings()
getConverterByMatchString(String)Converter getConverterByMatchString(java.lang.String match)
match - The match string to lookup
getConverterMatchStrings()java.util.Collection<java.lang.String> getNamedConverterJavaScriptNames()
NamedConverter getNamedConverter(java.lang.String javascriptClassName)
javascriptClassName - The type name as passed in from the client
boolean isConvertable(java.lang.Class<?> paramType)
paramType - The type to check
paramType is convertiblejava.lang.Class<?> getClientDeclaredType(InboundVariable data)
data - The string version of the object from the client
<T> T convertInbound(java.lang.Class<T> paramType,
InboundVariable data,
Property thc)
throws ConversionException
paramType - The type that you want the object to bedata - The string version of the object
ConversionException - If the conversion failed for some reason
<T> T convertInbound(java.lang.Class<T> paramType,
RawData rawData)
throws ConversionException
RawData holds.
T - paramType - The type we wish to convert torawData - The RawData object holding data to be converted
ConversionException - If the conversion failed for some reason
OutboundVariable convertOutbound(java.lang.Object data,
OutboundContext converted)
throws ConversionException
data - The object to convertconverted - The list of converted objects so far
ConversionException - If the conversion failed for some reason
void setOverrideProperty(Property original,
Property replacement)
original - The original property that might need replacingreplacement - A replacement property that returns the correct typeProperty checkOverride(Property property)
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.
property - The property to check for overriding
void setConverters(java.util.Map<java.lang.String,Converter> converters)
converters - 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 | |||||||||