List of utility methods to do Aspectj Usage
Class extends Object> | getTargetClass(JoinPoint jp) Get target class return jp.getTarget().getClass();
|
List | getTargets(IProgramElement node, IRelationship.Kind kind) Calculate the targets for a given IProgramElement (and it's immediate children if its not a type or if the child is CODE) and relationship kind return getTargets(node, kind, null);
|
boolean | isAnonymous(IProgramElement node) is Anonymous boolean isIntName = true; try { Integer.valueOf(node.getName()); } catch (NumberFormatException nfe) { isIntName = false; return isIntName || node.getName().startsWith("new "); |
boolean | isConstantPushInstruction(Instruction i) is Constant Push Instruction long ii = Constants.instFlags[i.opcode]; return ((ii & Constants.PUSH_INST) != 0 && (ii & Constants.CONSTANT_INST) != 0); |
boolean | isSuppressing(Member member, String lintkey) Checks for suppression specified on the member or on the declaring type of that member boolean isSuppressing = Utils.isSuppressing(member.getAnnotations(), lintkey); if (isSuppressing) { return true; UnresolvedType type = member.getDeclaringType(); if (type instanceof ResolvedType) { return Utils.isSuppressing(((ResolvedType) type).getAnnotations(), lintkey); return false; |
Object | proceedAroundCallAtAspectJ(JoinPoint thisJoinPoint) proceed Around Call At Aspect J Object ret = null; Object args[] = thisJoinPoint.getArgs(); if (args.length > 0) { int proceedIndex = (args.length - 1); if (args[proceedIndex] instanceof ProceedingJoinPoint) { ret = ((ProceedingJoinPoint) args[proceedIndex]).proceed(); return ret; |
Object | process(ProceedingJoinPoint point, Object[] args) process try { return point.proceed(args); } catch (Throwable e) { throw new Exception(e); |
List | readAjAttributes(String classname, Attribute[] as, ISourceContext context, World w, AjAttribute.WeaverVersionInfo version, ConstantPoolReader dataDecompressor) read Aj Attributes List<AjAttribute> attributes = new ArrayList<AjAttribute>(); List<Unknown> forSecondPass = new ArrayList<Unknown>(); for (int i = as.length - 1; i >= 0; i--) { Attribute a = as[i]; if (a instanceof Unknown) { Unknown u = (Unknown) a; String name = u.getName(); if (name.charAt(0) == 'o') { ... |
String | renderArgs(JoinPoint jp) render Args 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++) { ... |
String | renderJoinPoint(JoinPoint jp) render Join Point Signature sig = jp.getSignature(); return sig.getDeclaringType().getSimpleName() + "." + sig.getName(); |