Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
111 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
"use strict"; | ||
module.exports = { | ||
fn1: function() /*@Initialize*/ | ||
{ | ||
this.value = 1; | ||
}, | ||
fn2: function(bean)/*@Autowired @Initialize*/ | ||
{ | ||
this.bean = bean; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/** @license MIT License (c) copyright 2013 original author or authors */ | ||
|
||
/** | ||
* @Autowired annotation processor. | ||
* | ||
* Autowires parameters of function calls based on a given or the parameter name. | ||
* | ||
* needs wire to be in the configuration object. | ||
* | ||
* | ||
* Licensed under the MIT License at: | ||
* http://www.opensource.org/licenses/mit-license.php | ||
* | ||
* @author Peter Mucha | ||
* | ||
* @version 0.0.3 | ||
*/ | ||
"use strict"; | ||
(function(define) { | ||
define([], | ||
function() { | ||
|
||
|
||
var registeredInitializers = []; | ||
|
||
|
||
return { | ||
annotation: "@Initialize", | ||
|
||
|
||
|
||
processFunction: function(obj, fnObj, annotationParams, cfg){ | ||
|
||
|
||
registeredInitializers.push({obj: obj, name: fnObj.name}); | ||
}, | ||
|
||
afterProcessing: function(obj){ | ||
while(registeredInitializers.length > 0){ | ||
var init = registeredInitializers.pop(); | ||
init.obj[init.name](); //call it | ||
} | ||
} | ||
}; | ||
|
||
});})(typeof define == 'function'? define: function(deps, factory) {module.exports = factory.apply(this, deps.map(function(x) {return require(x);}));}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters