Mantis - Hessian
Viewing Issue Advanced Details
3004 major always 10-13-08 07:24 10-14-08 15:59
tcouery  
 
normal  
closed 3.2.0  
fixed  
none    
none 3.2.1  
0003004: Hessian serializer in Flex don't use the [Transient] metadata
Actualy, this instance is fully serialized:

package hessian.test
{
  public class TestTransient
  {
    [Transient]
    public var field1: String;

    [Bindable]
    [Transient]
    public var field2: String;
    
    [Bindable]
    [Transient]
    public function get field3(): String
    {
      return "field3";
    }
    
    public function set field3(value: String): void
    {
      //
    }
  }
}

An idea of implementation in HessianOutput:

private function writeObject10(obj:Object):void
{
...
  //Fields
  for each(var variable:XML in variables) {
    key = variable.@name;
    
    if ((!isMetadataContains(variable.metadata, "Transient")) && (key != "hessianTypeName")) {
      writeObject(key);
      writeObject(obj[key]);
    }
  }

  //Accessors
  for each(var accessor:XML in accessors) {
    key = accessor.@name;
    if ((isMetadataContains(accessor.metadata, "Bindable")) &&
        (!isMetadataContains(accessor.metadata, "Transient")) &&
        (key != "hessianTypeName")) {
      writeObject(key);
      writeObject(obj[key]);
    }
  }

...
}

private function isMetadataContains(metadatas:XMLList, code:String): Boolean
{
  for each(var metada:XML in metadatas) {
    if (metada.@name == code) {
      return true;
    }
  }
  return false;
}

There are no notes attached to this issue.