@Retention(value=CLASS)
@Target(value={PARAMETER,METHOD})
public @interface Flow
ArrayList.add(item)
)
or from the container to the method return value (e.g. Set.toArray()
)
or between method parameters (e.g. System.arraycopy(array1, 0, array2, length)
)Modifier and Type | Fields and Description |
---|---|
static java.lang.String |
DEFAULT_SOURCE |
static java.lang.String |
DEFAULT_TARGET |
static java.lang.String |
RETURN_METHOD_TARGET |
static java.lang.String |
THIS_SOURCE |
static java.lang.String |
THIS_TARGET |
Modifier and Type | Optional Element and Description |
---|---|
java.lang.String |
source
Denotes the source of the data flow.
Allowed values are: THIS_SOURCE - Means that the data flows from this container.E.g. |
boolean |
sourceIsContainer
true if the data source is container and we should track not the expression but its contents.
E.g. |
java.lang.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. |
boolean |
targetIsContainer
true if the data target is container and we should track not the expression but its contents.
E.g. |
public abstract java.lang.String source
THIS_SOURCE
- Means that the data flows from this container.@Flow(source = THIS_SOURCE) T get(int index);
this.
Field name - means that the data flows from this container some (synthetic) field.@Flow(source = "this.keys") Set<K> keySet();
THIS_SOURCE
if the method was annotated, e.g.@Flow(sourceIsContainer=true, targetIsContainer=true) Object[] Collection.toArray()
void List.add(@Flow(targetIsContainer=true) E item)
public abstract boolean sourceIsContainer
@Flow(sourceIsContainer=true, targetIsContainer=true) Collection<? extends E> collection
) public abstract java.lang.String target
THIS_TARGET
- Means that the data flows inside this container (of the class the annotated method belongs to).boolean add(@Flow(target=THIS_TARGET, targetIsContainer=true) E element);
void arraycopy(@Flow(sourceIsContainer=true, target="dest", targetIsContainer=true) Object src, int srcPos, Object dest, int destPos, int length)
this.
Field name - means that the data flows to this container in some (synthetic) field.V put(@Flow(target = "this.keys", targetIsContainer=true) K key, V value);
THIS_TARGET
if the parameter was annotated, e.g.void List.set(int index, @Flow(targetIsContainer=true) E element)
RETURN_METHOD_TARGET
if the method was annotated, e.g.:@Flow(sourceIsContainer=true) E List.remove(int index)
public abstract boolean targetIsContainer
void arraycopy(@Flow(sourceIsContainer=true, target="dest", targetIsContainer=true) Object src, int srcPos, Object dest, int destPos, int length)