Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sammyt/fussy
actionscript reflection query language
https://github.com/sammyt/fussy
Last synced: about 2 months ago
JSON representation
actionscript reflection query language
- Host: GitHub
- URL: https://github.com/sammyt/fussy
- Owner: sammyt
- Archived: true
- Created: 2010-03-30T10:42:21.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2011-08-08T20:37:43.000Z (over 13 years ago)
- Last Synced: 2024-08-04T05:05:18.877Z (5 months ago)
- Language: ActionScript
- Homepage:
- Size: 149 KB
- Stars: 25
- Watchers: 2
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-actionscript-sorted - fussy - actionscript reflection query language (Unsorted / Other API)
README
# fussy is an actionscript reflection query language #
Fussy allows you to query your actionscript types using a simple DSL
### Why ###
Because I didn't need a full OO representation of my types, I just needed to know some specific things about them### How ###
Fussy allows you to perform the business logic of you reflection (find me such-and-such) with a query language, then only parses into strictly typed objects those facets of the type that satisfy your query### Code ###
Want to know somethings about some types? Create a Fussy.
var fussy:Fussy = new Fussy()Explain what you want to know by creating a query
var query:IQuery = fussy.query().findMethods().withTypeSignature(int, String);This will find any methods that have a signiture of int, string e.g. public function setAgeAndName(age:int, name:String):void; or public function addToCart(prodId:int, name:String):void;
Now to use the query
var methods:Array = query.forType(Person);Result is strongly typed into Method objects
for each(var method:Method in methods)
{
trace(method.name);
trace(method.parameters.length);
method.invoke(myPerson, [1, "Bacon"]);
}### And some more... ###
Take from [dawns](http://github.com/sammyt/dawn) code base
var query:QueryBuilder = fussy.query();query.findMethods().withMetadata("Inject").withArguments();
query.findProperties().withMetadata("Inject");
query.findMethods().withMetadata("Provider").noCompulsoryArguments();
query.findMethods().withMetadata("Execute").withArgsLengthOf(1);
query.getTypeQuery();