Java Aspectj Usage renderArgs(JoinPoint jp)

Here you can find the source of renderArgs(JoinPoint jp)

Description

render Args

License

Open Source License

Declaration

public static String renderArgs(JoinPoint jp) 

Method Source Code

//package com.java2s;
/*//w w w  .jav  a2s  . c  o  m
 *  Copyright (c) Ludger Solbach. All rights reserved.
 *  The use and distribution terms for this software are covered by the
 *  Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
 *  which can be found in the file license.txt at the root of this distribution.
 *  By using this software in any fashion, you are agreeing to be bound by
 *  the terms of this license.
 *  You must not remove this notice, or any other, from this software.
 */

import org.aspectj.lang.JoinPoint;

public class Main {
    public static String renderArgs(JoinPoint jp) {
        Object[] args = jp.getArgs();
        if (args == null || args.length == 0) {
            return "()";
        } else {
            StringBuilder sb = new StringBuilder();
            sb.append("(");
            sb.append(renderArg(args[0]));
            for (int i = 1; i < args.length; i++) {
                sb.append(", ");
                sb.append(renderArg(args[i]));
            }
            sb.append(")");
            return sb.toString();
        }
    }

    public static String renderArg(Object arg) {
        if (arg == null) {
            return "[null]";
        } else if (arg instanceof String) {
            return "\"" + arg + "\"";
        }
        return arg.toString();
    }
}

Related

  1. isConstantPushInstruction(Instruction i)
  2. isSuppressing(Member member, String lintkey)
  3. proceedAroundCallAtAspectJ(JoinPoint thisJoinPoint)
  4. process(ProceedingJoinPoint point, Object[] args)
  5. readAjAttributes(String classname, Attribute[] as, ISourceContext context, World w, AjAttribute.WeaverVersionInfo version, ConstantPoolReader dataDecompressor)
  6. renderJoinPoint(JoinPoint jp)
  7. resolveFileName(final String fileName)
  8. setSourceLine(InstructionHandle ih, int lineNumber)
  9. strip(String[] src, String[] toStrip)