Java Aspectj Usage getMethodArgByIndex(final JoinPoint joinPoint, final int index)

Here you can find the source of getMethodArgByIndex(final JoinPoint joinPoint, final int index)

Description

get Method Arg By Index

License

Apache License

Declaration

public static Optional<Object> getMethodArgByIndex(final JoinPoint joinPoint, final int index) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import org.aspectj.lang.JoinPoint;
import java.util.Optional;

public class Main {
    public static Optional<Object> getMethodArgByIndex(final JoinPoint joinPoint, final int index) {
        return Optional.ofNullable(joinPoint.getArgs()).filter(args -> index >= 0 && index < args.length)
                .map(args -> args[index]);
    }/*from  www.j ava 2  s . c  om*/
}

Related

  1. genPointcutDetails(Pointcut pcd)
  2. genSignature(IProgramElement node)
  3. getArgsMap(JoinPoint pjp)
  4. getFieldName(JoinPoint jp)
  5. getFilesInPackage(IProgramElement packageNode)
  6. getMethodName(ProceedingJoinPoint pjp)
  7. getPackagesHelper(IProgramElement node, IProgramElement.Kind kind, String prename, List matches)
  8. getPackagesInModel(AsmManager modl)
  9. getSignature(Signature signature, String nameFromAnnotation, boolean absolute)