Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

[AEM Gems Webinar] Accelerating Experience Manager as a Cloud Service development with Rapid Development Environments

final properties isn't serilised from java to flex

Avatar

Not applicable
At Java side I have this class:



public final class TitleName {

@NotNull

public final Integer id;

@NotNull

public final String name;

...

}



that at Flex side I try to use as Dynamic Object. But calling Java service and obtainin this object as call result at Flex side I've got empty Object without any property. When I remove final declaration from Java fields all works correctly and at Flex I have Objects with id and name.



Is this a bug?
0 Replies

Avatar

Level 3
Hi Den,



That's not a bug - it's a result of the AMF serialization rules.



http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/lcds/wwhelp/wwhimpl/common/html/wwhelp.htm...



For a class to support AMF serialization it must follow Java bean syntax (no-arg constructor, public get/set properties or public readable/writeable variables, etc.). The 'final' keyword makes the variable unwriteable - and thus, unserializable.



HTH,

Seth