@NotThreadSafe public class PeppolSBDHDocumentReader extends Object
| Constructor and Description |
|---|
PeppolSBDHDocumentReader() |
PeppolSBDHDocumentReader(com.helger.peppol.identifier.factory.IIdentifierFactory aIdentifierFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected com.helger.sbdh.SBDMarshaller |
createSBDMarshaller()
Create a new SBD marshaller used for reading SBD documents.
|
PeppolSBDHDocument |
extractData(InputStream aStandardBusinessDocument)
Extract the document data from the Standard Business Document represents by
the passed parameter.
|
PeppolSBDHDocument |
extractData(com.helger.commons.io.resource.IReadableResource aStandardBusinessDocument)
Extract the document data from the Standard Bussiness Document represents
by the passed parameter.
|
PeppolSBDHDocument |
extractData(Node aStandardBusinessDocument)
Extract the document data from the Standard Bussiness Document represents
by the passed parameter.
|
PeppolSBDHDocument |
extractData(org.unece.cefact.namespaces.sbdh.StandardBusinessDocument aStandardBusinessDocument)
Extract the document data from the Standard Bussiness Document represents
by the passed parameter.
|
protected boolean |
isValidBusinessMessage(Element aBusinessMessage)
Check if the passed business message is valid or not.
|
protected boolean |
isValidCreationDateTime(LocalDateTime aCreationDateTime)
Check if the passed document identification creation date time is valid or
not.
|
protected boolean |
isValidDocumentTypeIdentifier(String sDocumentTypeIdentifier)
Check if the passed document type identifier is valid or not.
|
protected boolean |
isValidHeaderVersion(String sHeaderVersion)
Check if the passed header version is valid or not.
|
protected boolean |
isValidInstanceIdentifier(String sInstanceIdentifier)
Check if the passed document identification instance identifier is valid or
not.
|
protected boolean |
isValidProcessIdentifier(String sProcessIdentifier)
Check if the passed process identifier is valid or not.
|
protected boolean |
isValidReceiverAuthority(String sReceiverAuthority)
Check if the passed receiver authority is valid or not.
|
protected boolean |
isValidReceiverIdentifier(String sReceiverAuthority,
String sReceiverIdentifier)
Check if the passed receiver identifier is valid or not.
|
protected boolean |
isValidSenderAuthority(String sSenderAuthority)
Check if the passed sender authority is valid or not.
|
protected boolean |
isValidSenderIdentifier(String sSenderAuthority,
String sSenderIdentifier)
Check if the passed sender identifier is valid or not.
|
protected boolean |
isValidStandard(String sStandard,
Element aBusinessMessage)
Check if the passed document identification standard is valid or not.
|
protected boolean |
isValidType(String sType,
Element aBusinessMessage)
Check if the passed document identification type is valid or not.
|
protected boolean |
isValidTypeVersion(String sTypeVersion,
Element aBusinessMessage)
Check if the passed document identification type version is valid or not.
|
public PeppolSBDHDocumentReader()
public PeppolSBDHDocumentReader(@Nonnull com.helger.peppol.identifier.factory.IIdentifierFactory aIdentifierFactory)
@OverrideOnDemand protected boolean isValidHeaderVersion(@Nullable String sHeaderVersion)
CPeppolSBDH.HEADER_VERSION. Override this method to allow for
other schemes as well.sHeaderVersion - The value to be checked. This is the content of the XML element
HeaderVersion. May be null.true if the value is valid, false
otherwise.@OverrideOnDemand protected boolean isValidSenderAuthority(@Nullable String sSenderAuthority)
PeppolIdentifierHelper.DEFAULT_PARTICIPANT_SCHEME. Override
this method to allow for other schemes as well.sSenderAuthority - The value to be checked. This is the content of the XML attribute
Sender/Identifier/@Authority. May be null.true if the value is valid, false
otherwise.@OverrideOnDemand protected boolean isValidSenderIdentifier(@Nullable String sSenderAuthority, @Nullable String sSenderIdentifier)
sSenderAuthority - The authority of the sender that was already validated with
isValidSenderAuthority(String). This parameter is present
to allow for different identifier checks for different authorities.
May be null.sSenderIdentifier - The value to be checked. This conforms to the XML element value of
Sender/Identifier. May be null.true if the value is valid for the given authority,
false otherwise.@OverrideOnDemand protected boolean isValidReceiverAuthority(@Nullable String sReceiverAuthority)
PeppolIdentifierHelper.DEFAULT_PARTICIPANT_SCHEME. Override
this method to allow for other schemes as well.sReceiverAuthority - The value to be checked. This is the content of the XML attribute
Receiver/Identifier/@Authority. May be
null.true if the value is valid, false
otherwise.@OverrideOnDemand protected boolean isValidReceiverIdentifier(@Nullable String sReceiverAuthority, @Nullable String sReceiverIdentifier)
sReceiverAuthority - The authority of the receiver that was already validated with
isValidReceiverAuthority(String). This parameter is present
to allow for different identifier checks for different authorities.
May be null.sReceiverIdentifier - The value to be checked. This conforms to the XML element value of
Receiver/Identifier. May be null.true if the value is valid for the given authority,
false otherwise.@OverrideOnDemand protected boolean isValidDocumentTypeIdentifier(@Nullable String sDocumentTypeIdentifier)
sDocumentTypeIdentifier - The value to be checked excluding the PEPPOL identifier scheme. This
conforms to the XML element value of
BusinessScope/Scope[Type/text()="DOCUMENTID"]/InstanceIdentifier
. May be null.true if the value is valid, false
otherwise.@OverrideOnDemand protected boolean isValidProcessIdentifier(@Nullable String sProcessIdentifier)
sProcessIdentifier - The value to be checked excluding the PEPPOL identifier scheme. This
conforms to the XML element value of
BusinessScope/Scope[Type/text()="PROCESSID"]/InstanceIdentifier
. May be null.true if the value is valid, false
otherwise.@OverrideOnDemand protected boolean isValidBusinessMessage(@Nonnull Element aBusinessMessage)
true since the element is never
null and no UBL specific checks are performed. Override this
method to perform further or other checks.aBusinessMessage - The business message element to check against. Never
null.true if the value is valid, false
otherwise.@OverrideOnDemand protected boolean isValidStandard(@Nullable String sStandard, @Nonnull Element aBusinessMessage)
sStandard - The value to be checked. This corresponds to the field
"DocumentIdentification/Standard". May be null.aBusinessMessage - The business message element to check against. Never
null.true if the value is valid, false
otherwise.@OverrideOnDemand protected boolean isValidTypeVersion(@Nullable String sTypeVersion, @Nonnull Element aBusinessMessage)
sTypeVersion - The value to be checked. This corresponds to the field
"DocumentIdentification/TypeVersion". May be null.aBusinessMessage - The business message element to check against. Never
null.true if the value is valid, false
otherwise.@OverrideOnDemand protected boolean isValidType(@Nullable String sType, @Nonnull Element aBusinessMessage)
sType - The value to be checked. This corresponds to the field
"DocumentIdentification/Type". May be null.aBusinessMessage - The business message element to check against. Never
null.true if the value is valid, false
otherwise.@OverrideOnDemand protected boolean isValidInstanceIdentifier(@Nullable String sInstanceIdentifier)
sInstanceIdentifier - The value to be checked. This corresponds to the field
"DocumentIdentification/InstanceIdentifier". May be
null .true if the value is valid, false
otherwise.@OverrideOnDemand protected boolean isValidCreationDateTime(@Nonnull LocalDateTime aCreationDateTime)
null.
Override this method to perform further or other checks.aCreationDateTime - The value to be checked. This corresponds to the field
"DocumentIdentification/CreationDateAndTime". Is never
null .true if the value is valid, false
otherwise.@Nonnull @OverrideOnDemand protected com.helger.sbdh.SBDMarshaller createSBDMarshaller()
SBDMarshaller and never
null.@Nonnull public PeppolSBDHDocument extractData(@Nonnull @WillClose InputStream aStandardBusinessDocument) throws PeppolSBDHDocumentReadException
aStandardBusinessDocument - The input stream to read from. Will be closed by this method. May
not be null.null.PeppolSBDHDocumentReadException - In case the passed Standard Business Document does not conform to
the PEPPOL rules.@Nonnull public PeppolSBDHDocument extractData(@Nonnull com.helger.commons.io.resource.IReadableResource aStandardBusinessDocument) throws PeppolSBDHDocumentReadException
aStandardBusinessDocument - The resource to read from. May not be null.null.PeppolSBDHDocumentReadException - In case the passed Standard Business Document does not conform to
the PEPPOL rules.@Nonnull public PeppolSBDHDocument extractData(@Nonnull Node aStandardBusinessDocument) throws PeppolSBDHDocumentReadException
aStandardBusinessDocument - The DOM node to read from. May not be null.null.PeppolSBDHDocumentReadException - In case the passed Standard Business Document does not conform to
the PEPPOL rules.@Nonnull public PeppolSBDHDocument extractData(@Nonnull org.unece.cefact.namespaces.sbdh.StandardBusinessDocument aStandardBusinessDocument) throws PeppolSBDHDocumentReadException
aStandardBusinessDocument - The domain object to read from. May not be null.null.PeppolSBDHDocumentReadException - In case the passed Standard Business Document does not conform to
the PEPPOL rules.Copyright © 2014–2018 Philip Helger. All rights reserved.