FileDocCategorySizeDatePackage
BetwixtExample.javaAPI DocExample2919Wed May 18 09:39:02 BST 2005com.discursive.jccook.xml.bean

BetwixtExample

public class BetwixtExample extends Object
Include a table of the Values in DateFormatUtils

Fields Summary
private static Logger
logger
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] pArgs)

      LogInit.init(); 
        BetwixtExample example = new BetwixtExample();
        example.testXmlOutput();
        example.testCustomXmlOutput();
    
public voidtestCustomXmlOutput()


        List plays = new ArrayList();

        InputStream input = getClass().getResourceAsStream("./plays.xml");
        URL rules = getClass().getResource("./play-rules.xml");
        Digester digester = DigesterLoader.createDigester(rules);
        digester.push(plays);
        Object root = digester.parse(input);

        logger.debug("Number of plays: " + plays.size());

        Play play = (Play) plays.get(0);

        BeanWriter beanWriter = new BeanWriter();
        beanWriter.enablePrettyPrint();
        beanWriter.write(play);

        logger.debug(beanWriter.toString());
    
public voidtestXmlOutput()


        List plays = new ArrayList();

        InputStream input = getClass().getResourceAsStream("./plays.xml");
        URL rules = getClass().getResource("./play-rules.xml");
        Digester digester = DigesterLoader.createDigester(rules);
        digester.push(plays);
        Object root = digester.parse(input);

        logger.debug("Number of plays: " + plays.size());

        Play play = (Play) plays.get(0);

        BeanWriter beanWriter = new BeanWriter();
        beanWriter.enablePrettyPrint();
        beanWriter.write(play);

        logger.debug(beanWriter.toString());