Package org.exolab.castor.xml

Examples of org.exolab.castor.xml.Marshaller.marshal()


      try {
  mapping.loadMapping(mappingfile);
  Writer writer = new FileWriter(filename);
  Marshaller marshaller = new Marshaller(writer);
  marshaller.setMapping(mapping);
  marshaller.marshal(this);
  writer.close();
 
  log.info("written to XML");
      } catch (Exception e) {
  log.error(e.getMessage());
View Full Code Here


            marshaller.setValidation( false );
            marshaller.setSuppressXSIType( false );
            marshaller.setUseXSITypeAtRoot( true );
            marshaller.setMarshalExtendedType( true );
            marshaller.setResolver( _cdr );
            marshaller.marshal( obj );
        }
        finally
        {
            IOUtil.closeQuiet( writer );
        }
View Full Code Here

    marshaller = new Marshaller( writer );
    marshaller.setMapping( _mapping );

    db.begin();
    marshaller.marshal( db.load( Product.class, new Integer( 4 ) ) );
    computerOql = db.getOQLQuery( "SELECT c FROM myapp.Computer c" );
    results = computerOql.execute();
    while( results.hasMore() )
      marshaller.marshal( results.next() );
    db.commit();
View Full Code Here

    db.begin();
    marshaller.marshal( db.load( Product.class, new Integer( 4 ) ) );
    computerOql = db.getOQLQuery( "SELECT c FROM myapp.Computer c" );
    results = computerOql.execute();
    while( results.hasMore() )
      marshaller.marshal( results.next() );
    db.commit();

    db.close();
  }
View Full Code Here

      mapping.loadMapping(
        new InputSource(mis)
        );
      marshaller.setMapping(mapping);

      marshaller.marshal(settings);
    }
    catch (IOException e)
    {
      throw new JRRuntimeException(e);
    }
View Full Code Here

            }

            if (bean instanceof Collection) {
                Iterator i = ((Collection)bean).iterator();
                while (i.hasNext()) {
                    marshaller.marshal(i.next());
                }
            } else {
                marshaller.marshal(bean);
            }
        } catch (Exception e) {
View Full Code Here

                Iterator i = ((Collection)bean).iterator();
                while (i.hasNext()) {
                    marshaller.marshal(i.next());
                }
            } else {
                marshaller.marshal(bean);
            }
        } catch (Exception e) {
            getLogger().warn("Failed to marshal bean " + name, e);
        }
    }
View Full Code Here

            //2 DOCTYPE defined in the document. The XML fragment is included in
            //an XML document containing already a DOCTYPE
            marshaller.setMarshalAsDocument(false);

            // Marshall the Castor object into the stream (sink)
            marshaller.marshal(value);

            context.writeString(writer.toString());
        } catch (MarshalException me) {
            log.error(Messages.getMessage("castorMarshalException00"), me);
            throw new IOException(Messages.getMessage("castorMarshalException00")
View Full Code Here

            FileWriter writer = new FileWriter("newWeb.xml");
            XMLSerializer serializer = new XMLSerializer(writer, of);
        Marshaller marsh = new Marshaller(serializer.asDocumentHandler());
        marsh.setDebug(debug);
        marsh.setMapping(mapping);
        marsh.marshal(config);

    }


    /**
 
View Full Code Here

        try {
            Marshaller marshaller =
                new Marshaller(serializer.asDocumentHandler());
            marshaller.setMapping(getCastorMapping());
            marshaller.marshal(object);
        } catch(IOException io) {
            throw io;
        } catch (Exception e) {
            throw new IOException(e.getMessage());
        }
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.