import ch.codeblock.qrinvoice.QrInvoiceCodeParser;
import ch.codeblock.qrinvoice.model.ParseException;
import ch.codeblock.qrinvoice.model.QrInvoice;
import ch.codeblock.qrinvoice.model.validation.ValidationException;
import ch.codeblock.qrinvoice.model.validation.ValidationResult;
import java.math.BigDecimal;
// ...
final String spc = "SPC\n" +
"...";
try {
final QrInvoice qrInvoice = QrInvoiceCodeParser.create().parse(spc);
// access QR-Invoice structure
final BigDecimal amount = qrInvoice.getPaymentAmountInformation().getAmount();
// ...
} catch (ParseException e) {
// parsing exception handling
}