Package org.apache.bcel.generic

Examples of org.apache.bcel.generic.ObjectType


        case Constants.T_SHORT:
        case Constants.T_INT:
        case Constants.T_LONG:
        case Constants.T_FLOAT:
        case Constants.T_DOUBLE:
            il.append(fac.createCast(Type.OBJECT, new ObjectType(
                    BASIC_CLASS_NAMES[tag])));
            return emitInvoke(il, fac, UNBOXING_METHOD[tag]);

        case Constants.T_OBJECT:
        case Constants.T_ARRAY:
View Full Code Here


        // }
        String declaringClassName = field.getDeclaringClass().getName();
        InstructionList instructionList = new InstructionList();
        // push 'target' onto operand stack
        instructionList.append(new ALOAD(1));
        ReferenceType targetType = new ObjectType(declaringClassName);
        instructionList.append(instructionFactory.createCheckCast(targetType));

        Class fieldTypeClass = field.getType();
        Type fieldType = computeType(fieldTypeClass);
        pushAndConvertValueArg(instructionList, instructionFactory,
View Full Code Here

        // pushd 'target' onto operand stack
        instructionList.append(new ALOAD(1));

        boolean isStaticField = Modifier.isStatic(field.getModifiers());
        String declaringClassName = field.getDeclaringClass().getName();
        ReferenceType targetType = new ObjectType(declaringClassName);
        Class fieldTypeClass = field.getType();
        Type fieldType = computeType(fieldTypeClass);
        if (isStaticField) {
            // handle static fields -- simply pop rather than checkcast
            instructionList.append(new POP());
View Full Code Here

        InstructionList instructionList = new InstructionList();
        // pushd 'target' onto operand stack
        instructionList.append(new ALOAD(1));

        String targetClassName = method.getDeclaringClass().getName();
        ReferenceType targetType = new ObjectType(targetClassName);
        // generate invoke instruction
        Class returnTypeClass = method.getReturnType();
        Type returnType = computeType(returnTypeClass);
        boolean isStaticMethod = Modifier.isStatic(method.getModifiers());
        if (!isStaticMethod) {
View Full Code Here

        Type returnType = computeType(returnTypeClass);
        String targetClassName = method.getDeclaringClass().getName();
        InstructionList instructionList = new InstructionList();
        // pushd 'target' and 'value' onto operand stack and check type of each
        instructionList.append(new ALOAD(1));
        ReferenceType targetType = new ObjectType(targetClassName);
        instructionList.append(instructionFactory.createCheckCast(targetType));

        Class valueTypeClass = method.getParameterTypes()[0];
        Type valueType = computeType(valueTypeClass);
        pushAndConvertValueArg(instructionList, instructionFactory, valueTypeClass,
View Full Code Here

        mf.addExceptionHandler(
            tryStart,
            tryEnd,
            catchHandle,
            new ObjectType(ClassNotFoundException.class.getName()));

        InstructionHandle end = mf.append(InstructionConstants.NOP);

        ifNotNullBI.setTarget(end);
        jumpOut.setTarget(end);
View Full Code Here

    {
        Type result = (Type) _objectTypeMap.get(type);

        if (result == null)
        {
            result = new ObjectType(type);
            _objectTypeMap.put(type, result);
        }

        return result;
    }
View Full Code Here

  private void createFields(Pair<String,String>[] fieldDefs) {
    FieldGen field;

    for (Pair<String,String> aField : fieldDefs) {
      field = new FieldGen(ACC_PUBLIC, new ObjectType(aField.first), aField.second, _cp);
      _cg.addField(field.getField());
    }
  }
View Full Code Here

                // Build the initial frame situation for this method.
                Frame f = new Frame(mg.getMaxLocals(), mg.getMaxStack());
                if (!mg.isStatic()) {
                    if (mg.getName().equals(Constants.CONSTRUCTOR_NAME)) {
                        Frame._this = new UninitializedObjectType(new ObjectType(jc.getClassName()));
                        f.getLocals().set(0, Frame._this);
                    } else {
                        Frame._this = null;
                        f.getLocals().set(0, new ObjectType(jc.getClassName()));
                    }
                }
                Type[] argtypes = mg.getArgumentTypes();
                int twoslotoffset = 0;
                for (int j = 0; j < argtypes.length; j++) {
View Full Code Here

                return;
        }

        final FieldGen field = new FieldGen(
                Constants.ACC_PRIVATE | Constants.ACC_FINAL | Constants.ACC_STATIC,
                new ObjectType("java.lang.Class"),
                TransformationUtil.STATIC_CLASS_FIELD,
                cp
        );

        cg.addField(field.getField());
View Full Code Here

TOP

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

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.