Examples of GlobalCustom


Examples of org.jibx.custom.classes.GlobalCustom

        assertEquals("get root", custom, custom.getGlobal());
        assertNull("empty namespace",custom.getNamespace());
    }
   
    public void testSimplePackage() throws Exception {
        GlobalCustom custom = readCustom(SIMPLE_PACKAGE);
        PackageCustom pack = custom.getPackage("org.jibx.binding");
        assertTrue("map-abstract default", pack.isMapAbstract());
        assertEquals("name style default", CustomBase.CAMEL_CASE_NAMES, pack.getNameStyle());
        assertEquals("value style default", NestingBase.ATTRIBUTE_VALUE_STYLE, pack.getValueStyle("int"));
        assertFalse("require setting", pack.isObjectRequired("java.lang.String"));
        assertTrue("require setting", pack.isPrimitiveRequired("int"));
View Full Code Here

Examples of org.jibx.custom.classes.GlobalCustom

        assertEquals("get root", custom, pack.getGlobal());
        assertEquals("package namespace", "urn:binding", pack.getNamespace());
    }
   
    public void testNestedPackage() throws Exception {
        GlobalCustom custom = readCustom(NESTED_PACKAGE);
        PackageCustom pack = custom.getPackage("org.jibx.binding.generator");
        assertTrue("map-abstract default", pack.isMapAbstract());
        assertEquals("name style default", CustomBase.CAMEL_CASE_NAMES, pack.getNameStyle());
        assertEquals("value style default", NestingBase.ATTRIBUTE_VALUE_STYLE, pack.getValueStyle("int"));
        assertFalse("require setting", pack.isObjectRequired("java.lang.String"));
        assertTrue("require setting", pack.isPrimitiveRequired("int"));
View Full Code Here

Examples of org.jibx.custom.classes.GlobalCustom

        assertEquals("get root", custom, pack.getGlobal());
        assertEquals("package namespace", "urn:binding/generator", pack.getNamespace());
    }
   
    public void testMultiplePackage() throws Exception {
        GlobalCustom custom = readCustom(MULTIPLE_PACKAGE);
        PackageCustom pack = custom.getPackage("org.jibx.binding.generator");
        assertTrue("property-access setting", pack.isPropertyAccess());
        assertEquals("package namespace", "urn:binding.generator", pack.getNamespace());
        pack = custom.getPackage("org.jibx.runtime");
        assertTrue("property-access setting", pack.isPropertyAccess());
        assertEquals("package namespace", "urn:runtime", pack.getNamespace());
        pack = custom.getPackage("org.jibx.extras");
        assertFalse("property-access setting", pack.isPropertyAccess());
        assertNull("package namespace", pack.getNamespace());
        assertEquals("simple name", "a", pack.convertName("a"));
        assertEquals("simple name", "a", pack.convertName("A"));
        assertEquals("simple name", "aName", pack.convertName("aName"));
View Full Code Here

Examples of org.jibx.custom.classes.GlobalCustom

        assertEquals("complex name", "aBCDefgH",
            pack.convertName("aB_cDefgH"));
    }
   
    public void testHyphenated() throws Exception {
        GlobalCustom custom = readCustom(MULTIPLE_PACKAGE_HYPHENATED);
        PackageCustom pack = custom.getPackage("org.jibx.binding.generator");
        assertEquals("simple name", "a", pack.convertName("a"));
        assertEquals("simple name", "a", pack.convertName("A"));
        assertEquals("simple name", "a-name", pack.convertName("aName"));
        assertEquals("leading underscore name", "a-name",
            pack.convertName("__aName"));
View Full Code Here

Examples of org.jibx.custom.classes.GlobalCustom

        assertEquals("complex name", "a-b-c-defg-h",
            pack.convertName("aB_cDefgH"));
    }
   
    public void testUpperCamelCase() throws Exception {
        GlobalCustom custom = readCustom(MULTIPLE_PACKAGE_UPPERCAMELCASE);
        PackageCustom pack = custom.getPackage("org.jibx.binding.generator");
        assertEquals("simple name", "A", pack.convertName("a"));
        assertEquals("simple name", "A", pack.convertName("A"));
        assertEquals("simple name", "AName", pack.convertName("aName"));
        assertEquals("leading underscore name", "AName",
            pack.convertName("__aName"));
View Full Code Here

Examples of org.jibx.custom.classes.GlobalCustom

        assertEquals("complex name", "ABCDefgH",
            pack.convertName("aB_cDefgH"));
    }
   
    public void testDotted() throws Exception {
        GlobalCustom custom = readCustom(MULTIPLE_PACKAGE_DOTTED);
        PackageCustom pack = custom.getPackage("org.jibx.binding.generator");
        assertEquals("simple name", "a", pack.convertName("a"));
        assertEquals("simple name", "a", pack.convertName("A"));
        assertEquals("simple name", "a.name", pack.convertName("aName"));
        assertEquals("leading underscore name", "a.name",
            pack.convertName("__aName"));
View Full Code Here

Examples of org.jibx.custom.classes.GlobalCustom

        assertEquals("complex name", "a.b.c.defg.h",
            pack.convertName("aB_cDefgH"));
    }
   
    public void testUnderscored() throws Exception {
        GlobalCustom custom = readCustom(MULTIPLE_PACKAGE_UNDERSCORED);
        PackageCustom pack = custom.getPackage("org.jibx.binding.generator");
        assertEquals("simple name", "a", pack.convertName("a"));
        assertEquals("simple name", "a", pack.convertName("A"));
        assertEquals("simple name", "a_name", pack.convertName("aName"));
        assertEquals("leading underscore name", "a_name",
            pack.convertName("__aName"));
View Full Code Here

Examples of org.jibx.custom.classes.GlobalCustom

     *
     * @param parms generation parameters
     */
    private Jibx2Wsdl(WsdlGeneratorCommandLine parms) {
        m_generationParameters = parms;
        GlobalCustom global = parms.getGlobal();
        m_bindingGenerator = new BindGen(global);
        m_schemaGenerator = new SchemaGen(parms.getLocator(), global, parms.getUriNames());
        m_uriSchemaMap = new HashMap();
    }
View Full Code Here

Examples of org.jibx.custom.classes.GlobalCustom

                mapping.setCreateType(value.getCreateType());
                mapping.setFactoryName(value.getFactoryMethod());
               
                // generate the mapping type name from item class name and suffix
                String suffix;
                GlobalCustom global = m_generationParameters.getGlobal();
                IClass clas = global.getClassInfo(type);
                if (clas.isImplements("Ljava/util/List;")) {
                    suffix = "List";
                } else if (clas.isImplements("Ljava/util/Set;")) {
                    suffix = "Set";
                } else {
                    suffix = "Collection";
                }
                String itype = value.getItemType();
                ClassCustom cust = global.addClassCustomization(itype);
               
                // register the type name for mapping
                String name = cust.getSimpleName() + suffix;
                String uri = bind.getNamespace();
                qname = new QName(uri, CustomBase.convertName(name, CustomBase.CAMEL_CASE_NAMES));
View Full Code Here

Examples of org.jibx.custom.classes.GlobalCustom

                }
            }
        }
       
        // include extra classes as needing concrete mappings
        GlobalCustom global = m_generationParameters.getGlobal();
        for (int i = 0; i < extras.size(); i++) {
            String type = (String)extras.get(i);
            if (!concrs.contains(type)) {
                concrs.add(type);
                global.addClassCustomization(type);
                qnames.add(null);
            }
        }
       
        // generate bindings for all data classes used
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.