Package eu.europa.ec.taxud.cesop.readers
Class PspXmlReader
- java.lang.Object
-
- eu.europa.ec.taxud.cesop.readers.PspXmlReader
-
- All Implemented Interfaces:
IPspXmlReader
,AutoCloseable
,Iterator<XmlPaymentDataMsgPart>
public class PspXmlReader extends Object implements IPspXmlReader
Utils class reading a PSP XML file.
-
-
Constructor Summary
Constructors Constructor Description PspXmlReader(InputStream inputStream, long estimatedSize, int maxTransactionsInPart, boolean validateXsd)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
long
getEstimatedContentSize()
Gets estimated content size.XmlMessageSpec
getXmlMessageSpec()
Returns parsed MessageSpec part.XmlPsp
getXmlReportingPsp()
Returns parsed MessageSpec part.boolean
hasNext()
XmlPaymentDataMsgPart
next()
Parse the next part of payment data.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Constructor Detail
-
PspXmlReader
public PspXmlReader(InputStream inputStream, long estimatedSize, int maxTransactionsInPart, boolean validateXsd) throws XMLStreamException
Constructor.- Parameters:
inputStream
- the input stream. The input stream is not closed byPspXmlReader
.estimatedSize
- estimated content length in bytes, negative means that estimation is not availablemaxTransactionsInPart
- the max number of transactions to be included in a payment data msg partvalidateXsd
- true if validation againstXsdSchema
needed- Throws:
XMLStreamException
- in case of error while processing the XML content
-
-
Method Detail
-
getEstimatedContentSize
public long getEstimatedContentSize()
Description copied from interface:IPspXmlReader
Gets estimated content size.- Specified by:
getEstimatedContentSize
in interfaceIPspXmlReader
- Returns:
- returns content size in bytes if available. If not, returns -1.
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfaceIterator<XmlPaymentDataMsgPart>
-
next
public XmlPaymentDataMsgPart next()
Description copied from interface:IPspXmlReader
Parse the next part of payment data. For every payee it first yields one or more parts withPaymentDataMsgPartContentType.REPORTED_TRANSACTIONS
type. Then, after all payee transactions are produced, onePaymentDataMsgPartContentType.REPORTED_PAYEE
part is yielded.- Specified by:
next
in interfaceIPspXmlReader
- Specified by:
next
in interfaceIterator<XmlPaymentDataMsgPart>
-
getXmlMessageSpec
public XmlMessageSpec getXmlMessageSpec()
Description copied from interface:IPspXmlReader
Returns parsed MessageSpec part. Available at any point of iteration.- Specified by:
getXmlMessageSpec
in interfaceIPspXmlReader
- Returns:
- the xml message spec
-
getXmlReportingPsp
public XmlPsp getXmlReportingPsp()
Description copied from interface:IPspXmlReader
Returns parsed MessageSpec part. Available at any point of iteration.- Specified by:
getXmlReportingPsp
in interfaceIPspXmlReader
- Returns:
- the xml reporting psp
-
close
public void close() throws Exception
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
-