Java Utililty Methods Aspectj Usage

List of utility methods to do Aspectj Usage

Description

The list of methods to do Aspectj Usage are organized into topic(s).

Method

ClassgetTargetClass(JoinPoint jp)
Get target class
return jp.getTarget().getClass();
ListgetTargets(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);
booleanisAnonymous(IProgramElement node)
is Anonymous
boolean isIntName = true;
try {
    Integer.valueOf(node.getName());
} catch (NumberFormatException nfe) {
    isIntName = false;
return isIntName || node.getName().startsWith("new ");
booleanisConstantPushInstruction(Instruction i)
is Constant Push Instruction
long ii = Constants.instFlags[i.opcode];
return ((ii & Constants.PUSH_INST) != 0 && (ii & Constants.CONSTANT_INST) != 0);
booleanisSuppressing(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;
ObjectproceedAroundCallAtAspectJ(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;
Objectprocess(ProceedingJoinPoint point, Object[] args)
process
try {
    return point.proceed(args);
} catch (Throwable e) {
    throw new Exception(e);
ListreadAjAttributes(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') { 
...
StringrenderArgs(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++) {
...
StringrenderJoinPoint(JoinPoint jp)
render Join Point
Signature sig = jp.getSignature();
return sig.getDeclaringType().getSimpleName() + "." + sig.getName();