Package org.jibx.binding.model

Examples of org.jibx.binding.model.MappingElementBase.children()


        assertEquals("child count", 2, childs.size());
        Object child = childs.get(0);
        assertTrue("child type", child instanceof MappingElement);
        MappingElementBase mapping = (MappingElementBase)child;
        assertEquals("mapped class", mapping.getClassName(), "DefaultPackageClass");
        assertEquals("mapped items", 5, mapping.children().size());
    }

    public void testSingleClassBinding() throws Exception {
        GlobalCustom custom = new GlobalCustom();
        custom.initClasses();
View Full Code Here


        assertEquals("child count", 3, childs.size());
        Object child = childs.get(1);
        assertTrue("child type", child instanceof MappingElement);
        MappingElementBase mapping = (MappingElementBase)child;
        assertEquals("mapped class", mapping.getClassName(), "org.jibx.binding.generator.DataClass1");
        assertEquals("mapped items", 4, mapping.children().size());
    }
   
    public void testMultiplePropertiesClasses1() throws Exception {
        GlobalCustom custom = readCustom(MULTIPLE_PROPERTIES_CLASSES1);
        BindGen gen = new BindGen(custom);
View Full Code Here

        assertEquals("mapped class", mapping.getClassName(), "org.jibx.binding.generator.DataClass1");
        QName qname = mapping.getTypeQName();
        assertNotNull("type name", qname);
        assertEquals("default type name", "dataClass1", qname.getName());
        assertEquals("default type namespace", "http://jibx.org/binding/generator", qname.getUri());
        assertEquals("mapped items", 4, mapping.children().size());
        // order of child values inside mapping not specified for class, so don't check
        child = childs.get(2);
        assertTrue("child type", child instanceof MappingElement);
        mapping = (MappingElementBase)child;
        assertFalse("expected concrete mapping second", mapping.isAbstract());
View Full Code Here

        assertTrue("child type", child instanceof MappingElement);
        mapping = (MappingElementBase)child;
        assertFalse("expected concrete mapping second", mapping.isAbstract());
        assertEquals("mapped class", mapping.getClassName(), "org.jibx.binding.generator.DataClass1");
        assertEquals("default element name", "dataClass1", mapping.getName());
        assertEquals("mapped items", 1, mapping.children().size());
        child = mapping.children().get(0);
        assertTrue("child type", child instanceof StructureElement);
        StructureElement struct = (StructureElement)child;
        assertEquals("mapping reference structure content", 0, struct.children().size());
        qname = struct.getMapAsQName();
View Full Code Here

        mapping = (MappingElementBase)child;
        assertFalse("expected concrete mapping second", mapping.isAbstract());
        assertEquals("mapped class", mapping.getClassName(), "org.jibx.binding.generator.DataClass1");
        assertEquals("default element name", "dataClass1", mapping.getName());
        assertEquals("mapped items", 1, mapping.children().size());
        child = mapping.children().get(0);
        assertTrue("child type", child instanceof StructureElement);
        StructureElement struct = (StructureElement)child;
        assertEquals("mapping reference structure content", 0, struct.children().size());
        qname = struct.getMapAsQName();
        assertNotNull("type name", qname);
View Full Code Here

        assertEquals("mapped class", mapping.getClassName(), "org.jibx.binding.generator.DataClass1");
        QName qname = mapping.getTypeQName();
        assertNotNull("type name", qname);
        assertEquals("specified type name", "class1", qname.getName());
        assertEquals("specified type namespace", "http://www.jibx.org/test", qname.getUri());
        ArrayList mapchilds = mapping.children();
        assertEquals("mapped items", 3, mapchilds.size());
        child = mapchilds.get(0);
        assertTrue("child type", child instanceof ValueElement);
        ValueElement value = (ValueElement)child;
        assertEquals("get method", "getString", value.getGetName());
View Full Code Here

        assertTrue("child type", child instanceof MappingElement);
        mapping = (MappingElementBase)child;
        assertFalse("expected concrete mapping second", mapping.isAbstract());
        assertEquals("mapped class", mapping.getClassName(), "org.jibx.binding.generator.DataClass1");
        assertEquals("specified element name", "class1", mapping.getName());
        assertEquals("mapped items", 1, mapping.children().size());
        child = mapping.children().get(0);
        assertTrue("child type", child instanceof StructureElement);
        struct = (StructureElement)child;
        assertEquals("mapping reference structure content", 0, struct.children().size());
        qname = struct.getMapAsQName();
View Full Code Here

        mapping = (MappingElementBase)child;
        assertFalse("expected concrete mapping second", mapping.isAbstract());
        assertEquals("mapped class", mapping.getClassName(), "org.jibx.binding.generator.DataClass1");
        assertEquals("specified element name", "class1", mapping.getName());
        assertEquals("mapped items", 1, mapping.children().size());
        child = mapping.children().get(0);
        assertTrue("child type", child instanceof StructureElement);
        struct = (StructureElement)child;
        assertEquals("mapping reference structure content", 0, struct.children().size());
        qname = struct.getMapAsQName();
        assertNotNull("type name", qname);
View Full Code Here

                        addComment(egroup, "No schema representation for " +
                            "directly-embedded type, inlining definition");
                        addComment(egroup, "Add element name to structure at " +
                            ValidationException.describe(structure) +
                            " to avoid inlining");
                        defineList(mapping.children(), egroup, agroup, false);
                       
                    } else {
                       
                        // handle abstract mapping element as reference to type
                        Element element = addChildElement(egroup, "element");
View Full Code Here

                            "definition");
                        addComment(egroup,
                            "Remove name on mapping reference at " +
                            ValidationException.describe(structure) +
                            " to avoid inlining");
                        defineList(mapping.children(), egroup, agroup, false);
                       
                    } else {
                       
                        // use element reference for concrete mapping
                        Element element = addChildElement(egroup, "element");
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.