我们都知道在JAVA中,建立一个实体模型类,一般都有实体的属性、set/get方法、重写toString 方法。其实在FLEX中也一样。如下:
package design.model
{
public class FlowProp
{
//模板号
private var _templateNo:String;
//模板名称
private var _templateName:String;
//创建时间
private var _createTime:String;
//应用系统
private var _systemId:String;
//顺序号
private var _orderCode:String;
//流程描述
private var _descriptionInfo:String;
//构造器
public function FlowProp()
{
}
//get / set 方法。
public function get templateNo():String
{
return _templateNo;
}
public function set templateNo(value:String):void
{
_templateNo = value;
}
public function get templateName():String
{
return _templateName;
}
public function set templateName(value:String):void
{
_templateName = value;
}
public function get createTime():String
{
return _createTime;
}
public function set createTime(value:String):void
{
_createTime = value;
}
public function get systemId():String
{
return _systemId;
}
public function set systemId(value:String):void
{
_systemId = value;
}
public function get orderCode():String
{
return _orderCode;
}
public function set orderCode(value:String):void
{
_orderCode = value;
}
public function get descriptionInfo():String
{
return _descriptionInfo;
}
public function set descriptionInfo(value:String):void
{
_descriptionInfo = value;
}
//重写toString方法
override public function toString():String
{
return super.toString() + " templateNo =" + this._templateNo
+ " templateName = " + this._templateName
+ " createTime = " + this._createTime
+ " systemId = " + this._systemId
+ " orderCode = " + this._orderCode
+ " descriptionInfo = "+this._descriptionInfo;
}
}
}
注意:FLEX中,不能自动生成全部属性的set/get方法。一次只能生成一个。而且,鼠标指针必须定位在该属性的前面,然后看下图:
结束!