Permalink
Browse files

annotation descriptions

  • Loading branch information...
1 parent 2421a0e commit bdbaf170b9ef5c37b60fd4258b156a9dd308cfa5 Unknown committed Mar 31, 2013
Showing with 35 additions and 0 deletions.
  1. +2 −0 yaap/README.md
  2. +33 −0 yaap/docs/annotations.md
View
@@ -8,6 +8,8 @@ With the `yaap/wire` plugin, @Autowired applications are possible
`Remark:` This is an experimentational library and should not be used in production.
+An overview of out-of-the-box supported annotations is available [here](docs/annotations.md)
+
##Installation
Installation for node: `npm install yaap`
View
@@ -0,0 +1,33 @@
+#yaap included annotations
+despite being an annofation processing framework, there are some annotation processors already included.
+
+While some of them work out of the box, others can only be used with wire.js.
+Some annotations can only be used on parameters while others can also be used at function level.
+
+##Basic annotations
+
+* `@NotNull` (parameter/function): the most basic annotation assures,
+ the one/all arguments of a function call are not null or unassigned.
+
+* `@Default(<value>)` (parameter): if the annotated parameter is unassigned or null, a default value will be injected.
+
+
+##Wire annotations
+
+* `@Autowired([<refName>])` (parameter/function): if a parameter is unassigned or null, a bean from the wire-context will be injected instead.
+ If the annotation is placed at a parameter, the given refName or, if ommitted, the parameter-name will be used to resolve the reference.
+ If the annotation is function-level, all parameters that are null or unassigned will be autowired by parameter-name.
+
+* `@PostConstruct` (function): the annotated function will be called after container finished configuring the bean.
+
+* `@PreDestroy` (function): the annotated function will be called, if context.destroy() is called.
+
+###browser-specific wire annotations
+
+* `@On(<refName>, <event>)` (function): the annotated function will automatically be bound the the event of the given dom-node.
+ This is intended to be used with the `wire/dom`-plugin. <refName> can reference one or more elements in the dom (though
+ it is probably better practice to reference a bean in the wirecontext, which itself references the dom-nodes).
+ For example, you could bind a clickhandler with this annotation: `@On("dom.all!.btn","click")`.
+ The annotated method accepts one argument that is the event.
+ `Remark:` still work in process
+

0 comments on commit bdbaf17

Please sign in to comment.