com.carbonfive.flash.decoder
Class NativeDecoder

java.lang.Object
  extended by com.carbonfive.flash.decoder.ActionScriptDecoder
      extended by com.carbonfive.flash.decoder.NativeDecoder

public class NativeDecoder
extends ActionScriptDecoder

Decodes an ActionScript native object to a Java native object.


Constructor Summary
NativeDecoder()
           
 
Method Summary
 java.lang.Object decodeShell(java.lang.Object encodedObject, java.lang.Class desiredClass)
          This method attempts to create a Java object from an ActionScript object that is supposedly (according to the Macromedia AMF rules) alread the appropriate Java object.
 
Methods inherited from class com.carbonfive.flash.decoder.ActionScriptDecoder
decodeObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NativeDecoder

public NativeDecoder()
Method Detail

decodeShell

public java.lang.Object decodeShell(java.lang.Object encodedObject,
                                    java.lang.Class desiredClass)
This method attempts to create a Java object from an ActionScript object that is supposedly (according to the Macromedia AMF rules) alread the appropriate Java object. But, it seems some users don't match their ActionScript objects with their Java objects perfectly, and so we get Strings coming in through AMF instead of Doubles (for example). So we will perform some rudimentary conversion logic and exception handling on Strings.

Specified by:
decodeShell in class ActionScriptDecoder
Parameters:
encodedObject - The ActionScript native object
desiredClass - The class we want to translate in to
Returns:
The Java object decoded from the ActionScript native object