Examples of appendDUP()


Examples of org.jibx.binding.classes.ContextMethodBuilder.appendDUP()

                } else if (m_createClass.isInterface() ||
                    m_createClass.isAbstract()) {
                   
                    // cannot create instance, throw exception
                    mb.appendCreateNew(MethodBuilder.FRAMEWORK_EXCEPTION_CLASS);
                    mb.appendDUP();
                    mb.appendLoadConstant("Cannot create instance of interface or abstract class " +
                        m_createClass.getName());
                    mb.appendCallInit(MethodBuilder.FRAMEWORK_EXCEPTION_CLASS,
                        MethodBuilder.EXCEPTION_CONSTRUCTOR_SIGNATURE1);
                    mb.appendThrow();
View Full Code Here

Examples of org.jibx.binding.classes.ContextMethodBuilder.appendDUP()

                            m_createClass.addDefaultConstructor();
                        } else {
                           
                            // cannot create instance, throw exception
                            mb.appendCreateNew(MethodBuilder.FRAMEWORK_EXCEPTION_CLASS);
                            mb.appendDUP();
                            mb.appendLoadConstant("Cannot create instance of class " +
                                m_createClass.getName() + " (no default constructor)");
                            mb.appendCallInit(MethodBuilder.FRAMEWORK_EXCEPTION_CLASS,
                                MethodBuilder.EXCEPTION_CONSTRUCTOR_SIGNATURE1);
                            mb.appendThrow();
View Full Code Here

Examples of org.jibx.binding.classes.ContextMethodBuilder.appendDUP()

                    if (haveobj) {
                       
                        // no factory, so create an instance, duplicate the
                        //  reference, and then call the null constructor
                        mb.appendCreateNew(m_createClass.getName());
                        mb.appendDUP();
                        mb.appendCallInit(m_createClass.getName(),"()V");
                       
                    }
                }
               
View Full Code Here

Examples of org.jibx.binding.classes.ExceptionMethodBuilder.appendDUP()

            dmeth.appendReturn(type);
            dmeth.targetNext(nonnull);
           
            // set up locals for array of values and decrementing index
            dmeth.appendCallStatic(type + ".values", "()[" + typesig);
            dmeth.appendDUP();
            int arraylocal = dmeth.addLocal("values",
                ClassItem.typeFromName(type + "[]"));
            dmeth.appendARRAYLENGTH();
            int arrayindex = dmeth.addLocal("index",
                ClassItem.typeFromName("int"));
View Full Code Here

Examples of org.jibx.binding.classes.ExceptionMethodBuilder.appendDUP()

            dmeth.appendLoadLocal(arrayindex);
            BranchWrapper loadnext = dmeth.appendIFGE(dmeth);
           
            // throw an exception for value not found
            dmeth.appendCreateNew("java.lang.StringBuffer");
            dmeth.appendDUP();
            dmeth.appendLoadConstant("No match found for value '");
            dmeth.appendCallInit("java.lang.StringBuffer",
                "(Ljava/lang/String;)V");
            dmeth.appendLoadLocal(0);
            dmeth.appendCallVirtual("java.lang.StringBuffer.append",
View Full Code Here

Examples of org.jibx.binding.classes.ExceptionMethodBuilder.appendDUP()

            tmap = cf.addPrivateField(STRINGINT_MAPTYPE, TYPEMAP_NAME);
           
            // initialize with appropriate size
            mb.appendLoadLocal(0);
            mb.appendCreateNew(STRINGINT_MAPTYPE);
            mb.appendDUP();
            mb.appendLoadConstant(tnames.size());
            mb.appendCallInit(STRINGINT_MAPTYPE, STRINGINTINIT_SIGNATURE);
           
            // add all values to map
            for (int i = 0; i < tnames.size(); i++) {
View Full Code Here

Examples of org.jibx.binding.classes.ExceptionMethodBuilder.appendDUP()

           
            // add all values to map
            for (int i = 0; i < tnames.size(); i++) {
                int index = s_mappedClasses.find(tnames.get(i));
                if (index >= 0) {
                    mb.appendDUP();
                    mb.appendLoadConstant((String)tnames.get(i));
                    mb.appendLoadConstant(index);
                    mb.appendCallVirtual(STRINGINTADD_METHOD,
                        STRINGINTADD_SIGNATURE);
                    mb.appendPOP();
View Full Code Here

Examples of org.jibx.binding.classes.ExceptionMethodBuilder.appendDUP()

            ClassItem.typeFromName(FACTORY_INTERFACE), new Type[0], cf,
            (short)(Constants.ACC_PUBLIC | Constants.ACC_STATIC));
        mb.appendGetStatic(inst);
        BranchWrapper ifdone = mb.appendIFNONNULL(this);
        mb.appendCreateNew(cf.getName());
        mb.appendDUP();
        mb.appendCallInit(cf.getName(), "()V");
        mb.appendPutStatic(inst);
        mb.targetNext(ifdone);
        mb.appendGetStatic(inst);
        mb.appendReturn(FACTORY_INTERFACE);
View Full Code Here

Examples of org.jibx.binding.classes.ExceptionMethodBuilder.appendDUP()

        // create argument array of namespace URIs
        String[] nsuris = new String[m_namespaceUris.size()];
        mb.appendLoadConstant(m_namespaceUris.size());
        mb.appendCreateArray("java.lang.String");
        for (int i = 0; i < m_namespaceUris.size(); i++) {
            mb.appendDUP();
            mb.appendLoadConstant(i);
            String uri = (String)m_namespaceUris.get(i);
            mb.appendLoadConstant(uri);
            mb.appendAASTORE();
            nsuris[i] = uri;
View Full Code Here

Examples of org.jibx.binding.classes.ExceptionMethodBuilder.appendDUP()

        // create argument array of namespace prefixes
        if (m_isOutput) {
            mb.appendLoadConstant(m_namespacePrefixes.size());
            mb.appendCreateArray("java.lang.String");
            for (int i = 0; i < m_namespacePrefixes.size(); i++) {
                mb.appendDUP();
                mb.appendLoadConstant(i);
                mb.appendLoadConstant((String)m_namespacePrefixes.get(i));
                mb.appendAASTORE();
            }
        } else {
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.