Examples/src/main/java/org/openestate/io/examples/CasaItWritingExample.java
@SuppressWarnings("Duplicates")
    public static void main(String[] args) {
        // init logging
        PropertyConfigurator.configure(
                CasaItWritingExample.class.getResource(PACKAGE + "/log4j.properties"));

        // create a Container object with some example data
        // this object corresponds to the <container> root element in XML
        Container container = FACTORY.createContainer();
        container.setRealestateitems(FACTORY.createContainerRealestateitems());

        // append some example objects to the Container object
        container.getRealestateitems().getRealestate().add(createRealestate());
        container.getRealestateitems().getRealestate().add(createRealestate());
        container.getRealestateitems().getRealestate().add(createRealestate());

        // convert the Container object into a XML document
        CasaItDocument doc = null;
        try {
            doc = CasaItDocument.newDocument(container);
        } catch (Exception ex) {
            LOGGER.error("Can't create XML document!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }

        // write XML document into a java.io.File
        try {
            write(doc, File.createTempFile("output-", ".xml"));
        } catch (IOException ex) {
            LOGGER.error("Can't create temporary file!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }

        // write XML document into a java.io.OutputStream
        write(doc, new NullOutputStream());

        // write XML document into a java.io.Writer
        write(doc, new NullWriter());

        // write XML document into a string and send it to the console
        writeToConsole(doc);
    }
@SuppressWarnings("Duplicates")
    public static void main(String[] args) {
        // init logging
        PropertyConfigurator.configure(
                CasaItWritingExample.class.getResource(PACKAGE + "/log4j.properties"));

        // create a Container object with some example data
        // this object corresponds to the <container> root element in XML
        Container container = FACTORY.createContainer();
        container.setRealestateitems(FACTORY.createContainerRealestateitems());

        // append some example objects to the Container object
        container.getRealestateitems().getRealestate().add(createRealestate());
        container.getRealestateitems().getRealestate().add(createRealestate());
        container.getRealestateitems().getRealestate().add(createRealestate());

        // convert the Container object into a XML document
        CasaItDocument doc = null;
        try {
            doc = CasaItDocument.newDocument(container);
        } catch (Exception ex) {
            LOGGER.error("Can't create XML document!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }

        // write XML document into a java.io.File
        try {
            write(doc, File.createTempFile("output-", ".xml"));
        } catch (IOException ex) {
            LOGGER.error("Can't create temporary file!");
            LOGGER.error("> " + ex.getLocalizedMessage(), ex);
            System.exit(1);
        }

        // write XML document into a java.io.OutputStream
        write(doc, new NullOutputStream());

        // write XML document into a java.io.Writer
        write(doc, new NullWriter());

        // write XML document into a string and send it to the console
        writeToConsole(doc);
    }
@ SuppressWarnings ( "Duplicates" ) public static void main ( String [ ] args ) { // init logging PropertyConfigurator . configure ( CasaItWritingExample . class . getResource ( PACKAGE + "/log4j.properties" ) ) ; // create a Container object with some example data // this object corresponds to the <container> root element in XML Container container = FACTORY . createContainer ( ) ; container . setRealestateitems ( FACTORY . createContainerRealestateitems ( ) ) ; // append some example objects to the Container object container . getRealestateitems ( ) . getRealestate ( ) . add ( createRealestate ( ) ) ; container . getRealestateitems ( ) . getRealestate ( ) . add ( createRealestate ( ) ) ; container . getRealestateitems ( ) . getRealestate ( ) . add ( createRealestate ( ) ) ; // convert the Container object into a XML document CasaItDocument doc = null ; try { doc = CasaItDocument . newDocument ( container ) ; } catch ( Exception ex ) { LOGGER . error ( "Can't create XML document!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; System . exit ( 1 ) ; } // write XML document into a java.io.File try { write ( doc , File . createTempFile ( "output-" , ".xml" ) ) ; } catch ( IOException ex ) { LOGGER . error ( "Can't create temporary file!" ) ; LOGGER . error ( "> " + ex . getLocalizedMessage ( ) , ex ) ; System . exit ( 1 ) ; } // write XML document into a java.io.OutputStream write ( doc , new NullOutputStream ( ) ) ; // write XML document into a java.io.Writer write ( doc , new NullWriter ( ) ) ; // write XML document into a string and send it to the console writeToConsole ( doc ) ; }
Start the example application.

@param args command line arguments
Start the example application .