Package org.jibx.custom.classes

Examples of org.jibx.custom.classes.ValueCustom


        assertEquals("namespace setting", "http://www.sosnoski.com/ws", clas.getNamespace());
        assertEquals("name-style setting", CustomBase.CAMEL_CASE_NAMES, clas.getNameStyle());
        assertEquals("derived name", "dataClass1", clas.getElementName());
        Collection members = clas.getMembers();
        assertEquals("property count", 4, members.size());
        ValueCustom member = clas.getMember("boolean");
        assertNotNull("boolean member", member);
        assertEquals("boolean type", "boolean", member.getWorkingType());
        assertEquals("boolean name", "boolean", member.getXmlName());
        assertFalse("boolean required", member.isRequired());
        member = clas.getMember("int");
        assertNotNull("int member", member);
        assertEquals("int type", "int", member.getWorkingType());
        assertEquals("int name", "int", member.getXmlName());
        assertFalse("int required", member.isRequired());
        member = clas.getMember("linked");
        assertNotNull("linked member", member);
        assertEquals("linked type", "org.jibx.binding.generator.DataClass1", member.getWorkingType());
        assertEquals("linked name", "linked", member.getXmlName());
        assertFalse("linked required", member.isRequired());
        member = clas.getMember("string");
        assertNotNull("string member", member);
        assertEquals("string type", "java.lang.String", member.getWorkingType());
        assertEquals("string name", "string", member.getXmlName());
        assertFalse("string required", member.isRequired());
    }
View Full Code Here


        GlobalCustom custom = readCustom(SIMPLE_PROPERTIES_CLASS);
        ClassCustom clas = custom.getClassCustomization("org.jibx.binding.generator.DataClass1");
        assertTrue("property-access setting", clas.isPropertyAccess());
        Collection members = clas.getMembers();
        assertEquals("property count", 4, members.size());
        ValueCustom member = clas.getMember("boolean");
        assertNotNull("boolean member", member);
        assertEquals("boolean type", "boolean", member.getWorkingType());
        assertEquals("boolean name", "boolean", member.getXmlName());
        assertTrue("boolean required", member.isRequired());
        member = clas.getMember("int");
        assertNotNull("int member", member);
        assertEquals("int type", "int", member.getWorkingType());
        assertEquals("int name", "int", member.getXmlName());
        assertTrue("int required", member.isRequired());
        member = clas.getMember("linked");
        assertNotNull("linked member", member);
        assertEquals("linked type", "org.jibx.binding.generator.DataClass1", member.getWorkingType());
        assertEquals("linked name", "linked", member.getXmlName());
        assertFalse("linked required", member.isRequired());
        member = clas.getMember("string");
        assertNotNull("string member", member);
        assertEquals("string type", "java.lang.String", member.getWorkingType());
        assertEquals("string name", "string", member.getXmlName());
        assertFalse("string required", member.isRequired());
    }
View Full Code Here

    public void testMultipleFieldsClasses() throws Exception {
        GlobalCustom custom = readCustom(MULTIPLE_FIELDS_CLASSES);
        ClassCustom clas = custom.getClassCustomization("org.jibx.binding.generator.DataClass2");
        Collection members = clas.getMembers();
        assertEquals("property count", 1, members.size());
        ValueCustom member = clas.getMember("dataClass1s");
        assertNotNull("dataClass1s member", member);
        assertEquals("dataClass1s type", "java.util.List", member.getWorkingType());
        assertEquals("dataClass1s name", "dataClass1s", member.getXmlName());
        assertTrue("dataClass1s collection", member.isCollection());
        assertEquals("dataClass1s type", "java.lang.Object", member.getItemType());
        assertEquals("dataClass1s name", "dataClass1", member.getItemName());
        clas = custom.getClassCustomization("org.jibx.binding.generator.DataClass1");
        members = clas.getMembers();
        assertEquals("property count", 4, members.size());
        member = clas.getMember("boolean");
        assertNotNull("boolean member", member);
        assertEquals("boolean type", "boolean", member.getWorkingType());
        assertEquals("boolean name", "boolean", member.getXmlName());
        assertFalse("boolean required", member.isRequired());
        member = clas.getMember("int");
        assertNotNull("int member", member);
        assertEquals("int type", "int", member.getWorkingType());
        assertEquals("int name", "int", member.getXmlName());
        assertFalse("int required", member.isRequired());
        member = clas.getMember("linked");
        assertNotNull("linked member", member);
        assertEquals("linked type", "org.jibx.binding.generator.DataClass1", member.getWorkingType());
        assertEquals("linked name", "linked", member.getXmlName());
        assertFalse("linked required", member.isRequired());
        member = clas.getMember("string");
        assertNotNull("string member", member);
        assertEquals("string type", "java.lang.String", member.getWorkingType());
        assertEquals("string name", "string", member.getXmlName());
        assertTrue("string required", member.isRequired());
    }
