Examples of DecapitalizeNameMapper


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

        introspector.getConfiguration().setAttributesForPrimitives(false);

        // wrap collections in an XML element
        //introspector.setWrapCollectionsInElement(true);
        // turn bean elements first letter into lower case
        introspector.getConfiguration().setElementNameMapper(new DecapitalizeNameMapper());
        introspector.getConfiguration().setAttributeNameMapper(new DecapitalizeNameMapper());

        introspector.getConfiguration().setPluralStemmer(new DefaultPluralStemmer());

        return introspector;
    }
View Full Code Here

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

        introspector.getConfiguration().setAttributesForPrimitives(false);

        // wrap collections in an XML element
        //introspector.setWrapCollectionsInElement(true);
        // turn bean elements first letter into lower case
        introspector.getConfiguration().setElementNameMapper(new DecapitalizeNameMapper());
        introspector.getConfiguration().setAttributeNameMapper(new DecapitalizeNameMapper());

        introspector.getConfiguration().setPluralStemmer(new DefaultPluralStemmer());

        return introspector;
    }
View Full Code Here

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

     * standard named strategies such as 'lowercase', 'uppercase' or 'hyphenated'
     * or use the name as a class name and create a new instance.
     */
    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" ) ) {
View Full Code Here

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

        // wrap collections in an XML element
        introspector.getConfiguration().setWrapCollectionsInElement(false);

        // turn bean elements first letter into lower case
        introspector.getConfiguration().setElementNameMapper( new DecapitalizeNameMapper() );

        // Set default plural stemmer.
        introspector.getConfiguration().setPluralStemmer( new DefaultPluralStemmer() );

        return introspector;
View Full Code Here

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

        // This will set our ElementMapper.
        introspector.getConfiguration().setElementNameMapper(new HyphenatedNameMapper(true, "_"));
        // since our attribute names will use a different
        // naming convention in our xml file (just all lowercase)
        // we set another mapper for the attributes
        introspector.getConfiguration().setAttributeNameMapper(new DecapitalizeNameMapper());

        return introspector;
    }
View Full Code Here

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

       
        StringWriter out = new StringWriter();
        out.write("<?xml version='1.0'?>");
        BeanWriter writer = new BeanWriter(out);
    writer.getBindingConfiguration().setMapIDs(false);
        writer.getXMLIntrospector().getConfiguration().setElementNameMapper(new DecapitalizeNameMapper());
        writer.write(dynasaur);
       
        String xml = "<?xml version='1.0'?><dynasaur><species>Allosaurus</species>"
            + "<isRaptor>true</isRaptor><period>Jurassic</period></dynasaur>";
       
View Full Code Here

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

        DynaWithDotBetwixt bean = new DynaWithDotBetwixt("Tweedledum","Tweedledee");
        StringWriter out = new StringWriter();
        out.write("<?xml version='1.0'?>");
        BeanWriter writer = new BeanWriter(out);
    writer.getBindingConfiguration().setMapIDs(false);
        writer.getXMLIntrospector().getConfiguration().setElementNameMapper(new DecapitalizeNameMapper());
        writer.write("bean", bean);
       
        String xml = "<?xml version='1.0'?><bean><ndp>Tweedledum</ndp></bean>";
        xmlAssertIsomorphicContent
                            "Test write dyna beans with dt betwixt",
View Full Code Here

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

            BeanWriter beanWriter = new BeanWriter(outputWriter);
            beanWriter.getXMLIntrospector().setAttributesForPrimitives(false);
            beanWriter.setWriteIDs(false);
            beanWriter.enablePrettyPrint();

            beanWriter.getXMLIntrospector().setElementNameMapper(new DecapitalizeNameMapper());
            configureBindings(beanWriter);
            installCircularRelationshipsHack(beanWriter);
            ElementDescriptor descriptor = getElementDescriptor(
                    beanWriter.getXMLIntrospector(), XPlannerData.class, "objects");
            String collectionName = "objects";
View Full Code Here

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

        doTest(new CapitalizeNameMapper(), "capitalize name mapper");
    }

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

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

        // wrap collections in an XML element
        introspector.getConfiguration().setWrapCollectionsInElement(false);

        // turn bean elements first letter into lower case
        introspector.getConfiguration().setElementNameMapper( new DecapitalizeNameMapper() );

        // Set default plural stemmer.
        introspector.getConfiguration().setPluralStemmer( new DefaultPluralStemmer() );

        return introspector;
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.