Examples of CapitalizeNameMapper


Examples of org.apache.commons.betwixt.strategy.CapitalizeNameMapper

        writer = new BeanWriter(out);
        writer.setWriteEmptyElements(true);
        writer.getXMLIntrospector().setWrapCollectionsInElement(true);
        writer.setWriteIDs(false);
        writer.getXMLIntrospector().setElementNameMapper(new CapitalizeNameMapper());
        writer.write("CarryOn", names);
       
        xml = "<?xml version='1.0'?><CarryOn><Names>"
         + "<Name><Name>Sid James</Name></Name>"
         + "<Name><Name>Kenneth Williams</Name></Name>"
         + "<Name><Name>Joan Simms</Name></Name>"
         + "<Name><Name>Charles Hawtrey</Name></Name>"
         + "</Names>"
         +"</CarryOn>";
        
        xmlAssertIsomorphicContent(
                            parseString(out.getBuffer().toString()),
                            parseString(xml),
                            true);
                           
        ArrayList things = new ArrayList();
        things.add(new NameBean("Sugar"));
        things.add(new NameBean("Spice"));
        things.add(new NameBean("All Things Nice"));
       
        NoAdderBean bean = new NoAdderBean();
        bean.setThings(things);
       
        out = new StringWriter();
        out.write("<?xml version='1.0'?>");
        writer = new BeanWriter(out);
        writer.setWriteEmptyElements(true);
        writer.getXMLIntrospector().setWrapCollectionsInElement(true);
        writer.setWriteIDs(false);
        writer.write(bean);
       
        xml = "<?xml version='1.0'?><NoAdderBean><things>"
         + "<NameBean><name>Sugar</name></NameBean>"
         + "<NameBean><name>Spice</name></NameBean>"
         + "<NameBean><name>All Things Nice</name></NameBean>"
         + "</things>"
         +"</NoAdderBean>";
        
        xmlAssertIsomorphicContent(
                            parseString(out.getBuffer().toString()),
                            parseString(xml),
                            true);
       
        out = new StringWriter();
        out.write("<?xml version='1.0'?>");
        writer = new BeanWriter(out);
        writer.setWriteEmptyElements(true);
        writer.getXMLIntrospector().setWrapCollectionsInElement(true);
        writer.setWriteIDs(false);
        writer.getXMLIntrospector().setElementNameMapper(new CapitalizeNameMapper());
        writer.write(bean);
       
        xml = "<?xml version='1.0'?><NoAdderBean><Things>"
         + "<NameBean><Name>Sugar</Name></NameBean>"
         + "<NameBean><Name>Spice</Name></NameBean>"
View Full Code Here

Examples of org.apache.commons.betwixt.strategy.CapitalizeNameMapper

//        testLog.setLevel(SimpleLog.LOG_LEVEL_TRACE);
    }

    public void testCapitalizeNameMapper() throws Exception {
//        testLog.debug("Testing capitalize name mapper");
        doTest(new CapitalizeNameMapper(), "capitalize name mapper");
    }
View Full Code Here

Examples of org.apache.commons.betwixt.strategy.CapitalizeNameMapper

        writer = new BeanWriter(out);
        writer.setWriteEmptyElements(true);
        writer.getXMLIntrospector().getConfiguration().setWrapCollectionsInElement(true);
        writer.getBindingConfiguration().setMapIDs(false);
        writer.getXMLIntrospector().getConfiguration().setElementNameMapper(new CapitalizeNameMapper());
        writer.write("CarryOn", names);
       
        xml = "<?xml version='1.0'?><CarryOn><Names>"
         + "<Name><Name>Sid James</Name></Name>"
         + "<Name><Name>Kenneth Williams</Name></Name>"
         + "<Name><Name>Joan Simms</Name></Name>"
         + "<Name><Name>Charles Hawtrey</Name></Name>"
         + "</Names>"
         +"</CarryOn>";
        
        xmlAssertIsomorphicContent(
                            parseString(out.getBuffer().toString()),
                            parseString(xml),
                            true);
                           
        ArrayList things = new ArrayList();
        things.add(new NameBean("Sugar"));
        things.add(new NameBean("Spice"));
        things.add(new NameBean("All Things Nice"));
       
        NoAdderBean bean = new NoAdderBean();
        bean.setThings(things);
       
        out = new StringWriter();
        out.write("<?xml version='1.0'?>");
        writer = new BeanWriter(out);
        writer.setWriteEmptyElements(true);
        writer.getXMLIntrospector().getConfiguration().setWrapCollectionsInElement(true);
        writer.getBindingConfiguration().setMapIDs(false);
        writer.write(bean);
       
        xml = "<?xml version='1.0'?><NoAdderBean><things>"
         + "<NameBean><name>Sugar</name></NameBean>"
         + "<NameBean><name>Spice</name></NameBean>"
         + "<NameBean><name>All Things Nice</name></NameBean>"
         + "</things>"
         +"</NoAdderBean>";
        
        xmlAssertIsomorphicContent(
                            parseString(out.getBuffer().toString()),
                            parseString(xml),
                            true);
       
        out = new StringWriter();
        out.write("<?xml version='1.0'?>");
        writer = new BeanWriter(out);
        writer.setWriteEmptyElements(true);
        writer.getXMLIntrospector().getConfiguration().setWrapCollectionsInElement(true);
        writer.getBindingConfiguration().setMapIDs(false);
        writer.getXMLIntrospector().getConfiguration().setElementNameMapper(new CapitalizeNameMapper());
        writer.write(bean);
       
        xml = "<?xml version='1.0'?><NoAdderBean><Things>"
         + "<NameBean><Name>Sugar</Name></NameBean>"
         + "<NameBean><Name>Spice</Name></NameBean>"
