当前位置: 首页>>代码示例>>Java>>正文


Java SourceLocation类代码示例

本文整理汇总了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;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:8,代码来源:MethodInvocationProceedingJoinPoint.java

示例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;
}
 
开发者ID:jensnerche,项目名称:TraceToPlantUml,代码行数:9,代码来源:TracingEvent.java

示例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);
    }
}
 
开发者ID:jensnerche,项目名称:TraceToPlantUml,代码行数:8,代码来源:TracingAspect.java

示例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);
    }
}
 
开发者ID:jensnerche,项目名称:TraceToPlantUml,代码行数:8,代码来源:TracingAspect.java

示例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);
    }
}
 
开发者ID:jensnerche,项目名称:TraceToPlantUml,代码行数:8,代码来源:TracingAspect.java

示例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());
}
 
开发者ID:ArpNetworking,项目名称:logback-steno,代码行数:14,代码来源:LogBuilderAspect.java

示例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());
}
 
开发者ID:mhaddon,项目名称:Sound.je,代码行数:6,代码来源:JoinPointToStringHelper.java

示例8: getSourceLocation

import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
@Override
public SourceLocation getSourceLocation()
{
    return null;
}
 
开发者ID:FINRAOS,项目名称:herd,代码行数:6,代码来源:MockProceedingJoinPoint.java

示例9: getSourceLocation

import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
public SourceLocation getSourceLocation() {
    return null;
}
 
开发者ID:payneteasy,项目名称:superfly,代码行数:4,代码来源:ExceptionConversionAspectTest.java

示例10: getSourceLocation

import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public SourceLocation getSourceLocation() {
  return joinPoint.getSourceLocation();
}
 
开发者ID:sealuzh,项目名称:PerformanceHat,代码行数:8,代码来源:AbstractProceedingJoinPointDecorator.java

示例11: getSourceLocation

import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
public SourceLocation getSourceLocation() {
	if (this.sourceLocation == null) {
		this.sourceLocation = new SourceLocationImpl();
	}
	return this.sourceLocation;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:7,代码来源:MethodInvocationProceedingJoinPoint.java

示例12: getSourceLocation

import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
public SourceLocation getSourceLocation() {
    return sourceLocation;
}
 
开发者ID:jensnerche,项目名称:TraceToPlantUml,代码行数:4,代码来源:TracingEvent.java

示例13: getSourceLocation

import org.aspectj.lang.reflect.SourceLocation; //导入依赖的package包/类
@Override
public SourceLocation getSourceLocation() {
    return this.joinpoint.getSourceLocation();
}
 
开发者ID:jcabi,项目名称:jcabi-aspects,代码行数:5,代码来源:ImprovedJoinPoint.java


注:本文中的org.aspectj.lang.reflect.SourceLocation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。