Java與flex對象映射
java
flex
int
int
Boolean
Boolean
注: 映射boolean是不行的
Array
ArrayCollection
-------
-------
Java 對象 對象映射
如: FileAction.class 類
package com.svse.entity;
public class FileAction implements java.io.Serializable {
// Fields
private Integer id;
private Integer actionId;
private String name;
private String description;
private Integer type;
private Integer privId;
/** default constructor */
public FileAction() {
}
// get and set 省略
}
Flex 對象
package bean
{
//這裡指的是 java 對象中的路徑
[RemoteClass(alias="com.svse.entity.FileAction")]
public class FileAction
{
public var id:int;
public var actionId:String;
public var name:String;
public var description:String;
public var type:int;
public var privId:int;
public function FileAction()
{
}
}
}
只用在flex類中加入
[RemoteClass(alias="com.svse.entity.FileAction")]
即可完成java 對象到flex對象間的映射