Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.ArrayType


            il.append(factory.createLoad(Type.OBJECT, indexParam));
            il.append(factory.createInvoke(
                    TransformationUtil.MEMBER_METHOD_JOIN_POINT_CLASS,
                    "setParameters",
                    Type.VOID,
                    new Type[]{new ArrayType(Type.OBJECT, 1)},
                    Constants.INVOKEVIRTUAL
            ));
            indexParam++;

        } // end - if parameters.length != 0
View Full Code Here


            il.append(factory.createInvoke(
                    TransformationUtil.INTRODUCTION_CLASS,
                    "invoke",
                    Type.OBJECT,
                    new Type[]{Type.INT, new ArrayType(Type.OBJECT, 1), Type.OBJECT},
                    Constants.INVOKEVIRTUAL));
        }
        else {
            // get the aspectwerkz system
            il.append(new PUSH(cpg, uuid));
View Full Code Here

    int nArgs = argTypes.length;

    /** Create an array of objects (Object[] args = new Objects[nArgs]) */
    this.il.append(new PUSH(peerClassGen._cp, nArgs));
    this.il.append(peerClassGen._factory.createNewArray(Type.OBJECT, (short) 1));
    LocalVariableGen lg = this.nativeMth.addLocalVariable("argValue", new ArrayType(Type.OBJECT, 1), null, null);
    int argValue = lg.getIndex();
    this.il.append(InstructionFactory.createStore(Type.OBJECT, argValue));

    if(genSource()) {
      this.sourceGen.printCreateArgsVal(nArgs);
View Full Code Here

    int nArgs = argTypes.length;

    /** Create an array of Class<?> (Class<?>[] argType = new Class<?>[nArgs]) */
    this.il.append(new PUSH(peerClassGen._cp, nArgs));
    this.il.append(peerClassGen._factory.createNewArray(new ObjectType("java.lang.Class"), (short) 1));
    LocalVariableGen lg = this.nativeMth.addLocalVariable("argType", new ArrayType(new ObjectType("java.lang.Class"), 1), null, null);
    int argType = lg.getIndex();
    this.il.append(InstructionFactory.createStore(Type.OBJECT, argType));

    if(genSource()) {
      sourceGen.printCreateArgsType(nArgs);
View Full Code Here

    String name = this.mi.getName();
    this.il.append(InstructionFactory.createLoad(Type.OBJECT, callerClass));
    this.il.append(new PUSH(peerClassGen._cp, name));
    this.il.append(InstructionFactory.createLoad(Type.OBJECT, argType));

    this.il.append(peerClassGen._factory.createInvoke("java.lang.Class", "getDeclaredMethod", new ObjectType("java.lang.reflect.Method"), new Type[] { Type.STRING, new ArrayType(new ObjectType("java.lang.Class"), 1) }, Constants.INVOKEVIRTUAL));

    LocalVariableGen lg = this.nativeMth.addLocalVariable("method", new ObjectType("java.lang.reflect.Method"), null, null);
    int method = lg.getIndex();
    this.il.append(InstructionFactory.createStore(Type.OBJECT, method));
View Full Code Here

  private int getConstructor (int callerClass, int argType){
    String name = this.mi.getName();
    this.il.append(InstructionFactory.createLoad(Type.OBJECT, callerClass));
    this.il.append(InstructionFactory.createLoad(Type.OBJECT, argType));

    this.il.append(peerClassGen._factory.createInvoke("java.lang.Class", "getDeclaredConstructor", new ObjectType("java.lang.reflect.Constructor"), new Type[] { new ArrayType(new ObjectType("java.lang.Class"), 1) }, Constants.INVOKEVIRTUAL));

    LocalVariableGen lg = this.nativeMth.addLocalVariable("ctor", new ObjectType("java.lang.reflect.Constructor"), null, null);
    int method = lg.getIndex();
    this.il.append(InstructionFactory.createStore(Type.OBJECT, method));
View Full Code Here

    else
      // loading the caller object
      this.il.append(InstructionFactory.createLoad(Type.OBJECT, caller));

    this.il.append(InstructionFactory.createLoad(Type.OBJECT, argValue));
    this.il.append(peerClassGen._factory.createInvoke("java.lang.reflect.Method", "invoke", Type.OBJECT, new Type[] { Type.OBJECT, new ArrayType(Type.OBJECT, 1) }, Constants.INVOKEVIRTUAL));
    if (!mi.getReturnTypeName().equals("void")){
      LocalVariableGen lg = this.nativeMth.addLocalVariable("returnValue", Type.OBJECT, null, null);
      returnValue = lg.getIndex();
      this.il.append(InstructionFactory.createStore(Type.OBJECT, returnValue));
    } else{
View Full Code Here

  private int createNewInstance (int method, int argValue){
    int returnValue = -1;
    this.il.append(InstructionFactory.createLoad(Type.OBJECT, method));
    this.il.append(InstructionFactory.createLoad(Type.OBJECT, argValue));
    this.il.append(peerClassGen._factory.createInvoke("java.lang.reflect.Constructor", "newInstance", Type.OBJECT, new Type[] { new ArrayType(Type.OBJECT, 1) }, Constants.INVOKEVIRTUAL));
    LocalVariableGen lg = this.nativeMth.addLocalVariable("returnValue", Type.OBJECT, null, null);
    returnValue = lg.getIndex();
    this.il.append(InstructionFactory.createStore(Type.OBJECT, returnValue));

    if(genSource()) {
View Full Code Here

            bcelReturnType = Type.BYTE;
        }
        else if (type.endsWith("[]")) {
            int index = type.indexOf('[');
            int dimensions = type.length() - index >> 1; // we need number of dimensions
            bcelReturnType = new ArrayType(type.substring(0, index), dimensions);
        }
        else {
            bcelReturnType = new ObjectType(type);
        }
        return bcelReturnType;
View Full Code Here

            il.append(factory.createLoad(Type.OBJECT, indexParam));
            il.append(factory.createInvoke(
                    TransformationUtil.MEMBER_METHOD_JOIN_POINT_CLASS,
                    "setParameters",
                    Type.VOID,
                    new Type[]{new ArrayType(Type.OBJECT, 1)},
                    Constants.INVOKEVIRTUAL
            ));
            indexParam++;

        } // end - if parameters.length != 0
View Full Code Here

TOP

Related Classes of org.apache.bcel.generic.ArrayType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.