org.openvpms.esci.ubl.io
Class UBLDocumentReader

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

public class UBLDocumentReader
extends Object

UBL Document reader.

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

Constructor Summary
UBLDocumentReader(UBLDocumentContext context)
          Constructs an UBLDocumentReader.
 
Method Summary
 Object read(File file)
          Reads an UBL document from a file.
 Object read(InputStream stream)
          Reads an UBL document from a stream.
 Object read(InputStream stream, boolean validate)
          Reads an UBL document from 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

UBLDocumentReader

public UBLDocumentReader(UBLDocumentContext context)
Constructs an UBLDocumentReader.

Parameters:
context - the document context
Method Detail

read

public Object read(File file)
            throws FileNotFoundException,
                   JAXBException
Reads an UBL document from a file.

Validation will be performed.

Parameters:
file - the file to read from
Returns:
a instance of the JAXB class representing the document
Throws:
FileNotFoundException - if the file cannot be found
JAXBException - if the document cannot be read

read

public Object read(InputStream stream)
            throws JAXBException
Reads an UBL document from a stream.

Validation will be performed.

Parameters:
stream - the stream to read from
Returns:
a instance of the JAXB class representing the document
Throws:
JAXBException - if the document cannot be read

read

public Object read(InputStream stream,
                   boolean validate)
            throws JAXBException
Reads an UBL document from a stream, optionally performing validation.

Parameters:
stream - the stream to read from
validate - if true validate the document
Returns:
a instance of the JAXB class representing the document
Throws:
JAXBException - if the document cannot be read


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