Package org.jibx.binding.classes

Examples of org.jibx.binding.classes.UnmarshalBuilder


        if (m_unmarshalContentName == null) {
           
            // set up for constructing new method
            String name = m_container.getBindingRoot().getPrefix() +
                UNMARSHAL_SUFFIX;
            UnmarshalBuilder meth = new UnmarshalBuilder(name,
                m_class.getClassFile(), m_class.getMungedFile());
            m_unmarshalContentName = meth.getFullName();
            m_unmarshalSignature = meth.getSignature();
           
            // if preset method supplied add code to call it
            if (!hasAttribute() && m_preSetMethod != null) {
                meth.loadObject();
                genUserMethodCall(true, m_preSetMethod, meth);
            }
           
            // push object being unmarshalled to unmarshaller stack
            meth.loadContext();
            meth.loadObject();
            String mname = hasAttribute() ? UNMARSHAL_PUSHOBJECTMETHOD :
                UNMARSHAL_PUSHTRACKEDOBJECTMETHOD;
            meth.appendCallVirtual(mname, PUSHOBJECT_SIGNATURE);
           
            // generate the actual unmarshalling code in method
            meth.loadObject();
            if (!m_fakeContent) {
                m_component.genContentUnmarshal(meth);
            }
           
            // pop object from unmarshal stack
            meth.loadContext();
            meth.appendCallVirtual(UNMARSHAL_POPOBJECTMETHOD,
                POPOBJECT_SIGNATURE);
           
            // if postset method supplied and no attributes add code to call
            if (m_postSetMethod != null) {
                genUserMethodCall(true, m_postSetMethod, meth);
            }
           
            // finish by returning object
            meth.loadObject();
            meth.appendReturn(m_class.getClassFile().getName());
           
            // add method to class
            if (m_lockContentUnmarshal) {
                m_unmarshalContentMethod =
                    m_class.getUniqueNamed(meth).getItem();
View Full Code Here


        if (m_unmarshalAttributeName == null) {
           
            // set up for constructing new method
            String name = m_container.getBindingRoot().getPrefix() +
                UNMARSHAL_ATTR_SUFFIX;
            UnmarshalBuilder meth = new UnmarshalBuilder(name,
                m_class.getClassFile(), m_class.getMungedFile());
            m_unmarshalAttributeName = meth.getFullName();
            m_unmarshalSignature = meth.getSignature();
           
            // if preset method supplied add code to call it
            if (m_preSetMethod != null) {
                meth.loadObject();
                genUserMethodCall(true, m_preSetMethod, meth);
            }
           
            // push object being unmarshalled to unmarshaller stack
            meth.loadContext();
            meth.loadObject();
            meth.appendCallVirtual(UNMARSHAL_PUSHTRACKEDOBJECTMETHOD,
                PUSHOBJECT_SIGNATURE);
           
            // generate the actual unmarshalling code in method
            meth.loadObject();
            m_component.genAttributeUnmarshal(meth);
           
            // pop object from unmarshal stack
            meth.loadContext();
            meth.appendCallVirtual(UNMARSHAL_POPOBJECTMETHOD,
                POPOBJECT_SIGNATURE);
           
            // if postset method supplied and no content add code to call it
            if (m_postSetMethod != null && !hasContent()) {
                genUserMethodCall(true, m_postSetMethod, meth);
            }
           
            // finish by returning object
            meth.loadObject();
            meth.appendReturn(m_class.getClassFile().getName());
           
            // add method to class
            if (m_lockAttributeUnmarshal) {
                m_unmarshalAttributeMethod =
                    m_class.getUniqueNamed(meth).getItem();
View Full Code Here

TOP

Related Classes of org.jibx.binding.classes.UnmarshalBuilder

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.