« Using an editable Combobox as itemrenderer | Main | Binding improvement »

Swiz framework - Custom Metadata Processor

In my last post I briefly introduced Swiz framework and uncovered part of its great potential. This post will be about Swiz's custom metadata processor, a powerful tool available with the 1.0 release. The metadata processors were available in previous versions also, but now their API is open and allows developers to create their own ActionScript metadata and handle them rather easily.

As an example shows on their site, one has to choose a new metadata name and extend org.swizframework.processors.BaseMetadataProcessor (this class was called MetadataProcessor in the alpha release). In the example, a Random metadata was created, that assigns a random numeric value to any variable it decorates:


[Random]
public var randomNumber:Number;

Such custom metadata are is extremely easy to use: once the processor class is created, it can simply be added to Swiz's custom processors:


<swiz:customProcessors>
<processors:RandomProcessor />
</swiz:customProcessors>

Obviously one should remember to edit the compiler parameters in order to add support for the newly created metadata: -keep-as3-metadata+=Random.

Since it came out, many useful custom metadata processors have been developed and released. Some of them, in no particular order, are:


  • Log processor: just add a [Log] decoration to an instance of ILogger, to enable fast access to Flex logging API.

  • Geocode Processor: automatizes parts of the ESRI geolocation features.

  • Yahoo Finance: proof of concept that uses live data from Yahoo to populate a list decorated with custom metadata.

  • Foomonger: metadata processor that simplifies the use of Swiz with AS3signals

ActionScript metadata are customizable by themselves, but using Swiz framework makes the task more easy and fun. Looking forward to see a [WrittenWhile] metadata!

TrackBack

TrackBack URL for this entry:
http://blog.comtaste.com/mt-tb.cgi/118

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on May 31, 2010 2:40 PM.

The previous post in this blog was Using an editable Combobox as itemrenderer.

The next post in this blog is Binding improvement.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.33