View Full Code Here

Examples of org.apache.commons.betwixt.strategy.CapitalizeNameMapper

    private BindingConfiguration noIDsBindingConfiguration = new BindingConfiguration();
   
    public TestCollectives(String testName) {
        super(testName);
       
        CapitalizeNameMapper capitalizeNameMapper = new CapitalizeNameMapper();
        categoriesIntrospectionConfiguration.setAttributesForPrimitives(false);
        categoriesIntrospectionConfiguration.setElementNameMapper(capitalizeNameMapper);
        categoriesIntrospectionConfiguration.setAttributeNameMapper(capitalizeNameMapper);
        categoriesIntrospectionConfiguration.setWrapCollectionsInElement(false);   
       
View Full Code Here

Examples of org.apache.commons.betwixt.strategy.CapitalizeNameMapper

//        testLog.setLevel(SimpleLog.LOG_LEVEL_TRACE);
    }

    public void testCapitalizeNameMapper() throws Exception {
//        testLog.debug("Testing capitalize name mapper");
        doTest(new CapitalizeNameMapper(), "capitalize name mapper");
    }
View Full Code Here

Examples of org.apache.commons.betwixt.strategy.CapitalizeNameMapper

    protected static NameMapper createNameMapper(String name) {
        if ( name.equalsIgnoreCase( "lowercase" ) ) {
            return new DecapitalizeNameMapper();
        }
        else if ( name.equalsIgnoreCase( "uppercase" ) ) {
            return new CapitalizeNameMapper();
        }
        else if ( name.equalsIgnoreCase( "hyphenated" ) ) {
            return new HyphenatedNameMapper();
        }
        else {
View Full Code Here

Examples of org.apache.commons.betwixt.strategy.CapitalizeNameMapper

        writer = new BeanWriter(out);
        writer.setWriteEmptyElements(true);
        writer.getXMLIntrospector().getConfiguration().setWrapCollectionsInElement(true);
        writer.getBindingConfiguration().setMapIDs(false);
        writer.getXMLIntrospector().getConfiguration().setElementNameMapper(new CapitalizeNameMapper());
        writer.write("CarryOn", names);
       
        xml = "<?xml version='1.0'?><CarryOn><Names>"
         + "<Name><Name>Sid James</Name></Name>"
         + "<Name><Name>Kenneth Williams</Name></Name>"
         + "<Name><Name>Joan Simms</Name></Name>"
         + "<Name><Name>Charles Hawtrey</Name></Name>"
         + "</Names>"
         +"</CarryOn>";
        
        xmlAssertIsomorphicContent(
                            parseString(out.getBuffer().toString()),
                            parseString(xml),
                            true);
                           
        ArrayList things = new ArrayList();
        things.add(new NameBean("Sugar"));
        things.add(new NameBean("Spice"));
        things.add(new NameBean("All Things Nice"));
       
        NoAdderBean bean = new NoAdderBean();
        bean.setThings(things);
       
        out = new StringWriter();
        out.write("<?xml version='1.0'?>");
        writer = new BeanWriter(out);
        writer.setWriteEmptyElements(true);
        writer.getXMLIntrospector().getConfiguration().setWrapCollectionsInElement(true);
        writer.getBindingConfiguration().setMapIDs(false);
        writer.write(bean);
       
        xml = "<?xml version='1.0'?><NoAdderBean><things>"
         + "<NameBean><name>Sugar</name></NameBean>"
         + "<NameBean><name>Spice</name></NameBean>"
         + "<NameBean><name>All Things Nice</name></NameBean>"
         + "</things>"
         +"</NoAdderBean>";
        
        xmlAssertIsomorphicContent(
                            parseString(out.getBuffer().toString()),
                            parseString(xml),
                            true);
       
        out = new StringWriter();
        out.write("<?xml version='1.0'?>");
        writer = new BeanWriter(out);
        writer.setWriteEmptyElements(true);
        writer.getXMLIntrospector().getConfiguration().setWrapCollectionsInElement(true);
        writer.getBindingConfiguration().setMapIDs(false);
        writer.getXMLIntrospector().getConfiguration().setElementNameMapper(new CapitalizeNameMapper());
        writer.write(bean);
       
        xml = "<?xml version='1.0'?><NoAdderBean><Things>"
         + "<NameBean><Name>Sugar</Name></NameBean>"
         + "<NameBean><Name>Spice</Name></NameBean>"
View Full Code Here

Examples of org.apache.commons.betwixt.strategy.CapitalizeNameMapper

    private BindingConfiguration noIDsBindingConfiguration = new BindingConfiguration();
   
    public TestCollectives(String testName) {
        super(testName);
       
        CapitalizeNameMapper capitalizeNameMapper = new CapitalizeNameMapper();
        categoriesIntrospectionConfiguration.setAttributesForPrimitives(false);
        categoriesIntrospectionConfiguration.setElementNameMapper(capitalizeNameMapper);
        categoriesIntrospectionConfiguration.setAttributeNameMapper(capitalizeNameMapper);
        categoriesIntrospectionConfiguration.setWrapCollectionsInElement(false);   
       
View Full Code Here

Examples of org.apache.commons.betwixt.strategy.CapitalizeNameMapper

//        testLog.setLevel(SimpleLog.LOG_LEVEL_TRACE);
    }

    public void testCapitalizeNameMapper() throws Exception {
//        testLog.debug("Testing capitalize name mapper");
        doTest(new CapitalizeNameMapper(), "capitalize name mapper");
    }
View Full Code Here

Examples of org.apache.commons.betwixt.strategy.CapitalizeNameMapper

        writer = new BeanWriter(out);
        writer.setWriteEmptyElements(true);
        writer.getXMLIntrospector().getConfiguration().setWrapCollectionsInElement(true);
        writer.getBindingConfiguration().setMapIDs(false);
        writer.getXMLIntrospector().getConfiguration().setElementNameMapper(new CapitalizeNameMapper());
        writer.write("CarryOn", names);
       
        xml = "<?xml version='1.0'?><CarryOn><Names>"
         + "<Name><Name>Sid James</Name></Name>"
         + "<Name><Name>Kenneth Williams</Name></Name>"
         + "<Name><Name>Joan Simms</Name></Name>"
         + "<Name><Name>Charles Hawtrey</Name></Name>"
         + "</Names>"
         +"</CarryOn>";
        
        xmlAssertIsomorphicContent(
                            parseString(out.getBuffer().toString()),
                            parseString(xml),
                            true);
                           
        ArrayList things = new ArrayList();
        things.add(new NameBean("Sugar"));
        things.add(new NameBean("Spice"));
        things.add(new NameBean("All Things Nice"));
       
        NoAdderBean bean = new NoAdderBean();
        bean.setThings(things);
       
        out = new StringWriter();
        out.write("<?xml version='1.0'?>");
        writer = new BeanWriter(out);
        writer.setWriteEmptyElements(true);
        writer.getXMLIntrospector().getConfiguration().setWrapCollectionsInElement(true);
        writer.getBindingConfiguration().setMapIDs(false);
        writer.write(bean);
       
        xml = "<?xml version='1.0'?><NoAdderBean><things>"
         + "<NameBean><name>Sugar</name></NameBean>"
         + "<NameBean><name>Spice</name></NameBean>"
         + "<NameBean><name>All Things Nice</name></NameBean>"
         + "</things>"
         +"</NoAdderBean>";
        
        xmlAssertIsomorphicContent(
                            parseString(out.getBuffer().toString()),
                            parseString(xml),
                            true);
       
        out = new StringWriter();
        out.write("<?xml version='1.0'?>");
        writer = new BeanWriter(out);
        writer.setWriteEmptyElements(true);
        writer.getXMLIntrospector().getConfiguration().setWrapCollectionsInElement(true);
        writer.getBindingConfiguration().setMapIDs(false);
        writer.getXMLIntrospector().getConfiguration().setElementNameMapper(new CapitalizeNameMapper());
        writer.write(bean);
       
        xml = "<?xml version='1.0'?><NoAdderBean><Things>"
         + "<NameBean><Name>Sugar</Name></NameBean>"
         + "<NameBean><Name>Spice</Name></NameBean>"
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.