本文整理了Java中org.aspectj.lang.annotation.Aspect.value()
方法的一些代码示例,展示了Aspect.value()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Aspect.value()
方法的具体详情如下:
包路径:org.aspectj.lang.annotation.Aspect
类名称:Aspect
方法名:value
暂无
代码示例来源:origin: spring-projects/spring-framework
/**
* Extract contents from String of form {@code pertarget(contents)}.
*/
private String findPerClause(Class<?> aspectClass) {
String str = aspectClass.getAnnotation(Aspect.class).value();
str = str.substring(str.indexOf('(') + 1);
str = str.substring(0, str.length() - 1);
return str;
}
代码示例来源:origin: apache/servicemix-bundles
/**
* Extract contents from String of form {@code pertarget(contents)}.
*/
private String findPerClause(Class<?> aspectClass) {
String str = aspectClass.getAnnotation(Aspect.class).value();
str = str.substring(str.indexOf('(') + 1);
str = str.substring(0, str.length() - 1);
return str;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-aop
/**
* Extract contents from String of form {@code pertarget(contents)}.
*/
private String findPerClause(Class<?> aspectClass) {
String str = aspectClass.getAnnotation(Aspect.class).value();
str = str.substring(str.indexOf('(') + 1);
str = str.substring(0, str.length() - 1);
return str;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.aspectj
public PerClause getPerClause() {
if (isAspect()) {
Aspect aspectAnn = clazz.getAnnotation(Aspect.class);
String perClause = aspectAnn.value();
if (perClause.equals("")) {
if (getSupertype().isAspect()) {
return getSupertype().getPerClause();
}
return new PerClauseImpl(PerClauseKind.SINGLETON);
} else if (perClause.startsWith("perthis(")) {
return new PointcutBasedPerClauseImpl(PerClauseKind.PERTHIS,perClause.substring("perthis(".length(),perClause.length() - 1));
} else if (perClause.startsWith("pertarget(")) {
return new PointcutBasedPerClauseImpl(PerClauseKind.PERTARGET,perClause.substring("pertarget(".length(),perClause.length() - 1));
} else if (perClause.startsWith("percflow(")) {
return new PointcutBasedPerClauseImpl(PerClauseKind.PERCFLOW,perClause.substring("percflow(".length(),perClause.length() - 1));
} else if (perClause.startsWith("percflowbelow(")) {
return new PointcutBasedPerClauseImpl(PerClauseKind.PERCFLOWBELOW,perClause.substring("percflowbelow(".length(),perClause.length() - 1));
} else if (perClause.startsWith("pertypewithin")) {
return new TypePatternBasedPerClauseImpl(PerClauseKind.PERTYPEWITHIN,perClause.substring("pertypewithin(".length(),perClause.length() - 1));
} else {
throw new IllegalStateException("Per-clause not recognized: " + perClause);
}
} else {
return null;
}
}
内容来源于网络,如有侵权,请联系作者删除!