View Full Code Here

    public void testMultiplePropertiesClasses() throws Exception {
        GlobalCustom custom = readCustom(MULTIPLE_PROPERTIES_CLASSES);
        ClassCustom clas = custom.getClassCustomization("org.jibx.binding.generator.DataClass2");
        Collection members = clas.getMembers();
        assertEquals("property count", 1, members.size());
        ValueCustom member = clas.getMember("dataClass1s");
        assertNotNull("dataClass1s member", member);
        assertEquals("dataClass1s type", "java.util.List", member.getWorkingType());
        assertEquals("dataClass1s name", "dataClass1s", member.getXmlName());
        assertFalse("dataClass1s required", member.isRequired());
        assertTrue("dataClass1s collection", member.isCollection());
        assertEquals("dataClass1s type", "org.jibx.binding.generator.DataClass1", member.getItemType());
        assertEquals("dataClass1s name", "dataClass1", member.getItemName());
        clas = custom.getClassCustomization("org.jibx.binding.generator.DataClass1");
        members = clas.getMembers();
        assertEquals("property count", 4, members.size());
        member = clas.getMember("boolean");
        assertNotNull("boolean member", member);
        assertEquals("boolean type", "boolean", member.getWorkingType());
        assertEquals("boolean name", "boolean", member.getXmlName());
        assertTrue("boolean required", member.isRequired());
        member = clas.getMember("int");
        assertNotNull("int member", member);
        assertEquals("int type", "int", member.getWorkingType());
        assertEquals("int name", "int", member.getXmlName());
        assertFalse("int required", member.isRequired());
        member = clas.getMember("linked");
        assertNotNull("linked member", member);
        assertEquals("linked type", "org.jibx.binding.generator.DataClass1", member.getWorkingType());
        assertEquals("linked name", "linked", member.getXmlName());
        assertFalse("linked required", member.isRequired());
        member = clas.getMember("string");
        assertNotNull("string member", member);
        assertEquals("string type", "java.lang.String", member.getWorkingType());
        assertEquals("string name", "string", member.getXmlName());
        assertFalse("string required", member.isRequired());
    }
View Full Code Here

    public void testNonstandardPropertiesClasses() throws Exception {
        GlobalCustom custom = readCustom(NONSTANDARD_PROPERTIES_CLASSES);
        ClassCustom clas = custom.getClassCustomization("org.jibx.binding.generator.DataClass2");
        Collection members = clas.getMembers();
        assertEquals("property count", 2, members.size());
        ValueCustom member = clas.getMember("dataClass1s");
        assertNotNull("dataClass1s member", member);
        assertEquals("dataClass1s type", "java.util.List", member.getWorkingType());
        assertEquals("dataClass1s name", "dataClass1s", member.getXmlName());
        assertFalse("dataClass1s required", member.isRequired());
        assertTrue("dataClass1s collection", member.isCollection());
        assertEquals("dataClass1s type", "org.jibx.binding.generator.DataClass1", member.getItemType());
        assertEquals("dataClass1s name", "dataClass1", member.getItemName());
        assertEquals("property count", 2, members.size());
        member = clas.getMember("nonstandardValue");
        assertNotNull("value member", member);
        assertEquals("value type", "int", member.getWorkingType());
        assertEquals("value name", "nonstandardValue", member.getXmlName());
        assertFalse("value required", member.isRequired());
        assertFalse("value collection", member.isCollection());
    }
View Full Code Here

                include = true;
            } else {
               
                // check each member to find anything to be included
                for (Iterator iter = clas.getMembers().iterator(); iter.hasNext();) {
                    ValueCustom memb = (ValueCustom)iter.next();
                    String mtype = memb.isCollection() ? memb.getItemType() : memb.getWorkingType();
                    if (Types.isSimpleValue(mtype) || isValueClass(mtype) || !m_global.isKnownMapping(mtype)
                        || checkInclude(mtype)) {
                        include = true;
                        break;
                    }
View Full Code Here

                refmap.incrementCount(type);
            }
           
            // expand all references from members
            for (Iterator iter = clas.getMembers().iterator(); iter.hasNext();) {
                ValueCustom memb = (ValueCustom)iter.next();
                String mtype = memb.isCollection() ? memb.getItemType() : memb.getWorkingType();
                if (!Types.isSimpleValue(mtype) && !isValueClass(mtype) && !m_global.isKnownMapping(mtype)) {
                    if ((mtype.startsWith("java.")) || (mtype.startsWith("javax."))) {
                        throw new IllegalStateException("No way to handle type " + mtype + ", referenced from " + type);
                    } else if (checkInclude(mtype)) {
                        if (refmap.incrementCount(mtype) <= 1) {
View Full Code Here

       
        // generate binding component for each member of class
        for (Iterator iter = cust.getMembers().iterator(); iter.hasNext();) {
           
            // skip this member if excluded property
            ValueCustom memb = (ValueCustom)iter.next();
            String gmeth = memb.getGetName();
            String smeth = memb.getSetName();
            if (memb.isProperty() && !memb.isPrivate()) {
                ValueCustom match = (ValueCustom)(gmeth != null ? exmethmap.get(gmeth) : exmethmap.get(smeth));
                if (match == null) {
                   
                    // add methods for included property to map implemented for this binding
                    if (inmethmap != null) {
                        if (gmeth != null) {
View Full Code Here

TOP

Related Classes of org.jibx.custom.classes.ValueCustom

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.