Examples of registerBeanClass()


Examples of org.apache.commons.betwixt.io.BeanReader.registerBeanClass()

//        log = new SimpleLog("[testSimpleRead:XMLIntrospector]");
//        log.setLevel(SimpleLog.LOG_LEVEL_TRACE);
//        reader.getXMLIntrospector().setLog(log);
       
        reader.registerBeanClass( IDBean.class );

        InputStream in = new FileInputStream(
            getTestFile("src/test/org/apache/commons/betwixt/digester/SimpleReadTest.xml") );
           
        try {       
View Full Code Here

Examples of org.apache.commons.betwixt.io.BeanReader.registerBeanClass()

//
//        log = new SimpleLog("[testIDRead:XMLIntrospector]");
//        log.setLevel(SimpleLog.LOG_LEVEL_TRACE);
//        reader.getXMLIntrospector().setLog(log);
       
        reader.registerBeanClass( IDBean.class );

        InputStream in = new FileInputStream(
            getTestFile("src/test/org/apache/commons/betwixt/digester/IDTest1.xml") );
           
        try {
View Full Code Here

Examples of org.apache.commons.betwixt.io.BeanReader.registerBeanClass()

    protected BeanReader createBeanReader(Class beanClass)
        throws Exception
    {
        BeanReader reader = new BeanReader();
        reader.setXMLIntrospector(createXMLIntrospector());
        reader.registerBeanClass(beanClass);
        return reader;
    }

    /**
     * ### it would be really nice to move this somewhere shareable across Maven
View Full Code Here

Examples of org.apache.commons.betwixt.io.BeanReader.registerBeanClass()

    protected BeanReader createBeanReader()
        throws Exception
    {
        BeanReader reader = new BeanReader();
        reader.setXMLIntrospector(createXMLIntrospector());
        reader.registerBeanClass(ScarabSettings.class);
        return reader;
    }

    /**
     * ### it would be really nice to move this somewhere shareable across Maven
View Full Code Here

Examples of org.apache.commons.betwixt.io.BeanReader.registerBeanClass()

        super(testName);
    }
   
    public void testBeanWriter() throws Exception {
        BeanReader reader = new BeanReader();
        reader.registerBeanClass( getBeanClass() );

        InputStream in = getXMLInput();
        try {
            Object bean = reader.parse( in );
View Full Code Here

Examples of org.apache.commons.betwixt.io.BeanReader.registerBeanClass()

        beanWriter.write(bean);
        stringWriter.flush();
        String xml = "<?xml version='1.0'?>" + stringWriter.toString();
       
        BeanReader reader = new BeanReader();
        reader.registerBeanClass( PersonBean.class );
        bean = (PersonBean) reader.parse(new StringReader(xml));
       
        assertEquals("Person age wrong", 21 , bean.getAge());
        assertEquals("Person name wrong", "Samual Smith" , bean.getName());
       
View Full Code Here

Examples of org.apache.commons.betwixt.io.BeanReader.registerBeanClass()

        write( bean, buffer );
       

        // create a BeanReader
        BeanReader reader = new BeanReader();
        reader.registerBeanClass( Channel.class );

        // Register local copies of the DTDs we understand
        for (int i = 0; i < registrations.length; i += 2) {
            URL url = RSSDigester.class.getResource(registrations[i + 1]);
            if (url != null) {
View Full Code Here

Examples of org.apache.commons.betwixt.io.BeanReader.registerBeanClass()

    }
   
    public void run(String[] args) throws Exception {
        BeanReader reader = new BeanReader();
       
        reader.registerBeanClass( Channel.class );
       
        // Register local copies of the DTDs we understand
        for (int i = 0; i < registrations.length; i += 2) {
            URL url = RSSDigester.class.getResource(registrations[i + 1]);
            if (url != null) {
View Full Code Here

Examples of org.apache.commons.betwixt.io.BeanReader.registerBeanClass()

        chain.insertBeanCreator(1, new EnumCreator());
       
        BeanReader reader = new BeanReader();
        reader.getXMLIntrospector().setAttributesForPrimitives(true);
        reader.getXMLIntrospector().setWrapCollectionsInElement(false);
        reader.registerBeanClass("houses", HouseBeans.class);
        reader.getReadConfiguration().setBeanCreationChain(chain);
       
        StringReader in = new StringReader(xml);
        HouseBeans newHouses = (HouseBeans) reader.parse(in);
        assertNotNull("Parsing should return a bean", newHouses);
View Full Code Here

Examples of org.apache.commons.betwixt.io.BeanReader.registerBeanClass()

        chain.insertBeanCreator(1, new EnumCreator());
       
        BeanReader reader = new BeanReader();
        reader.getXMLIntrospector().setAttributesForPrimitives(true);
        reader.getXMLIntrospector().setWrapCollectionsInElement(false);
        reader.registerBeanClass("houses", HouseBeans.class);
        reader.getReadConfiguration().setBeanCreationChain(chain);
       
        StringReader in = new StringReader(xml);
        HouseBeans newHouses = (HouseBeans) reader.parse(in);
        assertNotNull("Parsing should return a bean", newHouses);
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.