hexannotation 0.17.0

Utilities for reading and writing metadata

Released 2017-03-20.

To install, run:

haxelib install hexannotation 0.17.0

See using Haxelib in Haxelib documentation for more information.

This is not the latest stable version of hexannotation. See version 0.28.0 for the latest version.

Maintainerdoclerlabs
Websitehttps://github.com/DoclerLabs/hexAnnotation
Current version0.28.0
StatisticsInstalled 574 times
LicenseMIT
Tags hexmachina, mvc, oop

README.md

hexAnnotation TravisCI Build Status

Utilities for reading and writing class metadata

Find more information about hexMachina on hexmachina.org

Dependencies

Features

  • Read metadata at compile time.
  • Handles inheritance chain.
  • Read properties and methods signatures (to be used by DI frameworks).
  • Export annotated (@Inject, @PostConstruct", @Optional, @PreDestroy) members information (essentially reflection data) to a static field instance.

Simple example

To generate a class description at compile-time, implement IInjectorContainer and add annotations on the members that you want to produce reflection.

class MockClassInjectee implements IInjectorContainer
{
	0Inject( "id" )
	public var property : String;
	//property informations will be stored
	
	@Inject( "id" )
	public function new( arg : Int ) 
	{
		//constructor informations will be stored
	}
	
	public function doSomething() : Void
	{
		//this method will be ignored
	}
	
	@PostConstruct( 1 )
	public function doSomething() : Void
	{
		//this method description will be stored as well
	}
}

To get your reflection data at runtime, use FastClassDescriptionProvider like shown below.

var provider = new FastClassDescriptionProvider();
var description = provider.getClassDescription( MockClassInjectee );