Package alt.jiapi.reflect

Examples of alt.jiapi.reflect.InstructionFactory.cast()


        // Get the initialized value from Runtime.
        il.add(factory.pushConstant(fieldName));
        il.add(factory.invoke(getFieldValue));
       
        // Cast the field.
        il.add(factory.cast(field.getTypeName()));

        // Set the field.
        il.add(factory.setField(field));

        forward(il);
View Full Code Here


            initializer.add(factory.pushConstant(fieldName));
            initializer.add(factory.invoke(gfv));


            // put the returned event producer to __jiapi_field
            initializer.add(factory.cast(ep.getClass().getName()));
            initializer.add(factory.setField(eventProducerField));
        }
        catch(NoSuchMethodException nsme) {
            nsme.printStackTrace();
        }
View Full Code Here

            try {
                JiapiClass jc = new Loader().loadClass("java.lang.Integer");
                JiapiMethod jm =
                    jc.getDeclaredMethod("intValue", new String[0]);

                il.add(factory.cast("java.lang.Integer"));
                il.add(factory.invoke(jm));
            }
            catch(Exception e) {
                e.printStackTrace();
            }
View Full Code Here

            try {
                JiapiClass jc = new Loader().loadClass("java.lang.Long");
                JiapiMethod jm =
                    jc.getDeclaredMethod("longValue", new String[0]);

                il.add(factory.cast("java.lang.Long"));
                il.add(factory.invoke(jm));
            }
            catch(Exception e) {
                e.printStackTrace();
            }
View Full Code Here

            try {
                JiapiClass jc = new Loader().loadClass("java.lang.Character");
                JiapiMethod jm =
                    jc.getDeclaredMethod("charValue", new String[0]);

                il.add(factory.cast("java.lang.Character"));
                il.add(factory.invoke(jm));
            }
            catch(Exception e) {
                e.printStackTrace();
            }
View Full Code Here

            try {
                JiapiClass jc = new Loader().loadClass("java.lang.Boolean");
                JiapiMethod jm =
                    jc.getDeclaredMethod("booleanValue", new String[0]);

                il.add(factory.cast("java.lang.Boolean"));
                il.add(factory.invoke(jm));
            }
            catch(Exception e) {
                e.printStackTrace();
            }
View Full Code Here

            try {
                JiapiClass jc = new Loader().loadClass("java.lang.Byte");
                JiapiMethod jm =
                    jc.getDeclaredMethod("byteValue", new String[0]);

                il.add(factory.cast("java.lang.Byte"));
                il.add(factory.invoke(jm));
            }
            catch(Exception e) {
                e.printStackTrace();
            }
View Full Code Here

            try {
                JiapiClass jc = new Loader().loadClass("java.lang.Float");
                JiapiMethod jm =
                    jc.getDeclaredMethod("floatValue", new String[0]);

                il.add(factory.cast("java.lang.Float"));
                il.add(factory.invoke(jm));
            }
            catch(Exception e) {
                e.printStackTrace();
            }
View Full Code Here

            try {
                JiapiClass jc = new Loader().loadClass("java.lang.Double");
                JiapiMethod jm =
                    jc.getDeclaredMethod("doubleValue", new String[0]);

                il.add(factory.cast("java.lang.Double"));
                il.add(factory.invoke(jm));
            }
            catch(Exception e) {
                e.printStackTrace();
            }
View Full Code Here

            // Pop out the return value(probably null) of
            // the invocation handler if it was a 'void' method
            il.add(new Instruction(new byte[]{Opcodes.POP}));
        }
        else { // Cast to correct Object
            il.add(factory.cast(ins.getReturnType()));
        }
    }


    private void addClassForNameInstructions(String name, InstructionList il) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.