Package org.jibx.runtime.impl

Examples of org.jibx.runtime.impl.MarshallingContext.startTagAttributes()


            throw new JiBXException("Invalid context type for marshaller");
        } else {
           
            // generate the element start tag
            MarshallingContext ctx = (MarshallingContext)ictx;
            ctx.startTagAttributes(m_index, m_name);
           
            // add attribute reference to object ID
            ctx.attribute(0, getAttributeName(), getIdValue(obj));
           
            // close start tag for empty element
View Full Code Here


                Map.Entry entry = (Map.Entry)iter.next();
                Object value = entry.getValue();
                if (value != null) {
                   
                    // write element with key attribute
                    ctx.startTagAttributes(m_index, ENTRY_ELEMENT_NAME);
                    ctx.attribute(m_index, KEY_ATTRIBUTE_NAME,
                        entry.getKey().toString());
                   
                    // translate value object class to schema type
                    String tname = value.getClass().getName();
View Full Code Here

        } else {
           
            // start by generating start tag for container
            MarshallingContext ctx = (MarshallingContext)ictx;
            HashMap map = (HashMap)obj;
            ctx.startTagAttributes(m_index, m_name).
                attribute(m_index, SIZE_ATTRIBUTE_NAME, map.size()).
                closeStartContent();
           
            // loop through all entries in hashmap
            Iterator iter = map.entrySet().iterator();
View Full Code Here

           
            // loop through all entries in hashmap
            Iterator iter = map.entrySet().iterator();
            while (iter.hasNext()) {
                Map.Entry entry = (Map.Entry)iter.next();
                ctx.startTagAttributes(m_index, ENTRY_ELEMENT_NAME);
                if (entry.getKey() != null) {
                    ctx.attribute(m_index, KEY_ATTRIBUTE_NAME,
                        entry.getKey().toString());
                }
                ctx.closeStartContent();
View Full Code Here

                        obj.getClass().getName() + " is not marshallable");
                }
            } else if (value.equals(obj)) {
               
                // generate reference to previously-defined item
                ctx.startTagAttributes(m_index, m_name);
                ctx.attribute(0, getAttributeName(), id);
                ctx.closeStartEmpty();
               
            } else {
                throw new JiBXException("Duplicate definition for ID " + id);
View Full Code Here

        } else {
           
            // start by generating start tag for container
            MarshallingContext ctx = (MarshallingContext)ictx;
            Map map = (Map)obj;
            ctx.startTagAttributes(m_index, m_name).
                attribute(m_index, getSizeAttributeName(), map.size()).
                closeStartContent();
           
            // loop through all entries in map
            Iterator iter = map.entrySet().iterator();
View Full Code Here

           
            // loop through all entries in map
            Iterator iter = map.entrySet().iterator();
            while (iter.hasNext()) {
                Map.Entry entry = (Map.Entry)iter.next();
                ctx.startTagAttributes(m_index, getEntryElementName());
                ctx.attribute(m_index, getKeyAttributeName(),
                    entry.getKey().toString());
                ctx.closeStartContent();
                if (entry.getValue() instanceof IMarshallable) {
                    ((IMarshallable)entry.getValue()).marshal(ctx);
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.