Examples of ClassItem


Examples of org.jibx.binding.classes.ClassItem

        // nothing to be done if called on "this" or implicit reference
        if (!m_isThis && !m_isImplicit) {
       
            // first check direct access to property from method class
            ClassFile from = mb.getClassFile();
            ClassItem access = m_getMethod;
            if (access == null) {
                access = m_fieldItem;
            }
            if (access != null && !from.isAccessible(access)) {
                access = m_objContext.getBoundClass().
                    getLoadMethod(access, mb.getClassFile());
            }
       
            // generated instruction either loads a field value or calls a "get"
            //  method, as appropriate
            if (access == null) {
                Integer index = (Integer)mb.getKeyValue(this);
                discardValue(mb);
                if (index == null) {
                    mb.appendACONST_NULL();
                } else {
                    mb.appendLoadLocal(index.intValue());
                }
            } else {
                if (access.isStatic()) {
                    discardValue(mb);
                }
                if (access.isMethod()) {
                    if (access.getArgumentCount() > 0) {
                        mb.loadContext();
                    }
                    mb.addMethodExceptions(access);
                    mb.appendCall(access);
                } else {
View Full Code Here

Examples of org.jibx.binding.classes.ClassItem

            // nothing to be done if called on "this" or implicit reference
            if (!m_isThis && !m_isImplicit) {
           
                // first check direct access to property from method class
                ClassFile from = mb.getClassFile();
                ClassItem access = m_setMethod;
                if (access == null) {
                    access = m_fieldItem;
                }
                if (!from.isAccessible(access)) {
                    access = m_objContext.getBoundClass().
                        getStoreMethod(access, mb.getClassFile());
                }
               
                // save to local if no way of getting value
                if (m_getMethod == null && m_fieldItem == null) {
                    duplicateValue(mb);
                    Integer index = (Integer)mb.getKeyValue(this);
                    if (index == null) {
                        int slot = mb.addLocal(null,
                            ClassItem.typeFromName(m_setValueType));
                        index = IntegerCache.getInteger(slot);
                        mb.setKeyValue(this, index);
                    } else {
                        mb.appendStoreLocal(index.intValue());
                    }
                }
               
                // generated instruction either stores a field value or calls a
                //  "set" method, as appropriate
                if (access.isMethod()) {
                    if (access.getArgumentCount() > 1) {
                       
                        // this test is ugly, needed because of backfill method
                        //  calls from ValueChild
                        if (mb instanceof ContextMethodBuilder) {
                            ((ContextMethodBuilder)mb).loadContext();
                        } else {
                            mb.appendACONST_NULL();
                        }
                    }
                    mb.addMethodExceptions(access);
                    mb.appendCall(access);
                } else {
                    mb.appendPut(access);
                }
                if (access.isStatic()) {
                    discardValue(mb);
                }
            }
        }
    }
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.