本文整理汇总了Java中org.aspectj.lang.reflect.SourceLocation类的典型用法代码示例。如果您正苦于以下问题:Java SourceLocation类的具体用法?Java SourceLocation怎么用?Java SourceLocation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SourceLocation类属于org.aspectj.lang.reflect包,在下文中一共展示了SourceLocation类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSourceLocation
import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
@Override
public SourceLocation getSourceLocation() {
if (this.sourceLocation == null) {
this.sourceLocation = new SourceLocationImpl();
}
return this.sourceLocation;
}
示例2: TracingEvent
import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
public TracingEvent(final TraceType traceType, final Class<? extends Object> source, final Class<? extends Object> target, final Signature signature, final SourceLocation sourceLocation, final Object... args) {
this.traceType = traceType;
this.source = source;
this.target = target;
this.signature = signature;
this.sourceLocation = sourceLocation;
this.args = args;
}
示例3: traceEntry
import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
private void traceEntry(final Class<? extends Object> aThis, final Class<? extends Object> target, final Signature signature, final SourceLocation sourceLocation, final Object[] args) {
if(aThis != null && target != null) {
String message = aThis.getName() + " -> " + target.getName() + " : " + signature.getName() + "(" + Arrays.deepToString(args) + ")";
messages.add(new TracingEvent(TraceType.ENTRY, aThis, target, signature, sourceLocation, args));
System.out.println(message);
}
}
示例4: traceExit
import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
private void traceExit(final Class<? extends Object> aThis, final Class<? extends Object> target, final Signature signature, final SourceLocation sourceLocation, final Object... returnValue) {
if(aThis != null && target != null) {
String message = target.getName() + " -> " + aThis.getName() + " : return" + "(" + Arrays.deepToString(returnValue) + ")";
messages.add(new TracingEvent(TraceType.EXIT, aThis, target, signature, sourceLocation, returnValue));
System.out.println(message);
}
}
示例5: traceThrowing
import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
private void traceThrowing(final Class<? extends Object> aThis, final Class<? extends Object> target, final Signature signature, final SourceLocation sourceLocation, final Throwable throwable) {
if(aThis != null && target != null) {
String message = target.getName() + " -> " + aThis.getName() + " : throws" + "(" + throwable + ")";
messages.add(new TracingEvent(TraceType.EXCEPTION, aThis, target, signature, sourceLocation, throwable));
System.out.println(message);
}
}
示例6: addToContextLineAndMethod
import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
/**
* Before outputting the message inject additional context.
*
* @param joinPoint The <code>JoinPoint</code>.
*/
@Before("call(* com.arpnetworking.steno.LogBuilder.log())")
public void addToContextLineAndMethod(final JoinPoint joinPoint) {
final SourceLocation sourceLocation = joinPoint.getSourceLocation();
final LogBuilder targetLogBuilder = (LogBuilder) joinPoint.getTarget();
targetLogBuilder.addContext("line", String.valueOf(sourceLocation.getLine()));
targetLogBuilder.addContext("file", sourceLocation.getFileName());
targetLogBuilder.addContext("class", sourceLocation.getWithinType());
}
示例7: getType
import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
private static Class<?> getType(JoinPoint jp) {
return Optional.ofNullable(jp.getSourceLocation())
.map(SourceLocation::getWithinType)
.orElse(jp.getSignature().getDeclaringType());
}
示例8: getSourceLocation
import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
@Override
public SourceLocation getSourceLocation()
{
return null;
}
示例9: getSourceLocation
import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
public SourceLocation getSourceLocation() {
return null;
}
示例10: getSourceLocation
import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public SourceLocation getSourceLocation() {
return joinPoint.getSourceLocation();
}
示例11: getSourceLocation
import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
public SourceLocation getSourceLocation() {
if (this.sourceLocation == null) {
this.sourceLocation = new SourceLocationImpl();
}
return this.sourceLocation;
}
示例12: getSourceLocation
import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
public SourceLocation getSourceLocation() {
return sourceLocation;
}
示例13: getSourceLocation
import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
@Override
public SourceLocation getSourceLocation() {
return this.joinpoint.getSourceLocation();
}