My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
XmlAttribute  
Usage of the XmlAttribute metadata
Updated Jun 14, 2009 by conrad.w...@gmail.com

Introduction

Used to specify that the associated member is to be marshalled to and from an xml attribute of the root object node

Details

Used like this for variables

[XmlAttribute(name="level")]
public var level:int;

or this

private var _level;

[XmlAttribute(name="level")]
public function get level():int
{
    return _level;
}

public function set level(value:int):void
{
    _level = value;
}
  • The name of the attribute in the XML and the name of the variable do not need to match
  • For unmarshalling you MUST provide a public setter

Sign in to add a comment
Powered by Google Project Hosting