| public String target() Denotes the destination of the data flow.
Allowed values are:
THIS_TARGET - Means that the data flows inside this container (of the class the annotated method belongs to).
E.g. annotation for java.util.List method add(element) means the method takes the argument and passes it to this collection.
boolean add(@Flow(target=THIS_TARGET, targetIsContainer=true) E element);
-
Parameter name - means the data flows to this parameter.
E.g.
void arraycopy(@Flow(sourceIsContainer=true, target="dest", targetIsContainer=true) Object src, int srcPos, Object dest, int destPos, int length)
means that java.lang.System.arraycopy() method takes its first argument and passes it to the "dest" parameter.
-
this.Field name - means that the data flows to this container in some (synthetic) field.
E.g. annotation for java.util.Map.put(key, value) method here means that it takes the argument 'key' and stores the data in some (hidden) field named "keys".
V put(@Flow(target = "this.keys", targetIsContainer=true) K key, V value);
By default, the target() value is:
-
THIS_TARGET if the parameter was annotated, e.g.
void List.set(int index, @Flow(targetIsContainer=true) E element)
Here the annotation tells us that java.util.List.set(index, element) method
reads its second argument 'element' and passes it to this collection (target=THIS_TARGET by default).
-
RETURN_METHOD_TARGET if the method was annotated, e.g.:
@Flow(sourceIsContainer=true) E List.remove(int index)
Here the annotation tells us that java.util.List.remove(int index) method
returns the data from its collection (target=RETURN_METHOD_TARGET by default).
|