Java Aspectj Usage isAnonymous(IProgramElement node)

Here you can find the source of isAnonymous(IProgramElement node)

Description

is Anonymous

License

Open Source License

Declaration

public static boolean isAnonymous(IProgramElement node) 

Method Source Code

//package com.java2s;
/* *******************************************************************
 * Copyright (c) 2003 Contributors.// w w w . j  ava2s  . c  o m
 * All rights reserved. 
 * This program and the accompanying materials are made available 
 * under the terms of the Eclipse Public License v1.0 
 * which accompanies this distribution and is available at 
 * http://www.eclipse.org/legal/epl-v10.html 
 *  
 * Contributors: 
 *     Mik Kersten     initial implementation 
 * ******************************************************************/

import org.aspectj.asm.IProgramElement;

public class Main {
    public static boolean isAnonymous(IProgramElement node) {
        boolean isIntName = true;
        try {
            Integer.valueOf(node.getName());
        } catch (NumberFormatException nfe) {
            // !!! using exceptions for logic, fix
            isIntName = false;
        }
        // System.err.println(">>>>>>>> " + node.getName());
        return isIntName || node.getName().startsWith("new ");
        // return isIntName;
        // if (!isIntName) {
        //          
        // return node.getName().startsWith("new ");
        // } else {
        // return false;
        // }
    }
}

Related

  1. getPackagesInModel(AsmManager modl)
  2. getSignature(Signature signature, String nameFromAnnotation, boolean absolute)
  3. getSourceLine(InstructionHandle ih)
  4. getTargetClass(JoinPoint jp)
  5. getTargets(IProgramElement node, IRelationship.Kind kind)
  6. isConstantPushInstruction(Instruction i)
  7. isSuppressing(Member member, String lintkey)
  8. proceedAroundCallAtAspectJ(JoinPoint thisJoinPoint)
  9. process(ProceedingJoinPoint point, Object[] args)