Java Aspectj Usage createInstanceof(InstructionFactory fact, ReferenceType t)

Here you can find the source of createInstanceof(InstructionFactory fact, ReferenceType t)

Description

create Instanceof

License

Open Source License

Declaration

public static Instruction createInstanceof(InstructionFactory fact, ReferenceType t) 

Method Source Code

//package com.java2s;
/* *******************************************************************
 * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC).
 * All rights reserved. //  w  w w  .j a  va2s.  c  om
 * 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: 
 *     PARC     initial implementation 
 * ******************************************************************/

import org.aspectj.apache.bcel.Constants;

import org.aspectj.apache.bcel.generic.ArrayType;

import org.aspectj.apache.bcel.generic.Instruction;

import org.aspectj.apache.bcel.generic.InstructionCP;

import org.aspectj.apache.bcel.generic.InstructionFactory;

import org.aspectj.apache.bcel.generic.ObjectType;
import org.aspectj.apache.bcel.generic.ReferenceType;

public class Main {
    public static Instruction createInstanceof(InstructionFactory fact, ReferenceType t) {
        int cpoolEntry = (t instanceof ArrayType) ? fact.getConstantPool().addArrayClass((ArrayType) t)
                : fact.getConstantPool().addClass((ObjectType) t);
        return new InstructionCP(Constants.INSTANCEOF, cpoolEntry);
    }
}

Related

  1. collectArguments(JoinPoint jp)
  2. combine(String[] one, String[] two)
  3. convertToFile(String path)
  4. copyInstruction(Instruction i)
  5. createConstant(InstructionFactory fact, int value)
  6. genPointcutDetails(Pointcut pcd)
  7. genSignature(IProgramElement node)
  8. getArgsMap(JoinPoint pjp)
  9. getFieldName(JoinPoint jp)