Skip to content

Instantly share code, notes, and snippets.

@FrancisBourre
Last active November 9, 2017 10:18
Show Gist options
  • Save FrancisBourre/a450e8e422083d4321238f1971cda46f to your computer and use it in GitHub Desktop.
Save FrancisBourre/a450e8e422083d4321238f1971cda46f to your computer and use it in GitHub Desktop.
Injector code generation
//572 bytes
T.__INJECTION_DATA = { c : { a : [{ t : "hex.domain.Domain", n : "", o : false}]}, p : [{ p : "property", t : "hex.domain.Domain", n : "", o : true},{ p : "property2", t : "hex.domain.Domain", n : "", o : false}], m : [{ m : "test", a : [{ t : "String", n : "", o : false},{ t : "hex.domain.Domain", n : "", o : false}]}], pc : [{ m : "postConstruct0", a : [], o : 0},{ m : "postConstruct1", a : [], o : 1},{ m : "postConstruct2", a : [], o : 2}], pd : [{ m : "preDestroy0", a : [], o : 0},{ m : "preDestroy1", a : [], o : 1},{ m : "preDestroy2", a : [], o : 2}]};
//457 bytes
__ai: function(f) {
this.property = f("hex.domain.Domain","",null,false);
this.property2 = f("hex.domain.Domain","",null,false);
this.test(f("String","",null,false),f("hex.domain.Domain","",null,false));
this.postConstruct0();
this.postConstruct1();
this.postConstruct2();
}
,__ac: function(f) {
return new T(f("hex.domain.Domain","",null,false));
}
,__ap: function(f) {
this.preDestroy0();
this.preDestroy1();
this.preDestroy2();
}
class T implements IInjectable
{
@Inject
@Optional
public var property : Domain;
@Inject
public var property2 : Domain;
@Inject
public function new( d : Domain )
{
trace('yeah');
}
@Inject
public function test( s : String, d : Domain ) : Void
{
}
@PostConstruct(1)
public function postConstruct1() : Void
{
}
@PreDestroy(1)
public function preDestroy1() : Void
{
}
@PostConstruct(0)
public function postConstruct0() : Void
{
}
@PreDestroy(0)
public function preDestroy0() : Void
{
}
@PostConstruct(2)
public function postConstruct2() : Void
{
}
@PreDestroy(2)
public function preDestroy2() : Void
{
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment