org.openvpms.esci.ubl.io
Class UBLDocumentWriter

java.lang.Object
  extended by org.openvpms.esci.ubl.io.UBLDocumentWriter

public class UBLDocumentWriter
extends Object

UBL Document writer.

Version:
$LastChangedDate: 2006-05-02 05:16:31Z $
Author:
OpenVPMS Team

Constructor Summary
UBLDocumentWriter(UBLDocumentContext context)
          Constructs a UBLDocumentWriter.
 
Method Summary
 void setFormat(boolean format)
          Determines if the output should be formatted.
 void setFragment(boolean fragment)
          Determines if the object is a fragment of a document.
 void write(DocumentReferenceType reference, OutputStream stream)
          Writes a document reference to a stream.
 void write(DocumentReferenceType reference, OutputStream stream, boolean validate)
          Writes a simple order response to a stream, optionally validating it.
 void write(Object object, OutputStream stream)
          Writes an UBL object to a stream.
 void write(Object object, OutputStream stream, boolean validate)
          Writes an UBL object to a stream, optionally performing validation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UBLDocumentWriter

public UBLDocumentWriter(UBLDocumentContext context)
Constructs a UBLDocumentWriter.

Parameters:
context - the context
Method Detail

setFormat

public void setFormat(boolean format)
Determines if the output should be formatted.

Parameters:
format - if true, format the output

setFragment

public void setFragment(boolean fragment)
Determines if the object is a fragment of a document. If so, document level declarations are omitted. Defaults to false

Parameters:
fragment - if true, suppress document level declarations

write

public void write(Object object,
                  OutputStream stream)
           throws JAXBException
Writes an UBL object to a stream.

Validation will be performed.

Parameters:
object - the object to write
stream - the stream to write to
Throws:
JAXBException - for any error
IllegalArgumentException - if object is not a supported type

write

public void write(Object object,
                  OutputStream stream,
                  boolean validate)
           throws JAXBException
Writes an UBL object to a stream, optionally performing validation.

Parameters:
object - the object to write
stream - the stream to write to
validate - if true validate the object against it's schema
Throws:
JAXBException - for any error
IllegalArgumentException - if object is not a supported type

write

public void write(DocumentReferenceType reference,
                  OutputStream stream)
           throws JAXBException
Writes a document reference to a stream.

Validation will be performed.

Parameters:
reference - the reference to write
stream - the stream to write to
Throws:
JAXBException - for any error

write

public void write(DocumentReferenceType reference,
                  OutputStream stream,
                  boolean validate)
           throws JAXBException
Writes a simple order response to a stream, optionally validating it.

Parameters:
reference - the simple order response to write
stream - the stream to write to
validate - if true validate the order against it's schema
Throws:
JAXBException - for any error


Copyright © 2010-2011 OpenVPMS. All Rights Reserved..