Commit 705e73d9 authored by Lukáš Marek's avatar Lukáš Marek
Browse files

Snippet annotations now supports default scope (*)

parent 3c92417b
......@@ -12,7 +12,7 @@ public @interface After {
Class<? extends Marker> marker();
String args() default ""; // cannot be null :(
String scope();
String scope() default "*";
Class<? extends Object> guard() default Object.class; // cannot be null :(
int order() default 100;
// NOTE if the DiSL property disl.dynbypass is set to yes, dynamic bypass is
......
......@@ -12,7 +12,7 @@ public @interface AfterReturning {
Class<? extends Marker> marker();
String args() default ""; // cannot be null :(
String scope();
String scope() default "*";
Class<? extends Object> guard() default Object.class; // cannot be null :(
int order() default 100;
// NOTE if the DiSL property disl.dynbypass is set to yes, dynamic bypass is
......
......@@ -12,7 +12,7 @@ public @interface AfterThrowing {
Class<? extends Marker> marker();
String args() default ""; // cannot be null :(
String scope();
String scope() default "*";
Class<? extends Object> guard() default Object.class; // cannot be null :(
int order() default 100;
// NOTE if the DiSL property disl.dynbypass is set to yes, dynamic bypass is
......
......@@ -12,7 +12,7 @@ public @interface Before {
Class<? extends Marker> marker();
String args() default ""; // cannot be null :(
String scope();
String scope() default "*";
Class<? extends Object> guard() default Object.class; // cannot be null :(
int order() default 100;
// NOTE if the DiSL property disl.dynbypass is set to yes, dynamic bypass is
......
......@@ -195,7 +195,7 @@ class SnippetParser extends AbstractParser {
// annotation values
public Type marker = null;
public String args = null; // default
public String scope = null;
public String scope = "*"; // default
public Type guard = null; // default
public int order = 100; // default
public boolean dynamicBypass = false; // default
......@@ -211,7 +211,7 @@ class SnippetParser extends AbstractParser {
SnippetAnnotationData sad = new SnippetAnnotationData(type);
ParserHelper.parseAnnotation(sad, annotation);
if (sad.marker == null || sad.scope == null) {
if (sad.marker == null) {
throw new DiSLFatalException("Missing attribute in annotation "
+ type.toString()
......
......@@ -3,15 +3,16 @@ package ch.usi.dag.disl.test.scope;
import ch.usi.dag.disl.annotation.AfterReturning;
import ch.usi.dag.disl.annotation.Before;
import ch.usi.dag.disl.marker.BodyMarker;
import ch.usi.dag.disl.staticcontext.MethodSC;
public class DiSLClass {
@AfterReturning(marker = BodyMarker.class, order = 0, scope = "*.*")
public static void onMethodExit() {
System.out.println("????????????????????????????");
@AfterReturning(marker = BodyMarker.class)
public static void onMethodExit(MethodSC msc) {
System.out.println("Exiting " + msc.thisMethodFullName());
}
@Before(marker = BodyMarker.class, order = 1, scope = "ch.usi.dag.disl.test.scope.TargetClass.complete(java.lang.String,boolean,boolean)")
@Before(marker = BodyMarker.class, scope = "ch.usi.dag.disl.test.scope.TargetClass.complete(java.lang.String,boolean,boolean)")
public static void beforeComplete() {
System.out.println("!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment