Package org.apache.commons.betwixt.io

Examples of org.apache.commons.betwixt.io.BeanWriter.enablePrettyPrint()


        if ( bean == null ) {
            throw new Exception( "No bean read from the XML document!" );
        }
        BeanWriter writer = new BeanWriter();
        writer.getXMLIntrospector().setAttributesForPrimitives(false);
        writer.enablePrettyPrint();
        writer.write( bean );
    }
}
View Full Code Here


        Object bean = createBean();
       
        System.out.println( "Now trying pretty print" );
       
        BeanWriter writer = new BeanWriter();
        writer.enablePrettyPrint();
        writer.write( bean );
    }
   
   
    public void testLooping() throws Exception {
View Full Code Here

//        writer.setAbstractBeanWriterLog(log);
       
//        log = new SimpleLog("[testLooping]");
//        log.setLevel(SimpleLog.LOG_LEVEL_TRACE);
       
        writer.enablePrettyPrint();
        writer.write( LoopBean.createNoLoopExampleBean() );   
        writer.write( LoopBean.createLoopExampleBean() );  
       
        // test not writing IDs
        writer.setWriteIDs(false);
View Full Code Here

   
    public void testEscaping() throws Exception {
        //XXX find a way to automatically verify test
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        BeanWriter writer = new BeanWriter(out);
        writer.enablePrettyPrint();
        XMLIntrospector introspector = new XMLIntrospector();
        introspector.setAttributesForPrimitives(true);
        writer.setXMLIntrospector(introspector);
        writer.write(new LoopBean("Escape<LessThan"));
        writer.write(new LoopBean("Escape>GreaterThan"));
View Full Code Here

     * @throws RollerException
     */
    public void writeConfig( OutputStream out ) throws RollerException
    {
        BeanWriter writer = new BeanWriter( out );
        writer.enablePrettyPrint();
        writer.setIndent( "    " );
        writer.setWriteIDs( false );

        try
        {
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.