Java Aspectj Usage getSignature(Signature signature, String nameFromAnnotation, boolean absolute)

Here you can find the source of getSignature(Signature signature, String nameFromAnnotation, boolean absolute)

Description

get Signature

License

Open Source License

Declaration

public static String getSignature(Signature signature, String nameFromAnnotation, boolean absolute) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import org.aspectj.lang.Signature;

public class Main {
    public static String getSignature(Signature signature, String nameFromAnnotation, boolean absolute) {
        String className = null;//from w  w  w  . ja va  2s  . c om
        if (!absolute) {
            className = signature.getDeclaringTypeName();
            className = className.substring(className.lastIndexOf('.') + 1, className.length());
        }
        return getSignature(className, signature.getName(), nameFromAnnotation, absolute);
    }

    public static String getSignature(String simpleClassName, String methodName, String nameFromAnnotation,
            boolean absolute) {
        String result = nameFromAnnotation.isEmpty() ? methodName : nameFromAnnotation;
        if (!absolute) {
            result = simpleClassName + "#" + result;
        }
        return result;
    }
}

Related

  1. getFilesInPackage(IProgramElement packageNode)
  2. getMethodArgByIndex(final JoinPoint joinPoint, final int index)
  3. getMethodName(ProceedingJoinPoint pjp)
  4. getPackagesHelper(IProgramElement node, IProgramElement.Kind kind, String prename, List matches)
  5. getPackagesInModel(AsmManager modl)
  6. getSourceLine(InstructionHandle ih)
  7. getTargetClass(JoinPoint jp)
  8. getTargets(IProgramElement node, IRelationship.Kind kind)
  9. isAnonymous(IProgramElement node)